diff --git a/stubs/nanoid/METADATA.toml b/stubs/nanoid/METADATA.toml new file mode 100644 index 000000000..c0eb7f7b4 --- /dev/null +++ b/stubs/nanoid/METADATA.toml @@ -0,0 +1,2 @@ +version = "2.0.0" +upstream_repository = "https://github.com/puyuan/py-nanoid" diff --git a/stubs/nanoid/nanoid/__init__.pyi b/stubs/nanoid/nanoid/__init__.pyi new file mode 100644 index 000000000..37e83e31a --- /dev/null +++ b/stubs/nanoid/nanoid/__init__.pyi @@ -0,0 +1,4 @@ +from nanoid.generate import generate +from nanoid.non_secure_generate import non_secure_generate + +__all__ = ["generate", "non_secure_generate"] diff --git a/stubs/nanoid/nanoid/algorithm.pyi b/stubs/nanoid/nanoid/algorithm.pyi new file mode 100644 index 000000000..e5d49982f --- /dev/null +++ b/stubs/nanoid/nanoid/algorithm.pyi @@ -0,0 +1 @@ +def algorithm_generate(random_bytes: int) -> bytearray: ... diff --git a/stubs/nanoid/nanoid/generate.pyi b/stubs/nanoid/nanoid/generate.pyi new file mode 100644 index 000000000..8c3e6771b --- /dev/null +++ b/stubs/nanoid/nanoid/generate.pyi @@ -0,0 +1,3 @@ +def generate( + alphabet: str = "_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", size: int = 21 # noqa: Y053 +) -> str: ... diff --git a/stubs/nanoid/nanoid/method.pyi b/stubs/nanoid/nanoid/method.pyi new file mode 100644 index 000000000..1a8b33fa9 --- /dev/null +++ b/stubs/nanoid/nanoid/method.pyi @@ -0,0 +1,6 @@ +from collections.abc import Callable, Sequence +from typing_extensions import TypeAlias + +_Algorithm: TypeAlias = Callable[[int], Sequence[int]] + +def method(algorithm: _Algorithm, alphabet: str, size: int) -> str: ... diff --git a/stubs/nanoid/nanoid/non_secure_generate.pyi b/stubs/nanoid/nanoid/non_secure_generate.pyi new file mode 100644 index 000000000..d37459182 --- /dev/null +++ b/stubs/nanoid/nanoid/non_secure_generate.pyi @@ -0,0 +1,3 @@ +def non_secure_generate( + alphabet: str = "_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", size: int = 21 # noqa: Y053 +) -> str: ... diff --git a/stubs/nanoid/nanoid/resources.pyi b/stubs/nanoid/nanoid/resources.pyi new file mode 100644 index 000000000..a0bd3b8f7 --- /dev/null +++ b/stubs/nanoid/nanoid/resources.pyi @@ -0,0 +1,2 @@ +alphabet: str +size: int