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

import enum
import datetime
import sys
import types
import typing

import winsdk._winrt as _winrt
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(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> ThreadPool: ...
    @typing.overload
    @staticmethod
    def run_async(handler: typing.Optional[WorkItemHandler]) -> typing.Optional[winsdk.windows.foundation.IAsyncAction]: ...
    @typing.overload
    @staticmethod
    def run_async(handler: typing.Optional[WorkItemHandler], priority: WorkItemPriority) -> typing.Optional[winsdk.windows.foundation.IAsyncAction]: ...
    @typing.overload
    @staticmethod
    def run_async(handler: typing.Optional[WorkItemHandler], priority: WorkItemPriority, options: WorkItemOptions) -> typing.Optional[winsdk.windows.foundation.IAsyncAction]: ...

class ThreadPoolTimer(_winrt.Object):
    delay: datetime.timedelta
    period: datetime.timedelta
    @staticmethod
    def _from(obj: _winrt.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[[typing.Optional[winsdk.windows.foundation.IAsyncAction]], None]

