# WARNING: Please don't edit this file. It was generated by Python/WinRT v3.0.0

import datetime
import sys
import types
import typing
import uuid as _uuid
from builtins import property as _property

import winrt._winrt
import winrt.system
import winrt.windows.devices.gpio.provider as windows_devices_gpio_provider
import winrt.windows.foundation as windows_foundation
import winrt.windows.foundation.collections as windows_foundation_collections

from winrt.windows.devices.gpio import GpioChangePolarity, GpioOpenStatus, GpioPinDriveMode, GpioPinEdge, GpioPinValue, GpioSharingMode

Self = typing.TypeVar('Self')

@typing.final
class GpioChangeCount:
    @_property
    def count(self) -> winrt.system.UInt64: ...
    @_property
    def relative_time(self) -> datetime.timedelta: ...
    def __new__(cls, count: winrt.system.UInt64 = 0, relative_time: datetime.timedelta = datetime.timedelta(0)) -> GpioChangeCount: ...
    def __replace__(self, /, **changes: typing.Any) -> GpioChangeCount: ...
    def unpack(self) -> typing.Tuple[winrt.system.UInt64, datetime.timedelta]: ...

@typing.final
class GpioChangeRecord:
    @_property
    def relative_time(self) -> datetime.timedelta: ...
    @_property
    def edge(self) -> GpioPinEdge: ...
    def __new__(cls, relative_time: datetime.timedelta = datetime.timedelta(0), edge: GpioPinEdge = GpioPinEdge(0)) -> GpioChangeRecord: ...
    def __replace__(self, /, **changes: typing.Any) -> GpioChangeRecord: ...
    def unpack(self) -> typing.Tuple[datetime.timedelta, GpioPinEdge]: ...

@typing.final
class GpioChangeCounter(winrt.system.Object, windows_foundation.IClosable):
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, exc_type: typing.Optional[typing.Type[BaseException]], exc_value: typing.Optional[BaseException], traceback: typing.Optional[types.TracebackType]) -> None: ...
    def __new__(cls: typing.Type[Self], pin: GpioPin) -> Self: ...
    # System.Void Windows.Devices.Gpio.GpioChangeCounter::Close()
    def close(self) -> None: ...
    # Windows.Devices.Gpio.GpioChangeCount Windows.Devices.Gpio.GpioChangeCounter::Read()
    def read(self) -> GpioChangeCount: ...
    # Windows.Devices.Gpio.GpioChangeCount Windows.Devices.Gpio.GpioChangeCounter::Reset()
    def reset(self) -> GpioChangeCount: ...
    # System.Void Windows.Devices.Gpio.GpioChangeCounter::Start()
    def start(self) -> None: ...
    # System.Void Windows.Devices.Gpio.GpioChangeCounter::Stop()
    def stop(self) -> None: ...
    # Windows.Devices.Gpio.GpioChangePolarity Windows.Devices.Gpio.GpioChangeCounter::get_Polarity()
    @_property
    def polarity(self) -> GpioChangePolarity: ...
    # System.Void Windows.Devices.Gpio.GpioChangeCounter::put_Polarity(Windows.Devices.Gpio.GpioChangePolarity)
    @polarity.setter
    def polarity(self, value: GpioChangePolarity) -> None: ...
    # System.Boolean Windows.Devices.Gpio.GpioChangeCounter::get_IsStarted()
    @_property
    def is_started(self) -> bool: ...

@typing.final
class GpioChangeReader(winrt.system.Object, windows_foundation.IClosable):
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, exc_type: typing.Optional[typing.Type[BaseException]], exc_value: typing.Optional[BaseException], traceback: typing.Optional[types.TracebackType]) -> None: ...
    @typing.overload
    def __new__(cls: typing.Type[Self], pin: GpioPin) -> Self: ...
    @typing.overload
    def __new__(cls: typing.Type[Self], pin: GpioPin, min_capacity: winrt.system.Int32) -> Self: ...
    # System.Void Windows.Devices.Gpio.GpioChangeReader::Clear()
    def clear(self) -> None: ...
    # System.Void Windows.Devices.Gpio.GpioChangeReader::Close()
    def close(self) -> None: ...
    # Windows.Foundation.Collections.IVector`1<Windows.Devices.Gpio.GpioChangeRecord> Windows.Devices.Gpio.GpioChangeReader::GetAllItems()
    def get_all_items(self) -> typing.MutableSequence[GpioChangeRecord]: ...
    # Windows.Devices.Gpio.GpioChangeRecord Windows.Devices.Gpio.GpioChangeReader::GetNextItem()
    def get_next_item(self) -> GpioChangeRecord: ...
    # Windows.Devices.Gpio.GpioChangeRecord Windows.Devices.Gpio.GpioChangeReader::PeekNextItem()
    def peek_next_item(self) -> GpioChangeRecord: ...
    # System.Void Windows.Devices.Gpio.GpioChangeReader::Start()
    def start(self) -> None: ...
    # System.Void Windows.Devices.Gpio.GpioChangeReader::Stop()
    def stop(self) -> None: ...
    # Windows.Foundation.IAsyncAction Windows.Devices.Gpio.GpioChangeReader::WaitForItemsAsync(System.Int32)
    def wait_for_items_async(self, count: winrt.system.Int32, /) -> windows_foundation.IAsyncAction: ...
    # Windows.Devices.Gpio.GpioChangePolarity Windows.Devices.Gpio.GpioChangeReader::get_Polarity()
    @_property
    def polarity(self) -> GpioChangePolarity: ...
    # System.Void Windows.Devices.Gpio.GpioChangeReader::put_Polarity(Windows.Devices.Gpio.GpioChangePolarity)
    @polarity.setter
    def polarity(self, value: GpioChangePolarity) -> None: ...
    # System.Int32 Windows.Devices.Gpio.GpioChangeReader::get_Capacity()
    @_property
    def capacity(self) -> winrt.system.Int32: ...
    # System.Boolean Windows.Devices.Gpio.GpioChangeReader::get_IsEmpty()
    @_property
    def is_empty(self) -> bool: ...
    # System.Boolean Windows.Devices.Gpio.GpioChangeReader::get_IsOverflowed()
    @_property
    def is_overflowed(self) -> bool: ...
    # System.Boolean Windows.Devices.Gpio.GpioChangeReader::get_IsStarted()
    @_property
    def is_started(self) -> bool: ...
    # System.Int32 Windows.Devices.Gpio.GpioChangeReader::get_Length()
    @_property
    def length(self) -> winrt.system.Int32: ...

@typing.final
class GpioController_Static(winrt._winrt.IInspectable_Static):
    # Windows.Foundation.IAsyncOperation`1<Windows.Foundation.Collections.IVectorView`1<Windows.Devices.Gpio.GpioController>> Windows.Devices.Gpio.GpioController::GetControllersAsync(Windows.Devices.Gpio.Provider.IGpioProvider)
    def get_controllers_async(cls, provider: windows_devices_gpio_provider.IGpioProvider, /) -> windows_foundation.IAsyncOperation[typing.Sequence[GpioController]]: ...
    # Windows.Devices.Gpio.GpioController Windows.Devices.Gpio.GpioController::GetDefault()
    def get_default(cls) -> GpioController: ...
    # Windows.Foundation.IAsyncOperation`1<Windows.Devices.Gpio.GpioController> Windows.Devices.Gpio.GpioController::GetDefaultAsync()
    def get_default_async(cls) -> windows_foundation.IAsyncOperation[GpioController]: ...

@typing.final
class GpioController(winrt.system.Object, metaclass=GpioController_Static):
    # Windows.Devices.Gpio.GpioPin Windows.Devices.Gpio.GpioController::OpenPin(System.Int32)
    def open_pin(self, pin_number: winrt.system.Int32, /) -> GpioPin: ...
    # Windows.Devices.Gpio.GpioPin Windows.Devices.Gpio.GpioController::OpenPin(System.Int32,Windows.Devices.Gpio.GpioSharingMode)
    def open_pin_with_sharing_mode(self, pin_number: winrt.system.Int32, sharing_mode: GpioSharingMode, /) -> GpioPin: ...
    # System.Boolean Windows.Devices.Gpio.GpioController::TryOpenPin(System.Int32,Windows.Devices.Gpio.GpioSharingMode,Windows.Devices.Gpio.GpioPin&,Windows.Devices.Gpio.GpioOpenStatus&)
    def try_open_pin(self, pin_number: winrt.system.Int32, sharing_mode: GpioSharingMode, /) -> typing.Tuple[bool, GpioPin, GpioOpenStatus]: ...
    # System.Int32 Windows.Devices.Gpio.GpioController::get_PinCount()
    @_property
    def pin_count(self) -> winrt.system.Int32: ...

@typing.final
class GpioPin(winrt.system.Object, windows_foundation.IClosable):
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, exc_type: typing.Optional[typing.Type[BaseException]], exc_value: typing.Optional[BaseException], traceback: typing.Optional[types.TracebackType]) -> None: ...
    # System.Void Windows.Devices.Gpio.GpioPin::Close()
    def close(self) -> None: ...
    # Windows.Devices.Gpio.GpioPinDriveMode Windows.Devices.Gpio.GpioPin::GetDriveMode()
    def get_drive_mode(self) -> GpioPinDriveMode: ...
    # System.Boolean Windows.Devices.Gpio.GpioPin::IsDriveModeSupported(Windows.Devices.Gpio.GpioPinDriveMode)
    def is_drive_mode_supported(self, drive_mode: GpioPinDriveMode, /) -> bool: ...
    # Windows.Devices.Gpio.GpioPinValue Windows.Devices.Gpio.GpioPin::Read()
    def read(self) -> GpioPinValue: ...
    # System.Void Windows.Devices.Gpio.GpioPin::SetDriveMode(Windows.Devices.Gpio.GpioPinDriveMode)
    def set_drive_mode(self, value: GpioPinDriveMode, /) -> None: ...
    # System.Void Windows.Devices.Gpio.GpioPin::Write(Windows.Devices.Gpio.GpioPinValue)
    def write(self, value: GpioPinValue, /) -> None: ...
    # Windows.Foundation.EventRegistrationToken Windows.Devices.Gpio.GpioPin::add_ValueChanged(Windows.Foundation.TypedEventHandler`2<Windows.Devices.Gpio.GpioPin,Windows.Devices.Gpio.GpioPinValueChangedEventArgs>)
    def add_value_changed(self, handler: windows_foundation.TypedEventHandler[GpioPin, GpioPinValueChangedEventArgs], /) -> windows_foundation.EventRegistrationToken: ...
    # System.Void Windows.Devices.Gpio.GpioPin::remove_ValueChanged(Windows.Foundation.EventRegistrationToken)
    def remove_value_changed(self, token: typing.Union[windows_foundation.EventRegistrationToken, typing.Tuple[winrt.system.Int64]], /) -> None: ...
    # Windows.Foundation.TimeSpan Windows.Devices.Gpio.GpioPin::get_DebounceTimeout()
    @_property
    def debounce_timeout(self) -> datetime.timedelta: ...
    # System.Void Windows.Devices.Gpio.GpioPin::put_DebounceTimeout(Windows.Foundation.TimeSpan)
    @debounce_timeout.setter
    def debounce_timeout(self, value: datetime.timedelta) -> None: ...
    # System.Int32 Windows.Devices.Gpio.GpioPin::get_PinNumber()
    @_property
    def pin_number(self) -> winrt.system.Int32: ...
    # Windows.Devices.Gpio.GpioSharingMode Windows.Devices.Gpio.GpioPin::get_SharingMode()
    @_property
    def sharing_mode(self) -> GpioSharingMode: ...

@typing.final
class GpioPinValueChangedEventArgs(winrt.system.Object):
    # Windows.Devices.Gpio.GpioPinEdge Windows.Devices.Gpio.GpioPinValueChangedEventArgs::get_Edge()
    @_property
    def edge(self) -> GpioPinEdge: ...

