@pulsar-edit/types 1.128.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/.github/workflows/publish.yml +33 -0
  2. package/LICENSE.md +8 -0
  3. package/README.md +187 -0
  4. package/atom-i18n/config.d.ts +9 -0
  5. package/atom-i18n/index.d.ts +4 -0
  6. package/autocomplete-plus/config.d.ts +140 -0
  7. package/autocomplete-plus/index.d.ts +200 -0
  8. package/dependencies/event-kit/index.d.ts +143 -0
  9. package/dependencies/first-mate/index.d.ts +1 -0
  10. package/dependencies/first-mate/src/first-mate.d.ts +1 -0
  11. package/dependencies/first-mate/src/grammar.d.ts +119 -0
  12. package/dependencies/pathwatcher/index.d.ts +1 -0
  13. package/dependencies/pathwatcher/src/directory.d.ts +98 -0
  14. package/dependencies/pathwatcher/src/file.d.ts +115 -0
  15. package/dependencies/pathwatcher/src/main.d.ts +2 -0
  16. package/dependencies/service-hub/index.d.ts +3 -0
  17. package/dependencies/service-hub/src/consumer.d.ts +8 -0
  18. package/dependencies/service-hub/src/provider.d.ts +14 -0
  19. package/dependencies/service-hub/src/service-hub.d.ts +46 -0
  20. package/dependencies/service-hub/src/util.d.ts +1 -0
  21. package/dependencies/text-buffer/index.d.ts +1 -0
  22. package/dependencies/text-buffer/src/display-marker-layer.d.ts +182 -0
  23. package/dependencies/text-buffer/src/display-marker.d.ts +232 -0
  24. package/dependencies/text-buffer/src/helpers.d.ts +11 -0
  25. package/dependencies/text-buffer/src/marker-layer.d.ts +117 -0
  26. package/dependencies/text-buffer/src/marker.d.ts +207 -0
  27. package/dependencies/text-buffer/src/point.d.ts +102 -0
  28. package/dependencies/text-buffer/src/range.d.ts +141 -0
  29. package/dependencies/text-buffer/src/text-buffer.d.ts +759 -0
  30. package/index.d.ts +72 -0
  31. package/linter/config.d.ts +26 -0
  32. package/linter/index.d.ts +108 -0
  33. package/package.json +61 -0
  34. package/src/atom-environment.d.ts +361 -0
  35. package/src/branding.d.ts +19 -0
  36. package/src/buffered-node-process.d.ts +10 -0
  37. package/src/buffered-process.d.ts +88 -0
  38. package/src/clipboard.d.ts +14 -0
  39. package/src/color.d.ts +11 -0
  40. package/src/command-registry.d.ts +118 -0
  41. package/src/config-schema.d.ts +271 -0
  42. package/src/config.d.ts +168 -0
  43. package/src/context-menu-manager.d.ts +65 -0
  44. package/src/cursor.d.ts +252 -0
  45. package/src/decoration.d.ts +156 -0
  46. package/src/deserializer-manager.d.ts +15 -0
  47. package/src/dock.d.ts +121 -0
  48. package/src/get-window-load-settings.d.ts +26 -0
  49. package/src/git-repository.d.ts +174 -0
  50. package/src/grammar-registry.d.ts +241 -0
  51. package/src/gutter.d.ts +118 -0
  52. package/src/history-manager.d.ts +28 -0
  53. package/src/keymap-extensions.d.ts +190 -0
  54. package/src/language-mode.d.ts +314 -0
  55. package/src/layer-decoration.d.ts +31 -0
  56. package/src/menu-manager.d.ts +24 -0
  57. package/src/notification-manager.d.ts +37 -0
  58. package/src/notification.d.ts +79 -0
  59. package/src/other-types.d.ts +283 -0
  60. package/src/package-manager.d.ts +103 -0
  61. package/src/package.d.ts +33 -0
  62. package/src/pane.d.ts +604 -0
  63. package/src/panel.d.ts +38 -0
  64. package/src/path-watcher.d.ts +35 -0
  65. package/src/project.d.ts +110 -0
  66. package/src/scope-descriptor.d.ts +8 -0
  67. package/src/selection.d.ts +341 -0
  68. package/src/style-manager.d.ts +68 -0
  69. package/src/task.d.ts +38 -0
  70. package/src/text-editor-component.d.ts +15 -0
  71. package/src/text-editor-element.d.ts +48 -0
  72. package/src/text-editor-registry.d.ts +48 -0
  73. package/src/text-editor.d.ts +1416 -0
  74. package/src/theme-manager.d.ts +29 -0
  75. package/src/tooltip-manager.d.ts +42 -0
  76. package/src/tooltip.d.ts +63 -0
  77. package/src/ui.d.ts +101 -0
  78. package/src/view-registry.d.ts +34 -0
  79. package/src/wasm-tree-sitter-grammar.d.ts +305 -0
  80. package/src/wasm-tree-sitter-language-mode.d.ts +294 -0
  81. package/src/workspace-center.d.ts +117 -0
  82. package/src/workspace.d.ts +485 -0
  83. package/status-bar/config.d.ts +23 -0
  84. package/status-bar/index.d.ts +51 -0
  85. package/tool-bar/config.d.ts +20 -0
  86. package/tool-bar/index.d.ts +235 -0
  87. package/tsconfig.json +8 -0
@@ -0,0 +1,110 @@
1
+ import {
2
+ ConfigValues,
3
+ Directory,
4
+ Disposable,
5
+ FilesystemChangeEvent,
6
+ GitRepository,
7
+ PathWatcher,
8
+ TextBuffer,
9
+ } from "../index";
10
+
11
+ /** Represents a project that's opened in Atom. */
12
+ export interface Project {
13
+ // Event Subscription
14
+ /** Invoke the given callback when the project paths change. */
15
+ onDidChangePaths(callback: (projectPaths: string[]) => void): Disposable;
16
+
17
+ /** Invoke the given callback when a text buffer is added to the project. */
18
+ onDidAddBuffer(callback: (buffer: TextBuffer) => void): Disposable;
19
+
20
+ /**
21
+ * Invoke the given callback with all current and future text buffers in
22
+ * the project.
23
+ */
24
+ observeBuffers(callback: (buffer: TextBuffer) => void): Disposable;
25
+
26
+ /**
27
+ * Invoke a callback when a filesystem change occurs within any open project
28
+ * path.
29
+ */
30
+ onDidChangeFiles(callback: (events: FilesystemChangeEvent) => void): Disposable;
31
+
32
+ /**
33
+ * Invoke a callback whenever the project's configuration has been replaced.
34
+ */
35
+ onDidReplace(
36
+ callback: (projectSpec: ProjectSpecification | null | undefined) => void
37
+ ): Disposable;
38
+
39
+ // Accessing the Git Repository
40
+ /**
41
+ * Get an Array of GitRepositorys associated with the project's directories.
42
+ *
43
+ * This method will be removed in 2.0 because it does synchronous I/O.
44
+ */
45
+ getRepositories(): GitRepository[];
46
+
47
+ /**
48
+ * Invoke the given callback with all current and future repositories in the
49
+ * project.
50
+ */
51
+ observeRepositories(callback: (repository: GitRepository) => void): Disposable;
52
+
53
+ /** Invoke the given callback when a repository is added to the project. */
54
+ onDidAddRepository(callback: (repository: GitRepository) => void): Disposable;
55
+
56
+ /** Get the repository for a given directory asynchronously. */
57
+ repositoryForDirectory(directory: Directory): Promise<GitRepository | null>;
58
+
59
+ // Managing Paths
60
+ /**
61
+ * Get an Array of strings containing the paths of the project's directories.
62
+ */
63
+ getPaths(): string[];
64
+
65
+ /** Set the paths of the project's directories. */
66
+ setPaths(projectPaths: string[]): void;
67
+
68
+ /** Add a path to the project's list of root paths. */
69
+ addPath(projectPath: string): void;
70
+
71
+ /**
72
+ * Access a promise that resolves when the filesystem watcher associated with
73
+ * a project root directory is ready to begin receiving events.
74
+ */
75
+ getWatcherPromise(projectPath: string): Promise<PathWatcher>;
76
+
77
+ /** Remove a path from the project's list of root paths. */
78
+ removePath(projectPath: string): void;
79
+
80
+ /** Get an Array of {@link Directory}s associated with this project. */
81
+ getDirectories(): Directory[];
82
+
83
+ /**
84
+ * Undocumented: Get the {@link Directory} associated with a path within this
85
+ * project.
86
+ */
87
+ getDirectoryForProjectPath(projectPath: string): Directory;
88
+
89
+ /** Get the relative path from the project directory to the given path. */
90
+ relativize(fullPath: string): string;
91
+
92
+ /**
93
+ * Get the path to the project directory that contains the given path, and
94
+ * the relative path from that project directory to the given path.
95
+ */
96
+ relativizePath(fullPath: string): [string | null, string];
97
+
98
+ /**
99
+ * Determines whether the given path (real or symbolic) is inside the
100
+ * project's directory.
101
+ */
102
+ contains(pathToCheck: string): boolean;
103
+
104
+ }
105
+
106
+ export interface ProjectSpecification {
107
+ paths: string[];
108
+ originPath: string;
109
+ config?: ConfigValues | undefined;
110
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Wraps an array of strings. The array describes a path from the root of the
3
+ * syntax tree to a token including all scope names for the entire path.
4
+ */
5
+ export interface ScopeDescriptor {
6
+ /** Returns all scopes for this descriptor. */
7
+ getScopesArray(): readonly string[];
8
+ }
@@ -0,0 +1,341 @@
1
+ import {
2
+ Disposable,
3
+ PointCompatible,
4
+ Range,
5
+ RangeCompatible,
6
+ RangeLike,
7
+ ReadonlyEditOptions,
8
+ TextInsertionOptions,
9
+ TextEditor
10
+ } from "../index";
11
+
12
+ /** Represents a selection in the {@link TextEditor}. */
13
+ export interface Selection {
14
+ // Event Subscription
15
+ /** Calls your callback when the selection was moved. */
16
+ onDidChangeRange(callback: (event: SelectionChangedEvent) => void): Disposable;
17
+
18
+ /** Calls your callback when the selection was destroyed. */
19
+ onDidDestroy(callback: () => void): Disposable;
20
+
21
+ // Managing the selection range
22
+ /** Returns the screen Range for the selection. */
23
+ getScreenRange(): Range;
24
+
25
+ /** Modifies the screen range for the selection. */
26
+ setScreenRange(
27
+ screenRange: RangeCompatible,
28
+ options?: {
29
+ preserveFolds?: boolean | undefined;
30
+ autoscroll?: boolean | undefined;
31
+ },
32
+ ): void;
33
+
34
+ /** Returns the buffer Range for the selection. */
35
+ getBufferRange(): Range;
36
+
37
+ /** Modifies the buffer Range for the selection. */
38
+ setBufferRange(
39
+ bufferRange: RangeCompatible,
40
+ options?: {
41
+ reversed?: boolean | undefined;
42
+ preserveFolds?: boolean | undefined;
43
+ autoscroll?: boolean | undefined;
44
+ },
45
+ ): void;
46
+
47
+ /** Returns the starting and ending buffer rows the selection is highlighting. */
48
+ getBufferRowRange(): [number, number];
49
+
50
+ // Info about the selection
51
+ /** Determines if the selection contains anything. */
52
+ isEmpty(): boolean;
53
+
54
+ /**
55
+ * Determines if the ending position of a marker is greater than the starting
56
+ * position. This can happen when, for example, you highlight text "up" in a
57
+ * {@link TextBuffer}.
58
+ */
59
+ isReversed(): boolean;
60
+
61
+ /** Returns whether the selection is a single line or not. */
62
+ isSingleScreenLine(): boolean;
63
+
64
+ /** Returns the text in the selection. */
65
+ getText(): string;
66
+
67
+ // NOTE: this calls into Range.intersectsWith(), which is one of the few
68
+ // functions that doesn't take a range-compatible range, despite what the API
69
+ // says.
70
+ /** Identifies if a selection intersects with a given buffer range. */
71
+ intersectsBufferRange(bufferRange: RangeLike): boolean;
72
+
73
+ /** Identifies if a selection intersects with another selection. */
74
+ intersectsWith(otherSelection: Selection): boolean;
75
+
76
+ // Modifying the selected range
77
+ /** Clears the selection, moving the marker to the head. */
78
+ clear(options?: { autoscroll?: boolean | undefined }): void;
79
+
80
+ /** Selects the text from the current cursor position to a given screen position. */
81
+ selectToScreenPosition(position: PointCompatible): void;
82
+
83
+ /** Selects the text from the current cursor position to a given buffer position. */
84
+ selectToBufferPosition(position: PointCompatible): void;
85
+
86
+ /** Selects the text one position right of the cursor. */
87
+ selectRight(columnCount?: number): void;
88
+
89
+ /** Selects the text one position left of the cursor. */
90
+ selectLeft(columnCount?: number): void;
91
+
92
+ /** Selects all the text one position above the cursor. */
93
+ selectUp(rowCount?: number): void;
94
+
95
+ /** Selects all the text one position below the cursor. */
96
+ selectDown(rowCount?: number): void;
97
+
98
+ /**
99
+ * Selects all the text from the current cursor position to the top of the
100
+ * buffer.
101
+ */
102
+ selectToTop(): void;
103
+
104
+ /**
105
+ * Selects all the text from the current cursor position to the bottom of
106
+ * the buffer.
107
+ */
108
+ selectToBottom(): void;
109
+
110
+ /** Selects all the text in the buffer. */
111
+ selectAll(): void;
112
+
113
+ /**
114
+ * Selects all the text from the current cursor position to the beginning of
115
+ * the line.
116
+ */
117
+ selectToBeginningOfLine(): void;
118
+
119
+ /**
120
+ * Selects all the text from the current cursor position to the first character
121
+ * of the line.
122
+ */
123
+ selectToFirstCharacterOfLine(): void;
124
+
125
+ /**
126
+ * Selects all the text from the current cursor position to the end of the
127
+ * screen line.
128
+ */
129
+ selectToEndOfLine(): void;
130
+
131
+ /**
132
+ * Selects all the text from the current cursor position to the end of the
133
+ * buffer line.
134
+ */
135
+ selectToEndOfBufferLine(): void;
136
+
137
+ /**
138
+ * Selects all the text from the current cursor position to the beginning
139
+ * of the word.
140
+ */
141
+ selectToBeginningOfWord(): void;
142
+
143
+ /** Selects all the text from the current cursor position to the end of the word. */
144
+ selectToEndOfWord(): void;
145
+
146
+ /**
147
+ * Selects all the text from the current cursor position to the beginning of
148
+ * the next word.
149
+ */
150
+ selectToBeginningOfNextWord(): void;
151
+
152
+ /** Selects text to the previous word boundary. */
153
+ selectToPreviousWordBoundary(): void;
154
+
155
+ /** Selects text to the next word boundary. */
156
+ selectToNextWordBoundary(): void;
157
+
158
+ /** Selects text to the previous subword boundary. */
159
+ selectToPreviousSubwordBoundary(): void;
160
+
161
+ /** Selects text to the next subword boundary. */
162
+ selectToNextSubwordBoundary(): void;
163
+
164
+ /**
165
+ * Selects all the text from the current cursor position to the beginning of
166
+ * the next paragraph.
167
+ */
168
+ selectToBeginningOfNextParagraph(): void;
169
+
170
+ /**
171
+ * Selects all the text from the current cursor position to the beginning of
172
+ * the previous paragraph.
173
+ */
174
+ selectToBeginningOfPreviousParagraph(): void;
175
+
176
+ /** Modifies the selection to encompass the current word. */
177
+ selectWord(): void;
178
+
179
+ /**
180
+ * Expands the newest selection to include the entire word on which the
181
+ * cursors rests.
182
+ */
183
+ expandOverWord(): void;
184
+
185
+ /** Selects an entire line in the buffer. */
186
+ selectLine(row: number): void;
187
+
188
+ /**
189
+ * Expands the newest selection to include the entire line on which the cursor
190
+ * currently rests.
191
+ * It also includes the newline character.
192
+ */
193
+ expandOverLine(): void;
194
+
195
+ // Modifying the selected text
196
+ /** Replaces text at the current selection. */
197
+ insertText(text: string, options?: TextInsertionOptions & ReadonlyEditOptions): void;
198
+
199
+ /**
200
+ * Removes the first character before the selection if the selection is empty
201
+ * otherwise it deletes the selection.
202
+ */
203
+ backspace(options?: ReadonlyEditOptions): void;
204
+
205
+ /**
206
+ * Removes the selection or, if nothing is selected, then all characters from
207
+ * the start of the selection back to the previous word boundary.
208
+ */
209
+ deleteToPreviousWordBoundary(options?: ReadonlyEditOptions): void;
210
+
211
+ /**
212
+ * Removes the selection or, if nothing is selected, then all characters from
213
+ * the start of the selection up to the next word boundary.
214
+ */
215
+ deleteToNextWordBoundary(options?: ReadonlyEditOptions): void;
216
+
217
+ /**
218
+ * Removes from the start of the selection to the beginning of the current
219
+ * word if the selection is empty otherwise it deletes the selection.
220
+ */
221
+ deleteToBeginningOfWord(options?: ReadonlyEditOptions): void;
222
+
223
+ /**
224
+ * Removes from the beginning of the line which the selection begins on all
225
+ * the way through to the end of the selection.
226
+ */
227
+ deleteToBeginningOfLine(options?: ReadonlyEditOptions): void;
228
+
229
+ /**
230
+ * Removes the selection or the next character after the start of the selection
231
+ * if the selection is empty.
232
+ */
233
+ delete(options?: ReadonlyEditOptions): void;
234
+
235
+ /**
236
+ * If the selection is empty, removes all text from the cursor to the end of
237
+ * the line. If the cursor is already at the end of the line, it removes the
238
+ * following newline. If the selection isn't empty, only deletes the contents
239
+ * of the selection.
240
+ */
241
+ deleteToEndOfLine(options?: ReadonlyEditOptions): void;
242
+
243
+ /**
244
+ * Removes the selection or all characters from the start of the selection to
245
+ * the end of the current word if nothing is selected.
246
+ */
247
+ deleteToEndOfWord(options?: ReadonlyEditOptions): void;
248
+
249
+ /**
250
+ * Removes the selection or all characters from the start of the selection to
251
+ * the end of the current word if nothing is selected.
252
+ */
253
+ deleteToBeginningOfSubword(options?: ReadonlyEditOptions): void;
254
+
255
+ /**
256
+ * Removes the selection or all characters from the start of the selection to
257
+ * the end of the current word if nothing is selected.
258
+ */
259
+ deleteToEndOfSubword(options?: ReadonlyEditOptions): void;
260
+
261
+ /** Removes only the selected text. */
262
+ deleteSelectedText(options?: ReadonlyEditOptions): void;
263
+
264
+ /**
265
+ * Removes the line at the beginning of the selection if the selection is
266
+ * empty unless the selection spans multiple lines in which case all lines
267
+ * are removed.
268
+ */
269
+ deleteLine(options?: ReadonlyEditOptions): void;
270
+
271
+ /**
272
+ * Joins the current line with the one below it. Lines will be separated by a
273
+ * single space. If there selection spans more than one line, all the lines
274
+ * are joined together.
275
+ */
276
+ joinLines(options?: ReadonlyEditOptions): void;
277
+
278
+ /** Removes one level of indent from the currently selected rows. */
279
+ outdentSelectedRows(options?: ReadonlyEditOptions): void;
280
+
281
+ /**
282
+ * Sets the indentation level of all selected rows to values suggested by the
283
+ * relevant grammars.
284
+ */
285
+ autoIndentSelectedRows(options?: ReadonlyEditOptions): void;
286
+
287
+ /**
288
+ * Wraps the selected lines in comments if they aren't currently part of a
289
+ * comment. Removes the comment if they are currently wrapped in a comment.
290
+ */
291
+ toggleLineComments(options?: ReadonlyEditOptions): void;
292
+
293
+ /** Cuts the selection until the end of the screen line. */
294
+ cutToEndOfLine(maintainClipboard?: boolean, options?: ReadonlyEditOptions): void;
295
+
296
+ /** Cuts the selection until the end of the buffer line. */
297
+ cutToEndOfBufferLine(maintainClipboard?: boolean, options?: ReadonlyEditOptions): void;
298
+
299
+ /** Copies the selection to the clipboard and then deletes it. */
300
+ cut(maintainClipboard?: boolean, fullLine?: boolean, options?: ReadonlyEditOptions): void;
301
+
302
+ /** Copies the current selection to the clipboard. */
303
+ copy(maintainClipboard?: boolean, fullLine?: boolean): void;
304
+
305
+ /** Creates a fold containing the current selection. */
306
+ fold(): void;
307
+
308
+ /** If the selection spans multiple rows, indent all of them. */
309
+ indentSelectedRows(options?: ReadonlyEditOptions): void;
310
+
311
+ // Managing multiple selections
312
+ /** Moves the selection down one row. */
313
+ addSelectionBelow(): void;
314
+
315
+ /** Moves the selection up one row. */
316
+ addSelectionAbove(): void;
317
+
318
+ /**
319
+ * Combines the given selection into this selection and then destroys the
320
+ * given selection.
321
+ */
322
+ merge(
323
+ otherSelection: Selection,
324
+ options?: { preserveFolds?: boolean | undefined; autoscroll?: boolean | undefined },
325
+ ): void;
326
+
327
+ // Comparing to other selections
328
+ /**
329
+ * Compare this selection's buffer range to another selection's buffer range.
330
+ * See {@link Range#compare} for more details.
331
+ */
332
+ compare(otherSelection: Selection): number;
333
+ }
334
+
335
+ export interface SelectionChangedEvent {
336
+ oldBufferRange: Range;
337
+ oldScreenRange: Range;
338
+ newBufferRange: Range;
339
+ newScreenRange: Range;
340
+ selection: Selection;
341
+ }
@@ -0,0 +1,68 @@
1
+ import { Disposable } from "../index";
2
+
3
+ /**
4
+ * A singleton instance of this class available via atom.styles, which you can
5
+ * use to globally query and observe the set of active style sheets.
6
+ */
7
+ export interface StyleManager {
8
+ // Event Subscription
9
+ /** Invoke callback for all current and future style elements. */
10
+ observeStyleElements(callback: (styleElement: StyleElementObservedEvent) => void): Disposable;
11
+
12
+ /** Invoke callback when a style element is added. */
13
+ onDidAddStyleElement(callback: (styleElement: StyleElementObservedEvent) => void): Disposable;
14
+
15
+ /** Invoke callback when a style element is removed. */
16
+ onDidRemoveStyleElement(callback: (styleElement: HTMLStyleElement) => void): Disposable;
17
+
18
+ /** Invoke callback when an existing style element is updated. */
19
+ onDidUpdateStyleElement(callback: (styleElement: StyleElementObservedEvent) => void): Disposable;
20
+
21
+ // Reading Style Elements
22
+ /** Get all loaded style elements. */
23
+ getStyleElements(): HTMLStyleElement[];
24
+
25
+ // Paths
26
+ /** Get the path of the user style sheet in ~/.atom. */
27
+ getUserStyleSheetPath(): string;
28
+
29
+ /**
30
+ * Add a stylesheet to the workspace.
31
+ *
32
+ * The vast majority of users won't have to do this directly.
33
+ */
34
+ addStyleSheet(
35
+ /** The raw CSS to add. */
36
+ source: string,
37
+ params: {
38
+ /**
39
+ * The path on disk of the original source file from which this CSS was
40
+ * generated. This acts as a unique identifier for the stylesheet; if an
41
+ * existing `style` tag exists with the same `sourcePath`, its contents
42
+ * are replaced instead of a new `style` element being created.
43
+ */
44
+ sourcePath?: string
45
+ context?: string
46
+ /**
47
+ * The sheet's priority. The higher the number, the later the placement
48
+ * in the list of `style` elements.
49
+ */
50
+ priority?: number
51
+ /**
52
+ * Whether to transform deprecated shadow DOM selectors for greater
53
+ * compatibility.
54
+ */
55
+ skipDeprecatedSelectorsTransformation?: boolean
56
+ /**
57
+ * Whether to transform deprecated math usages from Less.js for greater
58
+ * compatibility.
59
+ */
60
+ skipDeprecatedMathUsageTransformation?: boolean
61
+ }
62
+ ): Disposable;
63
+ }
64
+
65
+ export interface StyleElementObservedEvent extends HTMLStyleElement {
66
+ sourcePath: string;
67
+ context: string;
68
+ }
package/src/task.d.ts ADDED
@@ -0,0 +1,38 @@
1
+ import { Disposable } from "../index";
2
+
3
+ /** Run a node script in a separate process. */
4
+ export class Task {
5
+ /** A helper method to easily launch and run a task once. */
6
+ static once(taskPath: string, ...args: any[]): Task;
7
+
8
+ /** Creates a task. You should probably use .once */
9
+ constructor(taskPath: string);
10
+
11
+ /**
12
+ * Starts the task.
13
+ *
14
+ * Throws an error if this task has already been terminated or if sending a
15
+ * message to the child process fails.
16
+ */
17
+ start(...args: any[]): void;
18
+
19
+ /**
20
+ * Sends a message to the task.
21
+ *
22
+ * Throws an error if this task has already been terminated or if sending a
23
+ * message to the child process fails.
24
+ */
25
+ send(message: string | number | boolean | object | null | any[]): void;
26
+
27
+ /** Call a function when an event is emitted by the child process. */
28
+ on(eventName: string, callback: (param: any) => void): Disposable;
29
+
30
+ /**
31
+ * Forcefully stop the running task.
32
+ * No more events are emitted once this method is called.
33
+ */
34
+ terminate(): void;
35
+
36
+ /** Cancel the running task and emit an event if it was canceled. */
37
+ cancel(): boolean;
38
+ }
@@ -0,0 +1,15 @@
1
+ import { PixelPosition, Point, PointLike } from "../index";
2
+
3
+ /**
4
+ * Undocumented: Rendering component for TextEditor
5
+ */
6
+ export interface TextEditorComponent {
7
+ /**
8
+ * Does not clip screenPosition, unlike similar method on
9
+ * {@link TextEditorElement.}
10
+ */
11
+ pixelPositionForScreenPosition(screenPosition: PointLike): PixelPosition;
12
+ screenPositionForPixelPosition(pos: PixelPosition): Point;
13
+ pixelPositionForMouseEvent(event: { clientX: number; clientY: number }): PixelPosition;
14
+ screenPositionForMouseEvent(event: { clientX: number; clientY: number }): Point;
15
+ }
@@ -0,0 +1,48 @@
1
+ import { Disposable, PixelPosition, PointLike, TextEditor, TextEditorComponent } from "../index";
2
+
3
+ /**
4
+ * Undocumented: Custom HTML element for {@link TextEditor}
5
+ * (`atom-text-editor`).
6
+ */
7
+ export interface TextEditorElement extends HTMLElement {
8
+ getModel(): TextEditor;
9
+ getComponent(): TextEditorComponent;
10
+ /**
11
+ * Extended: Get a promise that resolves the next time the element's
12
+ * DOM is updated in any way.
13
+ */
14
+ getNextUpdatePromise(): Promise<void>;
15
+
16
+ /** Extended: get the width of an `x` character displayed in this element. */
17
+ getBaseCharacterWidth(): number;
18
+
19
+ /** Essential: Scrolls the editor to the top. */
20
+ scrollToTop(): void;
21
+
22
+ /** Essential: Scrolls the editor to the bottom. */
23
+ scrollToBottom(): void;
24
+
25
+ hasFocus(): boolean;
26
+
27
+ setScrollTop(scrollTop: number): void;
28
+ getScrollTop(): number;
29
+
30
+ setScrollLeft(scrollLeft: number): void;
31
+ getScrollLeft(): number;
32
+
33
+ getScrollHeight(): number;
34
+
35
+ /** Extended: Converts a buffer position to a pixel position. */
36
+ pixelPositionForBufferPosition(bufferPosition: PointLike): PixelPosition;
37
+
38
+ /** Extended: Converts a screen position to a pixel position. */
39
+ pixelPositionForScreenPosition(screenPosition: PointLike): PixelPosition;
40
+
41
+ // Event subscription
42
+ onDidChangeScrollTop(callback: (scrollTop: number) => void): Disposable;
43
+ onDidChangeScrollLeft(callback: (scrollLeft: number) => void): Disposable;
44
+ /** Called when the editor is attached to the DOM. */
45
+ onDidAttach(callback: () => void): Disposable;
46
+ /** Called when the editor is detached from the DOM. */
47
+ onDidDetach(callback: () => void): Disposable;
48
+ }
@@ -0,0 +1,48 @@
1
+ import { Disposable, TextEditor } from "../index";
2
+
3
+ /** Experimental: This global registry tracks registered TextEditors. */
4
+ export interface TextEditorRegistry {
5
+ // Managing Text Editors
6
+ /** Remove all editors from the registry. */
7
+ clear(): void;
8
+
9
+ /** Register a TextEditor. */
10
+ add(editor: TextEditor): Disposable;
11
+
12
+ /** Remove the given TextEditor from the registry. */
13
+ remove(editor: TextEditor): boolean;
14
+
15
+ /** Keep a TextEditor's configuration in sync with Atom's settings. */
16
+ maintainConfig(editor: TextEditor): Disposable;
17
+
18
+ /**
19
+ * Set a TextEditor's grammar based on its path and content, and continue
20
+ * to update its grammar as gramamrs are added or updated, or the editor's
21
+ * file path changes.
22
+ */
23
+ maintainGrammar(editor: TextEditor): Disposable;
24
+
25
+ /**
26
+ * Force a TextEditor to use a different grammar than the one that would
27
+ * otherwise be selected for it.
28
+ */
29
+ setGrammarOverride(editor: TextEditor, scopeName: string): void;
30
+
31
+ /**
32
+ * Retrieve the grammar scope name that has been set as a grammar override
33
+ * for the given TextEditor.
34
+ */
35
+ getGrammarOverride(editor: TextEditor): string | null;
36
+
37
+ /**
38
+ * Remove any grammar override that has been set for the given TextEditor.
39
+ */
40
+ clearGrammarOverride(editor: TextEditor): void;
41
+
42
+ // Event Subscription
43
+ /**
44
+ * Invoke the given callback with all the current and future registered
45
+ * TextEditors.
46
+ */
47
+ observe(callback: (editor: TextEditor) => void): Disposable;
48
+ }