mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-06-24 09:48:39 +08:00
Add pyperclip stubs (#13502)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pyperclip.__main__
|
||||
@@ -0,0 +1,6 @@
|
||||
version = "1.9.*"
|
||||
upstream_repository = "https://github.com/asweigart/pyperclip"
|
||||
|
||||
[tool.stubtest]
|
||||
platforms = ["win32", "linux", "darwin"]
|
||||
apt_dependencies = ["xclip"]
|
||||
@@ -0,0 +1,24 @@
|
||||
__all__ = ["copy", "paste", "set_clipboard", "determine_clipboard"]
|
||||
|
||||
from collections.abc import Callable
|
||||
from typing import Literal
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
class PyperclipException(RuntimeError): ...
|
||||
|
||||
class PyperclipWindowsException(PyperclipException):
|
||||
def __init__(self, message: str) -> None: ...
|
||||
|
||||
class PyperclipTimeoutException(PyperclipException): ...
|
||||
|
||||
_ClipboardMechanismName: TypeAlias = Literal[
|
||||
"pbcopy", "pyobjc", "qt", "xclip", "xsel", "wl-clipboard", "klipper", "windows", "no"
|
||||
]
|
||||
_ClipboardCopyMechanism: TypeAlias = Callable[[str], None]
|
||||
_ClipboardPasteMechanism: TypeAlias = Callable[[], str]
|
||||
|
||||
def copy(text: str) -> None: ...
|
||||
def paste() -> str: ...
|
||||
def set_clipboard(clipboard: _ClipboardMechanismName) -> None: ...
|
||||
def determine_clipboard() -> tuple[_ClipboardCopyMechanism, _ClipboardPasteMechanism]: ...
|
||||
def is_available() -> bool: ...
|
||||
Reference in New Issue
Block a user