From e888344ba561bc6a52f96f7a7bc2ad24be287a82 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Tue, 12 Aug 2025 21:00:46 +0200 Subject: add type hints It seems like the "simple" way with just the pyi file doesn't work, so we need to add the py.typed manually. Also, enjoy this path: hittekaart/hittekaart-py/hittekaart_py/hittekaart_py.pyi --- hittekaart-py/hittekaart_py/__init__.py | 1 + hittekaart-py/hittekaart_py/hittekaart_py.pyi | 43 +++++++++++++++++++++++++++ hittekaart-py/hittekaart_py/py.typed | 0 3 files changed, 44 insertions(+) create mode 100644 hittekaart-py/hittekaart_py/__init__.py create mode 100644 hittekaart-py/hittekaart_py/hittekaart_py.pyi create mode 100644 hittekaart-py/hittekaart_py/py.typed diff --git a/hittekaart-py/hittekaart_py/__init__.py b/hittekaart-py/hittekaart_py/__init__.py new file mode 100644 index 0000000..039ffd1 --- /dev/null +++ b/hittekaart-py/hittekaart_py/__init__.py @@ -0,0 +1 @@ +from .hittekaart_py import * diff --git a/hittekaart-py/hittekaart_py/hittekaart_py.pyi b/hittekaart-py/hittekaart_py/hittekaart_py.pyi new file mode 100644 index 0000000..0efe011 --- /dev/null +++ b/hittekaart-py/hittekaart_py/hittekaart_py.pyi @@ -0,0 +1,43 @@ +from typing import Iterable + + +class Track: + @staticmethod + def from_file(path: bytes, compression: str | None) -> "Track": ... + + @staticmethod + def from_coordinates(coordinates: list[tuple[float, float]]) -> "Track": ... + + +class Storage: + @staticmethod + def Folder(path: bytes) -> "Storage": ... + + @staticmethod + def Sqlite(path: bytes) -> "Storage": ... + + +class HeatmapRenderer: + def __new__(cls) -> "HeatmapRenderer": ... + + +class MarktileRenderer: + def __new__(cls) -> "MarktileRenderer": ... + + +class TilehuntRenderer: + def __new__(cls, zoom: int) -> "TilehuntRenderer": ... + + +class Settings: + min_zoom: int + max_zoom: int + threads: int + def __new__(cls, min_zoom: int=0, max_zoom: int=19, threads: int=0) -> "Settings": ... + + +def generate(settings: Settings, items: Iterable[Track], renderer: HeatmapRenderer | MarktileRenderer | TilehuntRenderer, storage: Storage): ... + + +class HitteError(Exception): + ... diff --git a/hittekaart-py/hittekaart_py/py.typed b/hittekaart-py/hittekaart_py/py.typed new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3