# WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.2

import enum
import sys
import types
import typing
import uuid

import winsdk._winrt as _winrt

try:
    import winsdk.windows.foundation
except Exception:
    pass

class WorkItemOptions(enum.IntFlag):
    NONE = 0
    TIME_SLICED = 0x1

class WorkItemPriority(enum.IntEnum):
    LOW = -1
    NORMAL = 0
    HIGH = 1

class ThreadPool(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> ThreadPool: ...
    @typing.overload
    @staticmethod
    def run_async(handler: WorkItemHandler) -> winsdk.windows.foundation.IAsyncAction: ...
    @typing.overload
    @staticmethod
    def run_async(handler: WorkItemHandler, priority: WorkItemPriority) -> winsdk.windows.foundation.IAsyncAction: ...
    @typing.overload
    @staticmethod
    def run_async(handler: WorkItemHandler, priority: WorkItemPriority, options: WorkItemOptions) -> winsdk.windows.foundation.IAsyncAction: ...

class ThreadPoolTimer(_winrt.Object):
    delay: winsdk.windows.foundation.TimeSpan
    period: winsdk.windows.foundation.TimeSpan
    @staticmethod
    def _from(obj: _winrt.Object) -> ThreadPoolTimer: ...
    @typing.overload
    def cancel(self) -> None: ...
    @typing.overload
    @staticmethod
    def create_periodic_timer(handler: TimerElapsedHandler, period: winsdk.windows.foundation.TimeSpan) -> ThreadPoolTimer: ...
    @typing.overload
    @staticmethod
    def create_periodic_timer(handler: TimerElapsedHandler, period: winsdk.windows.foundation.TimeSpan, destroyed: TimerDestroyedHandler) -> ThreadPoolTimer: ...
    @typing.overload
    @staticmethod
    def create_timer(handler: TimerElapsedHandler, delay: winsdk.windows.foundation.TimeSpan) -> ThreadPoolTimer: ...
    @typing.overload
    @staticmethod
    def create_timer(handler: TimerElapsedHandler, delay: winsdk.windows.foundation.TimeSpan, destroyed: TimerDestroyedHandler) -> ThreadPoolTimer: ...

TimerDestroyedHandler = typing.Callable[[ThreadPoolTimer], None]

TimerElapsedHandler = typing.Callable[[ThreadPoolTimer], None]

WorkItemHandler = typing.Callable[[winsdk.windows.foundation.IAsyncAction], None]

