diff --git a/src/pyperclip/__init__.pyi b/src/pyperclip/__init__.pyi new file mode 100644 index 0000000..64785b9 --- /dev/null +++ b/src/pyperclip/__init__.pyi @@ -0,0 +1,32 @@ +# Type signature stub file for pyperclip, +# +# Pyperclip is delibarately backwards compatable with +# python 2.6, and so type annotation within the source +# directly are not an option. + +from typing import Callable, Optional + +# All and only those functions listed in __all__ are given +# type annotated signatures here. + + +def copy(text: str) -> None: ... + + +def paste() -> str: ... + + +# timeout will typically be an int, but floats work. +def waitForPaste(timeout: Optional[float] = None) -> str: ... + + +def waitForNewPaste(timeout: Optional[float] = None) -> str: ... + + +def set_clipboard(clipboard: str) -> None: ... + + +def determine_clipboard() -> tuple[ + Callable[[str], None], + Callable[[], str] + ]: ... diff --git a/src/pyperclip/py.typed b/src/pyperclip/py.typed new file mode 100644 index 0000000..f68fa5e --- /dev/null +++ b/src/pyperclip/py.typed @@ -0,0 +1,5 @@ +""" +To maintain compatibility with Python versions that do +not support type hinting, the type hints are provided in the +PEPs 484 and 561 stub file src/__init__.pyi +""" \ No newline at end of file