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

import enum
import datetime
import sys
import types
import typing

import winsdk.system
import winsdk.windows.foundation

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

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

Self = typing.TypeVar('Self')

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

class ThreadPoolTimer(winsdk.system.Object):
    delay: datetime.timedelta
    period: datetime.timedelta
    @staticmethod
    def _from(obj: winsdk.system.Object) -> ThreadPoolTimer: ...
    def cancel(self) -> None: ...
    @typing.overload
    @staticmethod
    def create_periodic_timer(handler: typing.Optional[TimerElapsedHandler], period: datetime.timedelta) -> typing.Optional[ThreadPoolTimer]: ...
    @typing.overload
    @staticmethod
    def create_periodic_timer(handler: typing.Optional[TimerElapsedHandler], period: datetime.timedelta, destroyed: typing.Optional[TimerDestroyedHandler]) -> typing.Optional[ThreadPoolTimer]: ...
    @typing.overload
    @staticmethod
    def create_timer(handler: typing.Optional[TimerElapsedHandler], delay: datetime.timedelta) -> typing.Optional[ThreadPoolTimer]: ...
    @typing.overload
    @staticmethod
    def create_timer(handler: typing.Optional[TimerElapsedHandler], delay: datetime.timedelta, destroyed: typing.Optional[TimerDestroyedHandler]) -> typing.Optional[ThreadPoolTimer]: ...

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

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

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

