diff --git a/pgspecial/help/commands.pyi b/pgspecial/help/commands.pyi new file mode 100644 index 0000000..272144e --- /dev/null +++ b/pgspecial/help/commands.pyi @@ -0,0 +1 @@ +helpcommands: dict[str, dict[str, str]] diff --git a/pgspecial/namedqueries.pyi b/pgspecial/namedqueries.pyi new file mode 100644 index 0000000..291927f --- /dev/null +++ b/pgspecial/namedqueries.pyi @@ -0,0 +1,25 @@ +from collections.abc import MutableMapping +from typing import ClassVar, NoReturn, Protocol, TypeVar + +_DefaultT = TypeVar("_DefaultT") + +class _Config(Protocol): + def __contains__(self, key: object) -> bool: ... + def __getitem__(self, key: str) -> MutableMapping[str, str]: ... + def __setitem__(self, key: str, value: MutableMapping[str, str]) -> None: ... + def get(self, key: str, default: _DefaultT) -> MutableMapping[str, str] | _DefaultT: ... + def write(self) -> object: ... + +class NamedQueries: + section_name: ClassVar[str] + usage: ClassVar[str] + instance: ClassVar[NamedQueries | None] + config: _Config + + def __init__(self, config: _Config) -> None: ... + @classmethod + def from_config(cls, config: _Config) -> NamedQueries: ... + def list(self) -> MutableMapping[str, str] | list[NoReturn]: ... + def get(self, name: str) -> str | None: ... + def save(self, name: str, query: str) -> None: ... + def delete(self, name: str) -> str: ... diff --git a/pgspecial/py.typed b/pgspecial/py.typed new file mode 100644 index 0000000..e69de29