mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-24 17:28:40 +08:00
add stubs for py-nanoid (#12074)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
from nanoid.generate import generate
|
||||
from nanoid.non_secure_generate import non_secure_generate
|
||||
|
||||
__all__ = ["generate", "non_secure_generate"]
|
||||
@@ -0,0 +1 @@
|
||||
def algorithm_generate(random_bytes: int) -> bytearray: ...
|
||||
@@ -0,0 +1,3 @@
|
||||
def generate(
|
||||
alphabet: str = "_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", size: int = 21 # noqa: Y053
|
||||
) -> str: ...
|
||||
@@ -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: ...
|
||||
@@ -0,0 +1,3 @@
|
||||
def non_secure_generate(
|
||||
alphabet: str = "_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", size: int = 21 # noqa: Y053
|
||||
) -> str: ...
|
||||
@@ -0,0 +1,2 @@
|
||||
alphabet: str
|
||||
size: int
|
||||
Reference in New Issue
Block a user