# Stubs for pyboot.ui — generated for IDE completion; see ui.py for behavior.
from __future__ import annotations

import datetime
from types import TracebackType
from typing import (
    Any,
    Callable,
    ClassVar,
    Dict,
    List,
    Optional,
    Sequence,
    Tuple,
    Union,
)

from typing_extensions import Self

# --- Constants (int) ---
ALIGN_LEFT: int
ALIGN_CENTER: int
ALIGN_RIGHT: int
ALIGN_JUSTIFIED: int
ALIGN_NATURAL: int

LB_WORD_WRAP: int
LB_CHAR_WRAP: int
LB_CLIP: int
LB_TRUNCATE_HEAD: int
LB_TRUNCATE_TAIL: int
LB_TRUNCATE_MIDDLE: int

KEYBOARD_DEFAULT: int
KEYBOARD_ASCII: int
KEYBOARD_NUMBERS: int
KEYBOARD_URL: int
KEYBOARD_NUMBER_PAD: int
KEYBOARD_PHONE_PAD: int
KEYBOARD_NAME_PHONE_PAD: int
KEYBOARD_EMAIL: int
KEYBOARD_DECIMAL_PAD: int
KEYBOARD_TWITTER: int
KEYBOARD_WEB_SEARCH: int

BLEND_NORMAL: int
BLEND_MULTIPLY: int
BLEND_SCREEN: int
BLEND_OVERLAY: int
BLEND_DARKEN: int
BLEND_LIGHTEN: int
BLEND_COLOR_DODGE: int
BLEND_COLOR_BURN: int
BLEND_SOFT_LIGHT: int
BLEND_HARD_LIGHT: int
BLEND_DIFFERENCE: int
BLEND_EXCLUSION: int
BLEND_HUE: int
BLEND_SATURATION: int
BLEND_COLOR: int
BLEND_LUMINOSITY: int
BLEND_CLEAR: int
BLEND_COPY: int
BLEND_SOURCE_IN: int
BLEND_SOURCE_OUT: int
BLEND_SOURCE_ATOP: int
BLEND_DESTINATION_OVER: int
BLEND_DESTINATION_IN: int
BLEND_DESTINATION_OUT: int
BLEND_DESTINATION_ATOP: int
BLEND_XOR: int
BLEND_PLUS_DARKER: int
BLEND_PLUS_LIGHTER: int

LINE_CAP_BUTT: int
LINE_CAP_ROUND: int
LINE_CAP_SQUARE: int
LINE_JOIN_MITER: int
LINE_JOIN_ROUND: int
LINE_JOIN_BEVEL: int

RENDERING_MODE_AUTOMATIC: int
RENDERING_MODE_ORIGINAL: int
RENDERING_MODE_TEMPLATE: int

CONTENT_SCALE_TO_FILL: int
CONTENT_SCALE_ASPECT_FIT: int
CONTENT_SCALE_ASPECT_FILL: int
CONTENT_REDRAW: int
CONTENT_CENTER: int
CONTENT_TOP: int
CONTENT_BOTTOM: int
CONTENT_LEFT: int
CONTENT_RIGHT: int
CONTENT_TOP_LEFT: int
CONTENT_TOP_RIGHT: int
CONTENT_BOTTOM_LEFT: int
CONTENT_BOTTOM_RIGHT: int

DATE_PICKER_MODE_TIME: int
DATE_PICKER_MODE_DATE: int
DATE_PICKER_MODE_DATE_AND_TIME: int
DATE_PICKER_MODE_COUNTDOWN: int

ACTIVITY_INDICATOR_STYLE_GRAY: int
ACTIVITY_INDICATOR_STYLE_WHITE: int
ACTIVITY_INDICATOR_STYLE_WHITE_LARGE: int

class Color:
    COLORS: ClassVar[Dict[str, Tuple[float, float, float, float]]]
    r: float
    g: float
    b: float
    a: float
    def __init__(self, r: float, g: float, b: float, a: float = 1.0) -> None: ...
    @classmethod
    def rgb(cls, r: float, g: float, b: float, a: float = 1.0) -> Color: ...
    @classmethod
    def hex(cls, hex_string: str) -> Color: ...
    @classmethod
    def named(cls, name: str) -> Color: ...

class Point:
    x: float
    y: float
    def __init__(self, x: Union[float, Sequence[float]] = 0.0, y: float = 0.0) -> None: ...
    def __getitem__(self, i: int) -> float: ...
    def __len__(self) -> int: ...
    def as_tuple(self) -> Tuple[float, float]: ...

class Size:
    w: float
    h: float
    width: float
    height: float
    def __init__(self, w: Union[float, Sequence[float]] = 0.0, h: float = 0.0) -> None: ...
    def __getitem__(self, i: int) -> float: ...
    def __len__(self) -> int: ...

class Rect:
    x: float
    y: float
    w: float
    h: float
    width: float
    height: float
    @property
    def min_x(self) -> float: ...
    @property
    def min_y(self) -> float: ...
    @property
    def max_x(self) -> float: ...
    @property
    def max_y(self) -> float: ...
    @property
    def origin(self) -> Point: ...
    @property
    def size(self) -> Size: ...
    def __init__(
        self,
        x: Union[float, Sequence[float]] = 0.0,
        y: float = 0.0,
        w: float = 0.0,
        h: float = 0.0,
    ) -> None: ...
    def center(self) -> Point: ...
    def as_tuple(self) -> Tuple[float, float, float, float]: ...
    def contains_point(self, point: Any) -> bool: ...
    def contains_rect(self, rect: Any) -> bool: ...
    def inset(self, dx: float, dy: float) -> Rect: ...
    def intersection(self, rect: Any) -> Rect: ...
    def intersects(self, rect: Any) -> bool: ...
    def translate(self, dx: float, dy: float) -> Rect: ...
    def union(self, rect: Any) -> Rect: ...
    def __getitem__(self, i: int) -> float: ...
    def __len__(self) -> int: ...

class Transform:
    a: float
    b: float
    c: float
    d: float
    tx: float
    ty: float
    def __init__(
        self,
        a: float = 1.0,
        b: float = 0.0,
        c: float = 0.0,
        d: float = 1.0,
        tx: float = 0.0,
        ty: float = 0.0,
    ) -> None: ...
    @classmethod
    def rotation(cls, rad: float) -> Transform: ...
    @classmethod
    def scale(cls, sx: float, sy: float) -> Transform: ...
    @classmethod
    def translation(cls, tx: float, ty: float) -> Transform: ...
    def concat(self, other: Transform) -> Transform: ...
    def invert(self) -> Transform: ...

class Touch:
    location: Point
    prev_location: Point
    phase: str
    touch_id: int
    timestamp: float
    def __init__(
        self,
        location: Sequence[float] = ...,
        prev_location: Optional[Sequence[float]] = ...,
        phase: str = ...,
        touch_id: int = ...,
        timestamp: Union[int, float] = ...,
    ) -> None: ...

class GestureSender:
    STATE_POSSIBLE: ClassVar[int]
    STATE_BEGAN: ClassVar[int]
    STATE_CHANGED: ClassVar[int]
    STATE_ENDED: ClassVar[int]
    STATE_CANCELLED: ClassVar[int]
    DIRECTION_LEFT: ClassVar[int]
    DIRECTION_RIGHT: ClassVar[int]
    DIRECTION_UP: ClassVar[int]
    DIRECTION_DOWN: ClassVar[int]
    view: Optional[View]
    state: int
    location: Point
    translation: Tuple[float, float]
    scale: float
    direction: int
    def __init__(
        self,
        view: Optional[View] = ...,
        state: int = ...,
        location: Sequence[float] = ...,
        translation: Sequence[float] = ...,
        scale: float = ...,
        direction: int = ...,
    ) -> None: ...

_GestureAction = Optional[Callable[[GestureSender], Any]]

class GestureRecognizer:
    def __init__(self, gesture_id: str) -> None: ...
    @property
    def action(self) -> _GestureAction: ...
    @action.setter
    def action(self, value: _GestureAction) -> None: ...

class TapGestureRecognizer(GestureRecognizer):
    def __init__(self) -> None: ...
    @property
    def number_of_taps_required(self) -> int: ...
    @number_of_taps_required.setter
    def number_of_taps_required(self, value: int) -> None: ...
    @property
    def number_of_touches_required(self) -> int: ...
    @number_of_touches_required.setter
    def number_of_touches_required(self, value: int) -> None: ...

class PanGestureRecognizer(GestureRecognizer):
    def __init__(self) -> None: ...

class PinchGestureRecognizer(GestureRecognizer):
    def __init__(self) -> None: ...

class SwipeGestureRecognizer(GestureRecognizer):
    def __init__(self) -> None: ...
    @property
    def direction(self) -> int: ...
    @direction.setter
    def direction(self, value: int) -> None: ...

class LongPressGestureRecognizer(GestureRecognizer):
    def __init__(self) -> None: ...
    @property
    def minimum_press_duration(self) -> float: ...
    @minimum_press_duration.setter
    def minimum_press_duration(self, value: float) -> None: ...

def parse_color(color: Any) -> Tuple[float, float, float, float]: ...

class Font:
    name: str
    size: float
    def __init__(self, name: str = ..., size: float = ...) -> None: ...
    @classmethod
    def system_font_of_size(cls, size: float) -> Font: ...
    @classmethod
    def bold_system_font_of_size(cls, size: float) -> Font: ...
    @classmethod
    def italic_system_font_of_size(cls, size: float) -> Font: ...

def parse_font(font: Any) -> Tuple[str, float]: ...

_ColorLike = Union[str, Color, Tuple[float, ...], List[float], None]
_FontLike = Union[str, Font, Tuple[Any, ...], List[Any]]

_Frame = Union[Tuple[float, float, float, float], List[float], Rect]

class View:
    def __init__(self, frame: Optional[_Frame] = ..., **kwargs: Any) -> None: ...
    @property
    def frame(self) -> Tuple[float, float, float, float]: ...
    @frame.setter
    def frame(self, value: _Frame) -> None: ...
    @property
    def x(self) -> float: ...
    @x.setter
    def x(self, value: float) -> None: ...
    @property
    def y(self) -> float: ...
    @y.setter
    def y(self, value: float) -> None: ...
    @property
    def width(self) -> float: ...
    @width.setter
    def width(self, value: float) -> None: ...
    @property
    def height(self) -> float: ...
    @height.setter
    def height(self, value: float) -> None: ...
    @property
    def background_color(self) -> Optional[Tuple[float, float, float, float]]: ...
    @background_color.setter
    def background_color(self, value: _ColorLike) -> None: ...
    @property
    def alpha(self) -> float: ...
    @alpha.setter
    def alpha(self, value: float) -> None: ...
    @property
    def hidden(self) -> bool: ...
    @hidden.setter
    def hidden(self, value: bool) -> None: ...
    @property
    def corner_radius(self) -> float: ...
    @corner_radius.setter
    def corner_radius(self, value: float) -> None: ...
    @property
    def border_width(self) -> float: ...
    @border_width.setter
    def border_width(self, value: float) -> None: ...
    @property
    def title(self) -> str: ...
    @title.setter
    def title(self, value: str) -> None: ...
    @property
    def content_mode(self) -> int: ...
    @content_mode.setter
    def content_mode(self, value: int) -> None: ...
    @property
    def touch_enabled(self) -> bool: ...
    @touch_enabled.setter
    def touch_enabled(self, value: bool) -> None: ...
    @property
    def multitouch_enabled(self) -> bool: ...
    @multitouch_enabled.setter
    def multitouch_enabled(self, value: bool) -> None: ...
    @property
    def transform(self) -> Optional[Transform]: ...
    @transform.setter
    def transform(self, value: Optional[Transform]) -> None: ...
    @property
    def bg_color(self) -> Any: ...
    @bg_color.setter
    def bg_color(self, value: _ColorLike) -> None: ...
    @property
    def tint_color(self) -> Any: ...
    @tint_color.setter
    def tint_color(self, value: _ColorLike) -> None: ...
    @property
    def left_button_items(self) -> Tuple[ButtonItem, ...]: ...
    @left_button_items.setter
    def left_button_items(self, value: Any) -> None: ...
    @property
    def right_button_items(self) -> Tuple[ButtonItem, ...]: ...
    @right_button_items.setter
    def right_button_items(self, value: Any) -> None: ...
    def __getitem__(self, name: str) -> View: ...
    @property
    def border_color(self) -> Optional[Tuple[float, float, float, float]]: ...
    @border_color.setter
    def border_color(self, value: _ColorLike) -> None: ...
    @property
    def flex(self) -> str: ...
    @flex.setter
    def flex(self, value: str) -> None: ...
    @property
    def name(self) -> str: ...
    @name.setter
    def name(self, value: str) -> None: ...
    @property
    def subviews(self) -> Tuple[View, ...]: ...
    @property
    def superview(self) -> Optional[View]: ...
    @property
    def bounds(self) -> Tuple[float, float, float, float]: ...
    @bounds.setter
    def bounds(self, value: Any) -> None: ...
    @property
    def center(self) -> Tuple[float, float]: ...
    @center.setter
    def center(self, value: Sequence[float]) -> None: ...
    def add_subview(self, subview: View) -> None: ...
    def remove_subview(self, subview: View) -> None: ...
    def remove_from_superview(self) -> None: ...
    def set_needs_display(self) -> None: ...
    def bring_to_front(self) -> None: ...
    def send_to_back(self) -> None: ...
    def bring_subview_to_front(self, subview: View) -> None: ...
    def send_subview_to_back(self, subview: View) -> None: ...
    def size_to_fit(self) -> None: ...
    def layout(self) -> None: ...
    def draw(self) -> None: ...
    def keyboard_frame_did_change(self, frame: Any) -> None: ...
    def set_needs_layout(self) -> None: ...
    def update_layout(self) -> None: ...
    @property
    def clips_to_bounds(self) -> bool: ...
    @clips_to_bounds.setter
    def clips_to_bounds(self, value: bool) -> None: ...
    @property
    def accessibility_label(self) -> Any: ...
    @accessibility_label.setter
    def accessibility_label(self, value: Any) -> None: ...
    @property
    def accessibility_value(self) -> Any: ...
    @accessibility_value.setter
    def accessibility_value(self, value: Any) -> None: ...
    @property
    def accessibility_hint(self) -> Any: ...
    @accessibility_hint.setter
    def accessibility_hint(self, value: Any) -> None: ...
    def point_from_window(self, point: Any) -> Point: ...
    def point_to_window(self, point: Any) -> Point: ...
    def add_gesture_recognizer(self, gesture_recognizer: GestureRecognizer) -> None: ...
    def present(
        self,
        style: str = ...,
        animated: bool = ...,
        hide_title_bar: bool = ...,
        **kwargs: Any,
    ) -> None: ...
    def close(self) -> None: ...
    def wait_modal(self) -> None: ...

class ButtonItem:
    title: str
    image: Any
    action: Optional[Callable[..., Any]]
    enabled: bool
    tint_color: Any
    def __init__(
        self,
        title: str = ...,
        image: Any = ...,
        action: Optional[Callable[..., Any]] = ...,
        **kwargs: Any,
    ) -> None: ...

class Button(View):
    def __init__(self, frame: Optional[_Frame] = ..., title: str = ..., **kwargs: Any) -> None: ...
    @property
    def title(self) -> str: ...
    @title.setter
    def title(self, value: str) -> None: ...
    @property
    def title_color(self) -> Any: ...
    @title_color.setter
    def title_color(self, value: _ColorLike) -> None: ...
    @property
    def tint_color(self) -> Any: ...
    @tint_color.setter
    def tint_color(self, value: _ColorLike) -> None: ...
    @property
    def enabled(self) -> bool: ...
    @enabled.setter
    def enabled(self, value: bool) -> None: ...
    @property
    def image(self) -> Any: ...
    @image.setter
    def image(self, value: Any) -> None: ...
    @property
    def background_image(self) -> Any: ...
    @background_image.setter
    def background_image(self, value: Any) -> None: ...
    @property
    def action(self) -> Optional[Callable[[Button], Any]]: ...
    @action.setter
    def action(self, func: Callable[[Button], Any]) -> None: ...
    @property
    def font(self) -> Any: ...
    @font.setter
    def font(self, value: _FontLike) -> None: ...

class Label(View):
    def __init__(self, frame: Optional[_Frame] = ..., text: str = ..., **kwargs: Any) -> None: ...
    @property
    def text(self) -> str: ...
    @text.setter
    def text(self, value: str) -> None: ...
    @property
    def font(self) -> Any: ...
    @font.setter
    def font(self, value: _FontLike) -> None: ...
    @property
    def text_color(self) -> Any: ...
    @text_color.setter
    def text_color(self, value: _ColorLike) -> None: ...
    @property
    def alignment(self) -> int: ...
    @alignment.setter
    def alignment(self, value: int) -> None: ...
    @property
    def number_of_lines(self) -> int: ...
    @number_of_lines.setter
    def number_of_lines(self, value: int) -> None: ...
    @property
    def line_break_mode(self) -> int: ...
    @line_break_mode.setter
    def line_break_mode(self, value: int) -> None: ...
    @property
    def scales_font(self) -> bool: ...
    @scales_font.setter
    def scales_font(self, value: bool) -> None: ...
    @property
    def min_font_scale(self) -> float: ...
    @min_font_scale.setter
    def min_font_scale(self, value: float) -> None: ...

class TextField(View):
    def __init__(
        self,
        frame: Optional[_Frame] = ...,
        text: str = ...,
        placeholder: str = ...,
        **kwargs: Any,
    ) -> None: ...
    @property
    def text(self) -> str: ...
    @text.setter
    def text(self, value: str) -> None: ...
    @property
    def placeholder(self) -> str: ...
    @placeholder.setter
    def placeholder(self, value: str) -> None: ...
    @property
    def text_color(self) -> Any: ...
    @text_color.setter
    def text_color(self, value: _ColorLike) -> None: ...
    @property
    def alignment(self) -> int: ...
    @alignment.setter
    def alignment(self, value: int) -> None: ...
    @property
    def secure(self) -> bool: ...
    @secure.setter
    def secure(self, value: bool) -> None: ...
    @property
    def keyboard_type(self) -> int: ...
    @keyboard_type.setter
    def keyboard_type(self, value: int) -> None: ...
    @property
    def action(self) -> Optional[Callable[[TextField], Any]]: ...
    @action.setter
    def action(self, func: Callable[[TextField], Any]) -> None: ...
    @property
    def began_editing(self) -> Optional[Callable[[TextField], Any]]: ...
    @began_editing.setter
    def began_editing(self, func: Callable[[TextField], Any]) -> None: ...
    @property
    def ended_editing(self) -> Optional[Callable[[TextField], Any]]: ...
    @ended_editing.setter
    def ended_editing(self, func: Callable[[TextField], Any]) -> None: ...
    @property
    def autocapitalization_type(self) -> int: ...
    @autocapitalization_type.setter
    def autocapitalization_type(self, value: int) -> None: ...
    @property
    def autocorrection_type(self) -> int: ...
    @autocorrection_type.setter
    def autocorrection_type(self, value: int) -> None: ...
    @property
    def spellchecking_type(self) -> int: ...
    @spellchecking_type.setter
    def spellchecking_type(self, value: int) -> None: ...
    @property
    def clear_button_mode(self) -> int: ...
    @clear_button_mode.setter
    def clear_button_mode(self, value: int) -> None: ...
    @property
    def return_key_type(self) -> int: ...
    @return_key_type.setter
    def return_key_type(self, value: int) -> None: ...

class TextView(View):
    def __init__(self, frame: Optional[_Frame] = ..., text: str = ..., **kwargs: Any) -> None: ...
    @property
    def text(self) -> str: ...
    @text.setter
    def text(self, value: str) -> None: ...
    @property
    def editable(self) -> bool: ...
    @editable.setter
    def editable(self, value: bool) -> None: ...
    @property
    def selectable(self) -> bool: ...
    @selectable.setter
    def selectable(self, value: bool) -> None: ...
    @property
    def text_color(self) -> Any: ...
    @text_color.setter
    def text_color(self, value: _ColorLike) -> None: ...
    @property
    def font(self) -> Any: ...
    @font.setter
    def font(self, value: _FontLike) -> None: ...
    @property
    def delegate(self) -> Any: ...
    @delegate.setter
    def delegate(self, value: Any) -> None: ...
    @property
    def began_editing(self) -> Optional[Callable[[TextView], Any]]: ...
    @began_editing.setter
    def began_editing(self, func: Callable[[TextView], Any]) -> None: ...
    @property
    def ended_editing(self) -> Optional[Callable[[TextView], Any]]: ...
    @ended_editing.setter
    def ended_editing(self, func: Callable[[TextView], Any]) -> None: ...
    @property
    def selected_range(self) -> Tuple[int, int]: ...
    @selected_range.setter
    def selected_range(self, value: Sequence[int]) -> None: ...
    @property
    def content_size(self) -> Size: ...
    @property
    def content_offset(self) -> Point: ...
    @content_offset.setter
    def content_offset(self, value: Sequence[float]) -> None: ...
    @property
    def alignment(self) -> int: ...
    @alignment.setter
    def alignment(self, value: int) -> None: ...
    @property
    def auto_content_inset(self) -> bool: ...
    @auto_content_inset.setter
    def auto_content_inset(self, value: bool) -> None: ...

class ImageView(View):
    def __init__(self, frame: Optional[_Frame] = ..., **kwargs: Any) -> None: ...
    @property
    def image(self) -> Any: ...
    @image.setter
    def image(self, value: Any) -> None: ...

class WebView(View):
    def __init__(self, frame: Optional[_Frame] = ..., **kwargs: Any) -> None: ...
    def load_url(self, url: str) -> None: ...
    def load_from_url(self, url: str) -> None: ...
    def load_html(self, html: str, base_url: Optional[str] = ...) -> None: ...
    def go_back(self) -> None: ...
    def go_forward(self) -> None: ...
    def reload(self) -> None: ...
    def stop(self) -> None: ...
    def eval_js(self, script: str, callback: Optional[Callable[[Optional[str]], None]] = ...) -> None: ...

class ActivityIndicator(View):
    def __init__(self, frame: Optional[_Frame] = ..., **kwargs: Any) -> None: ...
    @property
    def animating(self) -> bool: ...
    @animating.setter
    def animating(self, value: bool) -> None: ...
    @property
    def style(self) -> int: ...
    @style.setter
    def style(self, value: int) -> None: ...
    @property
    def hides_when_stopped(self) -> bool: ...
    @hides_when_stopped.setter
    def hides_when_stopped(self, value: bool) -> None: ...
    def start(self) -> None: ...
    def stop(self) -> None: ...
    def start_animating(self) -> None: ...
    def stop_animating(self) -> None: ...

class TableView(View):
    def __init__(self, frame: Optional[_Frame] = ..., **kwargs: Any) -> None: ...
    @property
    def data_source(self) -> List[Any]: ...
    @data_source.setter
    def data_source(self, value: Any) -> None: ...
    def reload_data(self) -> None: ...
    @property
    def action(self) -> Optional[Callable[[TableView, int, int], Any]]: ...
    @action.setter
    def action(self, func: Callable[[TableView, int, int], Any]) -> None: ...
    @property
    def delegate(self) -> Any: ...
    @delegate.setter
    def delegate(self, value: Any) -> None: ...
    @property
    def editing(self) -> bool: ...
    @editing.setter
    def editing(self, value: bool) -> None: ...
    @property
    def row_height(self) -> float: ...
    @row_height.setter
    def row_height(self, value: float) -> None: ...
    @property
    def separator_color(self) -> Any: ...
    @separator_color.setter
    def separator_color(self, value: _ColorLike) -> None: ...
    @property
    def allows_selection(self) -> bool: ...
    @allows_selection.setter
    def allows_selection(self, value: bool) -> None: ...
    @property
    def allows_multiple_selection(self) -> bool: ...
    @allows_multiple_selection.setter
    def allows_multiple_selection(self, value: bool) -> None: ...
    @property
    def selected_row(self) -> Optional[Tuple[int, int]]: ...
    @property
    def delete_enabled(self) -> bool: ...
    @delete_enabled.setter
    def delete_enabled(self, value: bool) -> None: ...
    @property
    def move_enabled(self) -> bool: ...
    @move_enabled.setter
    def move_enabled(self, value: bool) -> None: ...

class ListDataSource:
    items: List[Any]
    def __init__(self) -> None: ...
    def tableview_number_of_sections(self, tableview: TableView) -> int: ...
    def tableview_number_of_rows(self, tableview: TableView, section: int) -> int: ...
    def tableview_cell_for_row(self, tableview: TableView, section: int, row: int) -> Any: ...
    def tableview_did_select(self, tableview: TableView, section: int, row: int) -> None: ...
    def reload(self) -> None: ...

class TableViewCell(View):
    text_label: Label
    detail_text_label: Label
    accessory_type: int
    def __init__(self, style: str = ..., **kwargs: Any) -> None: ...

class Switch(View):
    def __init__(self, frame: Optional[_Frame] = ..., value: bool = ..., **kwargs: Any) -> None: ...
    @property
    def value(self) -> bool: ...
    @value.setter
    def value(self, val: bool) -> None: ...
    @property
    def action(self) -> Optional[Callable[[Switch], Any]]: ...
    @action.setter
    def action(self, func: Callable[[Switch], Any]) -> None: ...
    @property
    def enabled(self) -> bool: ...
    @enabled.setter
    def enabled(self, value: bool) -> None: ...

class Slider(View):
    def __init__(self, frame: Optional[_Frame] = ..., **kwargs: Any) -> None: ...
    @property
    def value(self) -> float: ...
    @value.setter
    def value(self, val: float) -> None: ...
    @property
    def continuous(self) -> bool: ...
    @continuous.setter
    def continuous(self, value: bool) -> None: ...
    @property
    def action(self) -> Optional[Callable[[Slider], Any]]: ...
    @action.setter
    def action(self, func: Callable[[Slider], Any]) -> None: ...

class SegmentedControl(View):
    def __init__(self, frame: Optional[_Frame] = ..., **kwargs: Any) -> None: ...
    @property
    def segments(self) -> List[str]: ...
    @segments.setter
    def segments(self, value: Any) -> None: ...
    @property
    def selected_index(self) -> int: ...
    @selected_index.setter
    def selected_index(self, value: int) -> None: ...
    @property
    def action(self) -> Optional[Callable[[SegmentedControl], Any]]: ...
    @action.setter
    def action(self, func: Callable[[SegmentedControl], Any]) -> None: ...

class DatePicker(View):
    def __init__(self, frame: Optional[_Frame] = ..., **kwargs: Any) -> None: ...
    @property
    def date(self) -> datetime.datetime: ...
    @date.setter
    def date(self, value: Any) -> None: ...
    @property
    def mode(self) -> int: ...
    @mode.setter
    def mode(self, value: int) -> None: ...
    @property
    def enabled(self) -> bool: ...
    @enabled.setter
    def enabled(self, value: bool) -> None: ...
    @property
    def action(self) -> Optional[Callable[[DatePicker], Any]]: ...
    @action.setter
    def action(self, func: Callable[[DatePicker], Any]) -> None: ...

class ProgressView(View):
    def __init__(self, frame: Optional[_Frame] = ..., **kwargs: Any) -> None: ...
    @property
    def progress(self) -> float: ...
    @progress.setter
    def progress(self, value: float) -> None: ...
    @property
    def progress_tint_color(self) -> Any: ...
    @progress_tint_color.setter
    def progress_tint_color(self, value: _ColorLike) -> None: ...
    @property
    def track_tint_color(self) -> Any: ...
    @track_tint_color.setter
    def track_tint_color(self, value: _ColorLike) -> None: ...

class Stepper(View):
    def __init__(self, frame: Optional[_Frame] = ..., **kwargs: Any) -> None: ...
    @property
    def value(self) -> float: ...
    @value.setter
    def value(self, val: float) -> None: ...
    @property
    def min_value(self) -> float: ...
    @min_value.setter
    def min_value(self, val: float) -> None: ...
    @property
    def max_value(self) -> float: ...
    @max_value.setter
    def max_value(self, val: float) -> None: ...
    @property
    def step_value(self) -> float: ...
    @step_value.setter
    def step_value(self, val: float) -> None: ...
    @property
    def wraps(self) -> bool: ...
    @wraps.setter
    def wraps(self, val: bool) -> None: ...
    @property
    def continuous(self) -> bool: ...
    @continuous.setter
    def continuous(self, val: bool) -> None: ...
    @property
    def action(self) -> Optional[Callable[[Stepper], Any]]: ...
    @action.setter
    def action(self, func: Callable[[Stepper], Any]) -> None: ...

class NavigationView(View):
    def __init__(self, view: Optional[View] = ..., **kwargs: Any) -> None: ...
    @property
    def navigation_bar_hidden(self) -> bool: ...
    @navigation_bar_hidden.setter
    def navigation_bar_hidden(self, value: bool) -> None: ...
    @property
    def bar_tint_color(self) -> Any: ...
    @bar_tint_color.setter
    def bar_tint_color(self, value: _ColorLike) -> None: ...
    @property
    def title_color(self) -> Any: ...
    @title_color.setter
    def title_color(self, value: _ColorLike) -> None: ...
    def push_view(self, view: View, animated: bool = ...) -> None: ...
    def pop_view(self, animated: bool = ...) -> None: ...

class ScrollView(View):
    def __init__(self, frame: Optional[_Frame] = ..., **kwargs: Any) -> None: ...
    @property
    def content_size(self) -> Tuple[float, float]: ...
    @content_size.setter
    def content_size(self, value: Sequence[float]) -> None: ...
    @property
    def content_offset(self) -> Tuple[float, float]: ...
    @content_offset.setter
    def content_offset(self, value: Sequence[float]) -> None: ...
    @property
    def bounces(self) -> bool: ...
    @bounces.setter
    def bounces(self, value: bool) -> None: ...
    @property
    def always_bounce_horizontal(self) -> bool: ...
    @always_bounce_horizontal.setter
    def always_bounce_horizontal(self, value: bool) -> None: ...
    @property
    def always_bounce_vertical(self) -> bool: ...
    @always_bounce_vertical.setter
    def always_bounce_vertical(self, value: bool) -> None: ...
    @property
    def delegate(self) -> Any: ...
    @delegate.setter
    def delegate(self, value: Any) -> None: ...
    @property
    def scroll_enabled(self) -> bool: ...
    @scroll_enabled.setter
    def scroll_enabled(self, value: bool) -> None: ...
    def scroll_to(self, x: float, y: float, animated: bool = ...) -> None: ...
    @property
    def content_inset(self) -> Tuple[float, float, float, float]: ...
    @content_inset.setter
    def content_inset(self, value: Any) -> None: ...
    @property
    def paging_enabled(self) -> bool: ...
    @paging_enabled.setter
    def paging_enabled(self, value: bool) -> None: ...
    @property
    def zoom_scale(self) -> float: ...
    @zoom_scale.setter
    def zoom_scale(self, value: float) -> None: ...
    @property
    def min_zoom_scale(self) -> float: ...
    @min_zoom_scale.setter
    def min_zoom_scale(self, value: float) -> None: ...
    @property
    def max_zoom_scale(self) -> float: ...
    @max_zoom_scale.setter
    def max_zoom_scale(self, value: float) -> None: ...
    @property
    def shows_vertical_scroll_indicator(self) -> bool: ...
    @shows_vertical_scroll_indicator.setter
    def shows_vertical_scroll_indicator(self, value: bool) -> None: ...
    @property
    def shows_horizontal_scroll_indicator(self) -> bool: ...
    @shows_horizontal_scroll_indicator.setter
    def shows_horizontal_scroll_indicator(self, value: bool) -> None: ...

class Path:
    line_width: float
    line_cap_style: int
    line_join_style: int
    def __init__(self) -> None: ...
    def add_arc(
        self,
        cx: float,
        cy: float,
        r: float,
        start: float,
        end: float,
        clockwise: bool = ...,
    ) -> None: ...
    def add_curve(
        self,
        end_x: float,
        end_y: float,
        cp1_x: float,
        cp1_y: float,
        cp2_x: float,
        cp2_y: float,
    ) -> None: ...
    def add_quad_curve(self, end_x: float, end_y: float, cp_x: float, cp_y: float) -> None: ...
    def add_clip(self) -> None: ...
    def set_line_dash(self, sequence: Sequence[float], phase: float = ...) -> None: ...
    @staticmethod
    def rect(x: float, y: float, w: float, h: float) -> Path: ...
    @staticmethod
    def oval(x: float, y: float, w: float, h: float) -> Path: ...
    @staticmethod
    def rounded_rect(x: float, y: float, w: float, h: float, corner_radius: float) -> Path: ...
    def move_to(self, x: float, y: float) -> None: ...
    def line_to(self, x: float, y: float) -> None: ...
    def close(self) -> None: ...
    def fill(self) -> None: ...
    def stroke(self) -> None: ...
    def add_rect(self, x: float, y: float, w: float, h: float) -> None: ...
    def add_oval(self, x: float, y: float, w: float, h: float) -> None: ...
    def copy(self) -> Self: ...
    def hit_test(self, x: float, y: float) -> bool: ...
    def get_bounding_box(self) -> Rect: ...

class GState:
    def __enter__(self) -> GState: ...
    def __exit__(
        self,
        exc_type: Optional[type[BaseException]],
        exc: Optional[BaseException],
        tb: Optional[TracebackType],
    ) -> bool: ...

class ImageContext:
    width: float
    height: float
    def __init__(self, width: float, height: float) -> None: ...
    def __enter__(self) -> Optional[ImageContext]: ...
    def __exit__(
        self,
        exc_type: Optional[type[BaseException]],
        exc: Optional[BaseException],
        tb: Optional[TracebackType],
    ) -> bool: ...
    def get_image(self) -> Optional[Image]: ...

class Image:
    def __init__(self, data: bytes = ...) -> None: ...
    @classmethod
    def from_data(cls, data: bytes) -> Image: ...
    @classmethod
    def from_image_context(cls) -> Image: ...
    @classmethod
    def named(cls, name: str) -> Image: ...
    @property
    def size(self) -> Size: ...
    def draw(
        self,
        x: float = ...,
        y: float = ...,
        width: Optional[float] = ...,
        height: Optional[float] = ...,
    ) -> None: ...
    def resizable_image(self, top: float, left: float, bottom: float, right: float) -> Image: ...
    def with_rendering_mode(self, mode: int) -> Image: ...
    @property
    def rendering_mode(self) -> int: ...
    @rendering_mode.setter
    def rendering_mode(self, value: int) -> None: ...
    @property
    def scale(self) -> float: ...
    def crop(self, rect: Any) -> Image: ...
    def clip_to_mask(self, mask: Image) -> Image: ...
    def to_png(self) -> bytes: ...
    def to_jpeg(self, compression_quality: float = ...) -> bytes: ...
    def show(self) -> None: ...

def begin_image_context(width: float, height: float) -> None: ...
def end_image_context() -> None: ...
def get_image_from_current_context() -> Image: ...
def set_color(color: _ColorLike) -> None: ...
def fill_rect(x: float, y: float, w: float, h: float) -> None: ...
def stroke_rect(x: float, y: float, w: float, h: float) -> None: ...
def draw_string(
    text: str,
    rect: Any = ...,
    font: _FontLike = ...,
    color: _ColorLike = ...,
    alignment: int = ...,
    line_break_mode: int = ...,
) -> None: ...

class CanvasView(View):
    def __init__(self, frame: Optional[_Frame] = ..., **kwargs: Any) -> None: ...
    def render(self, draw_func: Callable[[], None]) -> None: ...

def get_screen_size() -> Tuple[float, float]: ...
def get_window_size() -> Size: ...
def get_keyboard_frame() -> Tuple[float, float, float, float]: ...
def get_ui_style() -> str: ...
def measure_string(
    text: str,
    max_width: float = ...,
    font: _FontLike = ...,
    alignment: int = ...,
    line_break_mode: int = ...,
) -> Tuple[float, float]: ...
def delay(seconds: float, func: Callable[..., Any]) -> None: ...
def cancel_delays() -> None: ...
def in_background(fn: Callable[..., Any]) -> Callable[..., None]: ...
def animate(
    animation: Callable[[], Any],
    duration: float = ...,
    delay_sec: float = ...,
    completion: Optional[Callable[[], Any]] = ...,
) -> None: ...
def convert_point(
    point: Any = ...,
    from_view: Optional[View] = ...,
    to_view: Optional[View] = ...,
) -> Point: ...
def convert_rect(
    rect: Any = ...,
    from_view: Optional[View] = ...,
    to_view: Optional[View] = ...,
) -> Rect: ...
def set_blend_mode(mode: int) -> None: ...
def set_shadow(
    color: Optional[_ColorLike],
    offset_x: float,
    offset_y: float,
    blur_radius: float,
) -> None: ...

class autoreleasepool:
    def __enter__(self) -> autoreleasepool: ...
    def __exit__(
        self,
        exc_type: Optional[type[BaseException]],
        exc: Optional[BaseException],
        tb: Optional[TracebackType],
    ) -> bool: ...

def load_view(
    name: Optional[str] = ...,
    bindings: Optional[Dict[str, Any]] = ...,
    stackframe: Any = ...,
    verbose: bool = ...,
) -> View: ...
def load_view_str(
    json_str: str,
    bindings: Optional[Dict[str, Any]] = ...,
    stackframe: Any = ...,
    verbose: bool = ...,
) -> View: ...
def close_all(animated: bool = ...) -> None: ...
def dump_view(view: View, indent: int = ...) -> None: ...

__all__ = [
    "View",
    "Button",
    "Label",
    "TextField",
    "TextView",
    "ImageView",
    "Switch",
    "Slider",
    "SegmentedControl",
    "DatePicker",
    "ScrollView",
    "CanvasView",
    "ActivityIndicator",
    "TableView",
    "WebView",
    "NavigationView",
    "ButtonItem",
    "ProgressView",
    "Stepper",
    "ListDataSource",
    "TableViewCell",
    "GestureRecognizer",
    "TapGestureRecognizer",
    "PanGestureRecognizer",
    "PinchGestureRecognizer",
    "SwipeGestureRecognizer",
    "LongPressGestureRecognizer",
    "GestureSender",
    "Color",
    "Font",
    "Path",
    "GState",
    "ImageContext",
    "Image",
    "Point",
    "Size",
    "Rect",
    "Transform",
    "Touch",
    "parse_color",
    "parse_font",
    "set_color",
    "fill_rect",
    "stroke_rect",
    "draw_string",
    "begin_image_context",
    "end_image_context",
    "get_image_from_current_context",
    "ALIGN_LEFT",
    "ALIGN_CENTER",
    "ALIGN_RIGHT",
    "ALIGN_JUSTIFIED",
    "ALIGN_NATURAL",
    "LB_WORD_WRAP",
    "LB_CHAR_WRAP",
    "LB_CLIP",
    "LB_TRUNCATE_HEAD",
    "LB_TRUNCATE_TAIL",
    "LB_TRUNCATE_MIDDLE",
    "KEYBOARD_DEFAULT",
    "KEYBOARD_ASCII",
    "KEYBOARD_NUMBERS",
    "KEYBOARD_URL",
    "KEYBOARD_NUMBER_PAD",
    "KEYBOARD_PHONE_PAD",
    "KEYBOARD_NAME_PHONE_PAD",
    "KEYBOARD_EMAIL",
    "KEYBOARD_DECIMAL_PAD",
    "KEYBOARD_TWITTER",
    "KEYBOARD_WEB_SEARCH",
    "BLEND_NORMAL",
    "BLEND_MULTIPLY",
    "BLEND_SCREEN",
    "BLEND_OVERLAY",
    "BLEND_DARKEN",
    "BLEND_LIGHTEN",
    "BLEND_COLOR_DODGE",
    "BLEND_COLOR_BURN",
    "BLEND_SOFT_LIGHT",
    "BLEND_HARD_LIGHT",
    "BLEND_DIFFERENCE",
    "BLEND_EXCLUSION",
    "BLEND_HUE",
    "BLEND_SATURATION",
    "BLEND_COLOR",
    "BLEND_LUMINOSITY",
    "BLEND_CLEAR",
    "BLEND_COPY",
    "BLEND_SOURCE_IN",
    "BLEND_SOURCE_OUT",
    "BLEND_SOURCE_ATOP",
    "BLEND_DESTINATION_OVER",
    "BLEND_DESTINATION_IN",
    "BLEND_DESTINATION_OUT",
    "BLEND_DESTINATION_ATOP",
    "BLEND_XOR",
    "BLEND_PLUS_DARKER",
    "BLEND_PLUS_LIGHTER",
    "RENDERING_MODE_AUTOMATIC",
    "RENDERING_MODE_ORIGINAL",
    "RENDERING_MODE_TEMPLATE",
    "LINE_CAP_BUTT",
    "LINE_CAP_ROUND",
    "LINE_CAP_SQUARE",
    "LINE_JOIN_MITER",
    "LINE_JOIN_ROUND",
    "LINE_JOIN_BEVEL",
    "CONTENT_SCALE_ASPECT_FIT",
    "CONTENT_SCALE_ASPECT_FILL",
    "CONTENT_SCALE_TO_FILL",
    "CONTENT_REDRAW",
    "CONTENT_CENTER",
    "CONTENT_TOP",
    "CONTENT_BOTTOM",
    "CONTENT_LEFT",
    "CONTENT_RIGHT",
    "CONTENT_TOP_LEFT",
    "CONTENT_TOP_RIGHT",
    "CONTENT_BOTTOM_LEFT",
    "CONTENT_BOTTOM_RIGHT",
    "DATE_PICKER_MODE_TIME",
    "DATE_PICKER_MODE_DATE",
    "DATE_PICKER_MODE_DATE_AND_TIME",
    "DATE_PICKER_MODE_COUNTDOWN",
    "ACTIVITY_INDICATOR_STYLE_GRAY",
    "ACTIVITY_INDICATOR_STYLE_WHITE",
    "ACTIVITY_INDICATOR_STYLE_WHITE_LARGE",
    "get_screen_size",
    "get_window_size",
    "get_keyboard_frame",
    "get_ui_style",
    "load_view",
    "load_view_str",
    "close_all",
    "dump_view",
    "animate",
    "delay",
    "cancel_delays",
    "in_background",
    "convert_point",
    "convert_rect",
    "measure_string",
    "set_blend_mode",
    "set_shadow",
    "autoreleasepool",
]
