typing.pyi 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import array
  2. import mmap
  3. from asyncio import AbstractEventLoop as AbstractEventLoop
  4. from socket import AddressFamily as AddressFamily
  5. from socket import socket as Socket
  6. from subprocess import CompletedProcess as CompletedProcess
  7. from subprocess import Popen as PopenType
  8. from typing import Literal
  9. from typing import NotRequired as NotRequired
  10. from typing import Protocol as Protocol
  11. from typing import TypedDict as TypedDict
  12. from kittens.hints.main import Mark as MarkType
  13. from kittens.tui.handler import Handler as HandlerType
  14. from kittens.tui.images import GraphicsCommand as GraphicsCommandType
  15. from kittens.tui.images import ImageManager as ImageManagerType
  16. from kittens.tui.loop import Debug as Debug
  17. from kittens.tui.loop import Loop as LoopType
  18. from kittens.tui.loop import MouseButton as MouseButton
  19. from kittens.tui.loop import MouseEvent as MouseEvent
  20. from kittens.tui.loop import TermManager as TermManagerType
  21. from .boss import Boss as BossType
  22. from .child import Child as ChildType
  23. from .conf.utils import BadLine as BadLineType
  24. from .conf.utils import KeyAction as KeyActionType
  25. from .config import KittyCommonOpts
  26. from .fast_data_types import CoreTextFont as CoreTextFont
  27. from .fast_data_types import FontConfigPattern as FontConfigPattern
  28. from .fast_data_types import Screen as ScreenType
  29. from .fast_data_types import StartupCtx as StartupCtx
  30. from .key_encoding import KeyEvent as KeyEventType
  31. from .layout.base import Layout as LayoutType
  32. from .options.utils import AliasMap as AliasMap
  33. from .options.utils import KeyMap as KeyMap
  34. from .rc.base import RemoteCommand as RemoteCommandType
  35. from .session import Session as SessionType
  36. from .session import Tab as SessionTab
  37. from .tabs import SpecialWindowInstance as SpecialWindowInstance
  38. from .tabs import Tab as TabType
  39. from .utils import ScreenSize as ScreenSize
  40. from .window import Window as WindowType
  41. EdgeLiteral = Literal['left', 'top', 'right', 'bottom']
  42. UnderlineLiteral = Literal['straight', 'double', 'curly', 'dotted', 'dashed']
  43. MatchType = Literal['mime', 'ext', 'protocol', 'file', 'path', 'url', 'fragment_matches']
  44. PowerlineStyle = Literal['angled', 'slanted', 'round']
  45. GRT_a = Literal['t', 'T', 'q', 'p', 'd', 'f', 'a', 'c']
  46. GRT_f = Literal[24, 32, 100]
  47. GRT_t = Literal['d', 'f', 't', 's']
  48. GRT_o = Literal['z', 'z'] # two z's to workaround a bug in ruff
  49. GRT_m = Literal[0, 1]
  50. GRT_C = Literal[0, 1]
  51. GRT_d = Literal['a', 'A', 'c', 'C', 'i', 'I', 'p', 'P', 'q', 'Q', 'x', 'X', 'y', 'Y', 'z', 'Z', 'f', 'F']
  52. ReadableBuffer = bytes | bytearray | memoryview | array.array[int] | mmap.mmap
  53. WriteableBuffer = bytearray | memoryview | array.array[int] | mmap.mmap
  54. class WindowSystemMouseEvent(TypedDict):
  55. button: int
  56. count: int
  57. mods: int
  58. __all__ = (
  59. 'EdgeLiteral', 'MatchType', 'GRT_a', 'GRT_f', 'GRT_t', 'GRT_o', 'GRT_m', 'GRT_d',
  60. 'GraphicsCommandType', 'HandlerType', 'AbstractEventLoop', 'AddressFamily', 'Socket', 'CompletedProcess',
  61. 'PopenType', 'Protocol', 'TypedDict', 'MarkType', 'ImageManagerType', 'Debug', 'LoopType', 'MouseEvent',
  62. 'TermManagerType', 'BossType', 'ChildType', 'BadLineType', 'MouseButton', 'NotRequired',
  63. 'KeyActionType', 'KeyMap', 'KittyCommonOpts', 'AliasMap', 'CoreTextFont', 'WindowSystemMouseEvent',
  64. 'FontConfigPattern', 'ScreenType', 'StartupCtx', 'KeyEventType', 'LayoutType', 'PowerlineStyle',
  65. 'RemoteCommandType', 'SessionType', 'SessionTab', 'SpecialWindowInstance', 'TabType', 'ScreenSize', 'WindowType',
  66. 'ReadableBuffer', 'WriteableBuffer',
  67. )