-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsublime_plugin.pyi
More file actions
130 lines (96 loc) · 5.19 KB
/
sublime_plugin.pyi
File metadata and controls
130 lines (96 loc) · 5.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import sublime
from typing import Callable, Generic, TypeVar, Optional, Union, List, Tuple, Dict, overload
all_callbacks: Dict[str, List['EventListener']]
InputType = TypeVar('InputType', bound=Union[str, int, float, list, dict, tuple, None])
class CommandInputHandler(Generic[InputType]):
def name(self) -> str: ...
def next_input(self, args: dict) -> Optional[CommandInputHandler]: ...
def placeholder(self) -> str: ...
def initial_text(self) -> str: ...
def preview(self, arg: InputType) -> Union[str, sublime.Html]: ...
def validate(self, arg: InputType) -> bool: ...
def cancel(self) -> None: ...
@overload
def confirm(self, arg: InputType) -> None: ...
@overload
def confirm(self, arg: InputType, event: dict) -> None: ...
class BackInputHandler(CommandInputHandler[None]):
pass
class TextInputHandler(CommandInputHandler[str]):
def description(self, text: str) -> str: ...
ListItem = Union[str, Tuple[str, InputType]]
class ListInputHandler(CommandInputHandler[InputType], Generic[InputType]):
def list_items(self) -> Union[List[ListItem], Tuple[List[ListItem], int]]: ...
def description(self, v: object, text: str) -> str: ...
class Command:
def is_enabled(self) -> bool: ...
def is_visible(self) -> bool: ...
def is_checked(self) -> bool: ...
def description(self) -> str: ...
def input(self, args: dict) -> Optional[CommandInputHandler]: ...
def input_description(self) -> str: ...
class ApplicationCommand(Command):
run: Callable[..., None]
class WindowCommand(Command):
window: sublime.Window
run: Callable[..., None]
class TextCommand(Command):
view: sublime.View
run: Callable[..., None]
def want_event(self) -> bool: ...
Completion = Union[str, Tuple[str, str], List[str]]
class EventListener:
def on_new(self, view: sublime.View) -> None: ...
def on_new_async(self, view: sublime.View) -> None: ...
def on_clone(self, view: sublime.View) -> None: ...
def on_clone_async(self, view: sublime.View) -> None: ...
def on_load(self, view: sublime.View) -> None: ...
def on_load_async(self, view: sublime.View) -> None: ...
def on_pre_close(self, view: sublime.View) -> None: ...
def on_close(self, view: sublime.View) -> None: ...
def on_pre_save(self, view: sublime.View) -> None: ...
def on_pre_save_async(self, view: sublime.View) -> None: ...
def on_post_save(self, view: sublime.View) -> None: ...
def on_post_save_async(self, view: sublime.View) -> None: ...
def on_modified(self, view: sublime.View) -> None: ...
def on_modified_async(self, view: sublime.View) -> None: ...
def on_selection_modified(self, view: sublime.View) -> None: ...
def on_selection_modified_async(self, view: sublime.View) -> None: ...
def on_activated(self, view: sublime.View) -> None: ...
def on_activated_async(self, view: sublime.View) -> None: ...
def on_deactivated(self, view: sublime.View) -> None: ...
def on_deactivated_async(self, view: sublime.View) -> None: ...
def on_hover(self, view: sublime.View, point: int, hover_zone: int) -> None: ...
def on_query_context(self, view: sublime.View, key: str, operator: int, operand: str, match_all: bool) -> Optional[bool]: ...
def on_query_completions(self, view: sublime.View, prefix: str, locations: List[int]) -> Union[None, List[Completion], Tuple[List[Completion], int]]: ...
def on_text_command(self, view: sublime.View, command_name: str, args: dict) -> Optional[Tuple[str, dict]]: ...
def on_post_text_command(self, view: sublime.View, command_name: str, args: dict) -> None: ...
def on_window_command(self, view: sublime.Window, command_name: str, args: dict) -> Optional[Tuple[str, dict]]: ...
def on_post_window_command(self, view: sublime.Window, command_name: str, args: dict) -> None: ...
class ViewEventListener:
view: sublime.View
@classmethod
def is_applicable(cls, settings: sublime.Settings) -> bool: ...
@classmethod
def applies_to_primary_view_only(cls) -> bool: ...
def on_load(self) -> None: ...
def on_load_async(self) -> None: ...
def on_pre_close(self) -> None: ...
def on_close(self) -> None: ...
def on_pre_save(self) -> None: ...
def on_pre_save_async(self) -> None: ...
def on_post_save(self) -> None: ...
def on_post_save_async(self) -> None: ...
def on_modified(self) -> None: ...
def on_modified_async(self) -> None: ...
def on_selection_modified(self) -> None: ...
def on_selection_modified_async(self) -> None: ...
def on_activated_modified(self) -> None: ...
def on_activated_modified_async(self) -> None: ...
def on_deactivated_modified(self) -> None: ...
def on_deactivated_modified_async(self) -> None: ...
def on_hover(self, point: int, hover_zone: int) -> None: ...
def on_query_context(self, key: str, operator: int, operand: str, match_all: bool) -> Optional[bool]: ...
def on_query_completions(self, prefix: str, locations: List[int]) -> Union[None, List[Completion], Tuple[List[Completion], int]]: ...
def on_text_command(self, command_name: str, args: dict) -> Optional[Tuple[str, dict]]: ...
def on_post_text_command(self, command_name: str, args: dict) -> None: ...