From 7adf08cce102928c6dc515618bf955db042762c9 Mon Sep 17 00:00:00 2001 From: Masahiro Wada Date: Wed, 1 Jun 2022 01:24:01 +0000 Subject: [PATCH] chore: Remove brython's type hints --- stubs/browser/__init__.pyi | 107 ------------------------------------- stubs/browser/timer.pyi | 13 ----- 2 files changed, 120 deletions(-) delete mode 100755 stubs/browser/__init__.pyi delete mode 100755 stubs/browser/timer.pyi diff --git a/stubs/browser/__init__.pyi b/stubs/browser/__init__.pyi deleted file mode 100755 index 7660c68..0000000 --- a/stubs/browser/__init__.pyi +++ /dev/null @@ -1,107 +0,0 @@ -# derived from https://raw.githubusercontent.com/yaneurao/yanesdk-for-brython/main/yanesdk/browser.py - -from typing import Any, Callable, Mapping - -from . import timer - -class Touch: - @property - def clientX(self) -> int: ... - @property - def clientY(self) -> int: ... - @property - def identifier(self) -> int: ... - -class DOMEvent: - @property - def keyCode(self) -> int: ... - @property - def offsetX(self) -> int: ... - @property - def offsetY(self) -> int: ... - @property - def buttons(self) -> int: ... - @property - def touches(self) -> list[Touch]: ... - def preventDefault(self) -> None: ... - def stopPropagation(self) -> None: ... - -class TextMetrics: ... - -class HtmlImage: - def __setitem__(self, name: str, value: str) -> "DOMNode": ... - -class CanvasRenderingContext: - fillStyle: str - strokeStyle: str - font: str - textBaseline: str - def fillRect( - self, - x: int | float, - y: int | float, - w: int | float, - h: int | float, - ) -> None: ... - def fillText(self, text: str, x: int | float, y: int | float) -> None: ... - def strokeRect( - self, x: int | float, y: int | float, w: int | float, h: int | float - ) -> None: ... - def drawImage( - self, - image: HtmlImage, - sx: int | float, - sy: int | float, - sw: int | float, - sh: int | float, - px: int | float, - py: int | float, - dw: int | float, - dh: int | float, - ) -> None: ... - def measureText(self, text: str) -> TextMetrics: ... - -class ImageCreator: - def new(self) -> HtmlImage: ... - -class IntervalHandle: ... - -class window: - Image = ImageCreator() - - @staticmethod - def setInterval(callback: Callable[[], None], t: int | float) -> IntervalHandle: ... - @staticmethod - def clearInterval(handle: IntervalHandle) -> None: ... - -class DOMNode: - style: Any - @property - def nodeValue(self) -> str: ... - @nodeValue.setter - def nodeValue(self, value: str) -> None: ... - def insertBefore( - self, newDOMNode: "DOMNode", referenceDOMNode: "DOMNode" | None - ) -> None: ... - def removeChild(self, child: "DOMNode") -> None: ... - def createTextNode(self, text: str) -> "DOMNode": ... - def createElement(self, name: str, options: Mapping[str, Any]) -> "DOMNode": ... - def addEventListener( - self, eventName: str, callback: Callable[[DOMEvent], None] - ) -> None: ... - def removeEventListener( - self, eventName: str, callback: Callable[[DOMEvent], None] - ) -> None: ... - def __getitem__(self, name: str) -> "DOMNode": ... - def __setitem__(self, name: str, value: str) -> "DOMNode": ... - def getContext(self, name: str) -> CanvasRenderingContext: ... - def __le__(self, other: "DOMNode" | list["DOMNode"]) -> None: ... - def setAttribute(self, name: str, value: str) -> None: ... - def removeAttribute(self, name: str) -> None: ... - -document = DOMNode() - -class dialog: ... - -class widgets: - dialog: dialog diff --git a/stubs/browser/timer.pyi b/stubs/browser/timer.pyi deleted file mode 100755 index 1356f11..0000000 --- a/stubs/browser/timer.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Callable - -# def cancel_animation_frame(): ... -# def clear_interval(): ... -# def clear_timeout(): ... -# def console(): ... -# def request_animation_frame(): ... -def set_interval(f: Callable[[], None], s: int) -> None: ... - -# def set_loop_timeout(): ... -# def set_timeout(): ... -# def window(): ... -# def wrap(): ...