@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,88 @@
1
+ import { ChildProcess } from "child_process";
2
+ import { Disposable, HandleableErrorEvent } from "../index";
3
+
4
+ /**
5
+ * A wrapper which provides standard error/output line buffering for
6
+ * Node's ChildProcess.
7
+ */
8
+ export class BufferedProcess {
9
+ readonly process?: ChildProcess | undefined;
10
+
11
+ constructor(options: ProcessOptions);
12
+
13
+ // Event Subscription
14
+ /**
15
+ * Will call your callback when an error will be raised by the process. Usually
16
+ * this is due to the command not being available or not on the PATH. You can
17
+ * call handle() on the object passed to your callback to indicate that you
18
+ * have handled this error.
19
+ */
20
+ onWillThrowError(callback: (errorObject: HandleableErrorEvent) => void): Disposable;
21
+
22
+ // Helper Methods
23
+ /** Terminate the process. */
24
+ kill(): void;
25
+
26
+ /** Runs the process. */
27
+ start(): void;
28
+ }
29
+
30
+ export interface NodeProcessOptions {
31
+ /** The command to execute. */
32
+ command: string;
33
+
34
+ /** The array of arguments to pass to the command. */
35
+ args?: readonly string[] | undefined;
36
+
37
+ /** The options object to pass to Node's ChildProcess.spawn method. */
38
+ options?: SpawnProcessOptions | undefined;
39
+
40
+ /**
41
+ * The callback that receives a single argument which contains the standard
42
+ * output from the command.
43
+ */
44
+ stdout?(data: string): void;
45
+
46
+ /**
47
+ * The callback that receives a single argument which contains the standard
48
+ * error output from the command.
49
+ */
50
+ stderr?(data: string): void;
51
+
52
+ /** The callback which receives a single argument containing the exit status. */
53
+ exit?(code: number): void;
54
+ }
55
+
56
+ export interface ProcessOptions extends NodeProcessOptions {
57
+ /**
58
+ * Whether the command will automatically start when this BufferedProcess is
59
+ * created.
60
+ */
61
+ autoStart?: boolean | undefined;
62
+ }
63
+
64
+ export interface SpawnProcessOptions {
65
+ /** Current working directory of the child process. */
66
+ cwd?: string | undefined;
67
+
68
+ /** Environment key-value pairs. */
69
+ env?: { [key: string]: string } | undefined;
70
+
71
+ /** The child's stdio configuration. */
72
+ stdio?: string | Array<string | number> | undefined;
73
+
74
+ /** Prepare child to run independently of its parent process. */
75
+ detached?: boolean | undefined;
76
+
77
+ /** Sets the user identity of the process. */
78
+ uid?: number | undefined;
79
+
80
+ /** Sets the group identity of the process. */
81
+ gid?: number | undefined;
82
+
83
+ /**
84
+ * If true, runs command inside of a shell. Uses "/bin/sh" on UNIX, and process.env.ComSpec
85
+ * on Windows. A different shell can be specified as a string.
86
+ */
87
+ shell?: boolean | string | undefined;
88
+ }
@@ -0,0 +1,14 @@
1
+ /** Represents the clipboard used for copying and pasting in Atom. */
2
+ export interface Clipboard {
3
+ /** Write the given text to the clipboard. */
4
+ write(text: string, metadata?: object): void;
5
+
6
+ /** Read the text from the clipboard. */
7
+ read(): string;
8
+
9
+ /**
10
+ * Read the text from the clipboard and return both the text and the associated
11
+ * metadata.
12
+ */
13
+ readWithMetadata(): { text: string; metadata: object };
14
+ }
package/src/color.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A simple color class returned from Config::get when the value at the key path is
3
+ * of type 'color'.
4
+ */
5
+ export interface Color {
6
+ /** Returns a string in the form '#abcdef'. */
7
+ toHexString(): string;
8
+
9
+ /** Returns a string in the form 'rgba(25, 50, 75, .9)'. */
10
+ toRGBAString(): string;
11
+ }
@@ -0,0 +1,118 @@
1
+ import { CommandEvent, CompositeDisposable, Disposable } from "../index";
2
+
3
+ export interface CommandRegistryTargetMap extends HTMLElementTagNameMap {
4
+ [key: string]: EventTarget;
5
+ }
6
+
7
+ /**
8
+ * Commands can be bound to specific targets (element nodes that already exist)
9
+ * or to abstract targets (CSS selectors that describe nodes that may exist now
10
+ * or may only exist in the future).
11
+ *
12
+ * If we have a specific node reference, we can be more explicit about the
13
+ * types on the `CommandEvent` that will eventually fire. If we have a string,
14
+ * we only know that the `CommandEvent` will refer to some sort of
15
+ * `EventTarget`, but cannot be more specific than that.
16
+ */
17
+ export type CommandRegistryListener<TargetType extends EventTarget = EventTarget> =
18
+ | {
19
+ didDispatch(event: CommandEvent<TargetType>): unknown | Promise<unknown>;
20
+ /**
21
+ * A custom "humanized" command name that will appear in the command
22
+ * palette for this command.
23
+ *
24
+ * The default humanization algorithm for command names is to title-case
25
+ * all words; `foo:do-a-cool-thing` becomes `Foo: Do A Cool Thing`. If that
26
+ * somehow doesn't suffice, you may specify your own humanized name — but
27
+ * you are encouraged to keep it as similar to the base command name as
28
+ * possible so that users may enjoy predictable filtering behavior within
29
+ * the command palette.
30
+ */
31
+ displayName?: string | undefined;
32
+ /**
33
+ * An optional description to show within the command palette for this
34
+ * command.
35
+ *
36
+ * This is rarely used, but is present in case you want to add more context
37
+ * to the user around what this command does. It is only used by the
38
+ * command palette and will display an extra line of text underneath the
39
+ * humanized command name.
40
+ */
41
+ description?: string | undefined;
42
+ /**
43
+ * Whether this command should appear in the command palette. Defaults to
44
+ * `true` if omitted.
45
+ *
46
+ * It is rare that you'd want to hide a certain command from appearing in
47
+ * the command palette, but not unheard of. For instance: a language
48
+ * grammar may add a command that does something simple while the user
49
+ * types (like add padding around the cursor or insert a pair of
50
+ * delimiters) and bind it to a commonly used key. In those cases, it would
51
+ * be fair to hide such a command from the command palette so as not to
52
+ * remove it from the specific context in which it would be invoked.
53
+ */
54
+ hiddenInCommandPalette?: boolean | undefined;
55
+ }
56
+ | ((event: CommandEvent<TargetType>) => unknown | Promise<unknown>);
57
+
58
+ /**
59
+ * Associates listener functions with commands in a context-sensitive way using
60
+ * CSS selectors.
61
+ */
62
+ export interface CommandRegistry {
63
+ /** Register a single command. */
64
+ add<T extends keyof CommandRegistryTargetMap>(
65
+ target: T,
66
+ commandName: string,
67
+ listener: CommandRegistryListener<CommandRegistryTargetMap[T]>,
68
+ ): Disposable;
69
+ /** Register a single command. */
70
+ add<T extends Node>(target: T, commandName: string, listener: CommandRegistryListener<T>): Disposable;
71
+ /** Register a single command. */
72
+ add<T extends string>(target: T, commandName: string, listener: CommandRegistryListener): Disposable;
73
+
74
+ /** Register multiple commands. */
75
+ add<T extends keyof CommandRegistryTargetMap>(
76
+ target: T,
77
+ commands: {
78
+ [key: string]: CommandRegistryListener<CommandRegistryTargetMap[T]>;
79
+ }
80
+ ): CompositeDisposable;
81
+ /** Register multiple commands. */
82
+ add<T extends Node>(
83
+ target: T,
84
+ commands: {
85
+ [key: string]: CommandRegistryListener<T>;
86
+ }
87
+ ): CompositeDisposable;
88
+ add<T extends string>(
89
+ target: T,
90
+ commands: {
91
+ [key: string]: CommandRegistryListener;
92
+ }
93
+ ) : CompositeDisposable;
94
+
95
+ /** Find all registered commands matching a query. */
96
+ findCommands(params: {
97
+ target: string | Node;
98
+ }): Array<{
99
+ name: string;
100
+ displayName: string;
101
+ description?: string | undefined;
102
+ tags?: string[] | undefined;
103
+ }>;
104
+
105
+ /**
106
+ * Simulate the dispatch of a command on a DOM node.
107
+ *
108
+ * @return Either a promise that resolves after all handlers complete or
109
+ * `null` if no handlers were matched.
110
+ */
111
+ dispatch(target: Node, commandName: string): Promise<void> | null;
112
+
113
+ /** Invoke the given callback before dispatching a command event. */
114
+ onWillDispatch(callback: (event: CommandEvent) => void): Disposable;
115
+
116
+ /** Invoke the given callback after dispatching a command event. */
117
+ onDidDispatch(callback: (event: CommandEvent) => void): Disposable;
118
+ }
@@ -0,0 +1,271 @@
1
+ import { FileEncoding, Invisibles } from "../index";
2
+
3
+ // NOTE: The config schema with these defaults can be found here:
4
+ // https://github.com/pulsar-edit/pulsar/blob/v1.128.0/src/config-schema.js
5
+ /**
6
+ * Allows you to strongly type Atom configuration variables. Additional
7
+ * key/value pairings merged into this interface will result in configuration
8
+ * values under the value of each key being templated by the type of the
9
+ * associated value.
10
+ */
11
+ export interface ConfigValues {
12
+ // NOTE: this is intentionally left empty, extended via ambient declarations
13
+ }
14
+
15
+ // NOTE: A hack to make ConfigValues extensible.
16
+ declare module "atom" {
17
+ interface ConfigValues {
18
+ /**
19
+ * List of glob patterns. Files and directories matching these patterns
20
+ * will be ignored by some packages, such as the fuzzy finder and tree
21
+ * view. Individual packages might have additional config settings for
22
+ * ignoring names.
23
+ */
24
+ "core.ignoredNames": string[];
25
+
26
+ /**
27
+ * Files and directories ignored by the current project's VCS system will
28
+ * be ignored by some packages, such as the fuzzy finder and find and
29
+ * replace. For example, projects using Git have these paths defined in the
30
+ * .gitignore file. Individual packages might have additional config
31
+ * settings for ignoring VCS ignored files and folders.
32
+ */
33
+ "core.excludeVcsIgnoredPaths": boolean;
34
+
35
+ /**
36
+ * Follow symbolic links when searching files and when opening files with
37
+ * the fuzzy finder.
38
+ */
39
+ "core.followSymlinks": boolean;
40
+
41
+ /** List of names of installed packages which are not loaded at startup. */
42
+ "core.disabledPackages": string[];
43
+
44
+ /** List of names of installed packages which are not automatically updated. */
45
+ "core.versionPinnedPackages": string[];
46
+
47
+ /**
48
+ * Associates scope names (e.g. "source.coffee") with arrays of file
49
+ * extensions and file names (e.g. ["Cakefile", ".coffee2"]). */
50
+ "core.customFileTypes": {
51
+ [key: string]: string[];
52
+ };
53
+
54
+ /** Names of UI and syntax themes which will be used when Atom starts. */
55
+ "core.themes": string[];
56
+
57
+ /**
58
+ * Trigger the system's beep sound when certain actions cannot be executed
59
+ * or there are no results.
60
+ */
61
+ "core.audioBeep": boolean;
62
+
63
+ /** Close corresponding editors when a file is deleted outside Atom. */
64
+ "core.closeDeletedFileTabs": boolean;
65
+
66
+ /** When the last tab of a pane is closed, remove that pane as well. */
67
+ "core.destroyEmptyPanes": boolean;
68
+
69
+ /**
70
+ * When a window with no open tabs or panes is given the 'Close Tab'
71
+ * command, close that window.
72
+ */
73
+ "core.closeEmptyWindows": boolean;
74
+
75
+ /** Default character set encoding to use when reading and writing files. */
76
+ "core.fileEncoding": FileEncoding;
77
+
78
+ /**
79
+ * When checked, opens an untitled editor when loading a blank environment
80
+ * (such as with 'File > New Window' or when "Restore Previous Windows On
81
+ * Start" is unchecked); otherwise, no editor is opened when loading a
82
+ * blank environment. This setting has no effect when restoring a previous
83
+ * state.
84
+ */
85
+ "core.openEmptyEditorOnStart": boolean;
86
+
87
+ /**
88
+ * When 'no': loads a blank environment.
89
+ *
90
+ * When 'yes', and Pulsar is started from the icon or `pulsar` by itself
91
+ * from the command line, restores the last state of all Pulsar windows;
92
+ * otherwise, loads a blank environment.
93
+ *
94
+ * When 'always', restores the last state of all Pulsar windows always, no
95
+ * matter how Pulsar is started.
96
+ */
97
+ "core.restorePreviousWindowsOnStart": "no" | "yes" | "always";
98
+
99
+ /** How many recent projects to show in the Reopen Project menu. */
100
+ "core.reopenProjectMenuCount": number;
101
+
102
+ /** Automatically update Atom when a new release is available. */
103
+ "core.automaticallyUpdate": boolean;
104
+
105
+ /** Use detected proxy settings when calling the `apm` command-line tool. */
106
+ "core.useProxySettingsWhenCallingApm": boolean;
107
+
108
+ /**
109
+ * Allow items to be previewed without adding them to a pane permanently,
110
+ * such as when single clicking files in the tree view.
111
+ */
112
+ "core.allowPendingPaneItems": boolean;
113
+
114
+ /**
115
+ * Allow usage statistics and exception reports to be sent to the Pulsar
116
+ * team to help improve the product.
117
+ */
118
+ "core.telemetryConsent": "limited" | "no" | "undecided";
119
+
120
+ /** Warn before opening files larger than this number of megabytes. */
121
+ "core.warnOnLargeFileLimit": number;
122
+
123
+ /**
124
+ * Choose the underlying implementation used to watch for filesystem
125
+ * changes. Emulating changes will miss any events caused by applications
126
+ * other than Atom, but may help prevent crashes or freezes.
127
+ */
128
+ "core.fileSystemWatcher": "native";
129
+
130
+ /** Use new Tree-sitter parsing system for supported languages. */
131
+ "core.useTreeSitterParsers": boolean;
132
+
133
+ /**
134
+ * Specify whether Atom should use the operating system's color profile
135
+ * (recommended) or an alternative color profile.
136
+ */
137
+ "core.colorProfile": "default" | "srgb";
138
+
139
+ "editor.commentStart": string | null;
140
+
141
+ "editor.commentEnd": string | null;
142
+
143
+ "editor.increaseIndentPattern": string | null;
144
+
145
+ "editor.decreaseIndentPattern": string | null;
146
+
147
+ "editor.foldEndPattern": string | null;
148
+
149
+ /** The name of the font family used for editor text. */
150
+ "editor.fontFamily": string;
151
+
152
+ /** Height in pixels of editor text. */
153
+ "editor.fontSize": number;
154
+
155
+ /** Height of editor lines, as a multiplier of font size. */
156
+ "editor.lineHeight": string | number;
157
+
158
+ /** Show cursor while there is a selection. */
159
+ "editor.showCursorOnSelection": boolean;
160
+
161
+ /** Render placeholders for invisible characters, such as tabs, spaces and newlines. */
162
+ "editor.showInvisibles": boolean;
163
+
164
+ /** Show indentation indicators in the editor. */
165
+ "editor.showIndentGuide": boolean;
166
+
167
+ /** Show line numbers in the editor's gutter. */
168
+ "editor.showLineNumbers": boolean;
169
+
170
+ /** Skip over tab-length runs of leading whitespace when moving the cursor. */
171
+ "editor.atomicSoftTabs": boolean;
172
+
173
+ /** Automatically indent the cursor when inserting a newline. */
174
+ "editor.autoIndent": boolean;
175
+
176
+ /** Automatically indent pasted text based on the indentation of the previous line. */
177
+ "editor.autoIndentOnPaste": boolean;
178
+
179
+ /** A string of non-word characters to define word boundaries. */
180
+ "editor.nonWordCharacters": string;
181
+
182
+ /**
183
+ * Identifies the length of a line which is used when wrapping text with
184
+ * the `Soft Wrap At Preferred Line Length` setting enabled, in number of
185
+ * characters.
186
+ */
187
+ "editor.preferredLineLength": number;
188
+
189
+ /**
190
+ * Defines the maximum width of the editor window before soft wrapping is
191
+ * enforced, in number of characters.
192
+ */
193
+ "editor.maxScreenLineLength": number;
194
+
195
+ /** Number of spaces used to represent a tab. */
196
+ "editor.tabLength": number;
197
+
198
+ /**
199
+ * Wraps lines that exceed the width of the window. When `Soft Wrap At
200
+ * Preferred Line Length` is set, it will wrap to the number of characters
201
+ * defined by the `Preferred Line Length` setting.
202
+ */
203
+ "editor.softWrap": boolean;
204
+
205
+ /**
206
+ * If the `Tab Type` config setting is set to "auto" and autodetection of
207
+ * tab type from buffer content fails, then this config setting determines
208
+ * whether a soft tab or a hard tab will be inserted when the Tab key is
209
+ * pressed.
210
+ */
211
+ "editor.softTabs": boolean;
212
+
213
+ /**
214
+ * Determine character inserted when Tab key is pressed. Possible values:
215
+ * "auto", "soft" and "hard". When set to "soft" or "hard", soft tabs
216
+ * (spaces) or hard tabs (tab characters) are used. When set to "auto", the
217
+ * editor auto-detects the tab type based on the contents of the buffer (it
218
+ * uses the first leading whitespace on a non-comment line), or uses the
219
+ * value of the Soft Tabs config setting if auto-detection fails.
220
+ */
221
+ "editor.tabType": "auto" | "soft" | "hard";
222
+
223
+ /**
224
+ * Instead of wrapping lines to the window's width, wrap lines to the
225
+ * number of characters defined by the `Preferred Line Length` setting.
226
+ * This will only take effect when the soft wrap config setting is enabled
227
+ * globally or for the current language. **Note:** If you want to hide the
228
+ * wrap guide (the vertical line) you can disable the `wrap-guide` package.
229
+ */
230
+ "editor.softWrapAtPreferredLineLength": boolean;
231
+
232
+ /**
233
+ * When soft wrap is enabled, defines length of additional indentation
234
+ * applied to wrapped lines, in number of characters.
235
+ */
236
+ "editor.softWrapHangingIndent": number;
237
+
238
+ /** Determines how fast the editor scrolls when using a mouse or trackpad. */
239
+ "editor.scrollSensitivity": number;
240
+
241
+ /** Allow the editor to be scrolled past the end of the last line. */
242
+ "editor.scrollPastEnd": boolean;
243
+
244
+ /**
245
+ * Time interval in milliseconds within which text editing operations will
246
+ * be grouped together in the undo history.
247
+ */
248
+ "editor.undoGroupingInterval": number;
249
+
250
+ /**
251
+ * Show confirmation dialog when checking out the HEAD revision and
252
+ * discarding changes to current file since last commit.
253
+ */
254
+ "editor.confirmCheckoutHeadRevision": boolean;
255
+
256
+ /**
257
+ * A hash of characters Atom will use to render whitespace characters. Keys
258
+ * are whitespace character types, values are rendered characters (use
259
+ * value false to turn off individual whitespace character types).
260
+ */
261
+ "editor.invisibles": Invisibles;
262
+
263
+ /**
264
+ * Change the editor font size when pressing the Ctrl key and scrolling the
265
+ * mouse up/down.
266
+ */
267
+ "editor.zoomFontWhenCtrlScrolling": boolean;
268
+
269
+ [key: string]: any;
270
+ }
271
+ }
@@ -0,0 +1,168 @@
1
+ import { ConfigValues, Disposable, ScopeDescriptor } from "../index";
2
+
3
+ type ConfigSchemaType = 'integer' | 'boolean' | 'array' | 'object' | 'color' | 'string' | 'number'
4
+
5
+ export type ConfigSchema =
6
+ | ConfigSchemaForInteger
7
+ | ConfigSchemaForNumber
8
+ | ConfigSchemaForBoolean
9
+ | ConfigSchemaForArray
10
+ | ConfigSchemaForString
11
+ | ConfigSchemaForColor
12
+ | ConfigSchemaForObject
13
+
14
+ type ConfigSchemaBase = {
15
+ title?: string
16
+ description?: string
17
+ }
18
+
19
+ type ConfigSchemaForInteger = ConfigSchemaBase & {
20
+ type: 'integer'
21
+ default?: number
22
+ minimum?: number
23
+ maximum?: number
24
+ }
25
+
26
+ type ConfigSchemaForNumber = ConfigSchemaBase & {
27
+ type: 'number'
28
+ default?: number
29
+ minimum?: number
30
+ maximum?: number
31
+ }
32
+
33
+ type ConfigSchemaForBoolean = ConfigSchemaBase & {
34
+ type: 'boolean'
35
+ default?: boolean
36
+ }
37
+
38
+ type ConfigSchemaForString = {
39
+ type: 'string'
40
+ default?: string
41
+ }
42
+
43
+ type ConfigSchemaForColor = {
44
+ type: 'color'
45
+ default?: string
46
+ }
47
+
48
+ type ConfigSchemaForArray<SubType = unknown> = ConfigSchemaBase & {
49
+ type: 'array'
50
+ default?: SubType[]
51
+ items: ConfigSchema
52
+ }
53
+
54
+ type ConfigSchemaForObject = ConfigSchemaBase & {
55
+ type: 'object'
56
+ properties: Record<string, ConfigSchema>
57
+ }
58
+
59
+ /** Used to access all of Atom's configuration details. */
60
+ export interface Config {
61
+ // Config Subscription
62
+ /**
63
+ * Add a listener for changes to a given key path.
64
+ *
65
+ * This is different than {@link onDidChange} in that it will immediately
66
+ * call your callback with the current value of the config entry.
67
+ */
68
+ observe<T extends keyof ConfigValues>(keyPath: T, callback: (value: ConfigValues[T]) => void): Disposable;
69
+ /**
70
+ * Add a listener for changes to a given key path.
71
+ *
72
+ * This is different than {@link onDidChange} in that it will immediately
73
+ * call your callback with the current value of the config entry.
74
+ */
75
+ observe<T extends keyof ConfigValues>(
76
+ keyPath: T,
77
+ options: { scope: string[] | ScopeDescriptor },
78
+ callback: (value: ConfigValues[T]) => void,
79
+ ): Disposable;
80
+
81
+ /**
82
+ * Add a listener for all configuration key changes.
83
+ */
84
+ // tslint:disable-next-line:no-any
85
+ onDidChange<T = any>(
86
+ callback: (values: { newValue: T; oldValue: T }) => void
87
+ ): Disposable;
88
+ /**
89
+ * Add a listener for changes to a given key path.
90
+ */
91
+ onDidChange<T extends keyof ConfigValues>(
92
+ keyPath: T,
93
+ callback: (values: { newValue: ConfigValues[T]; oldValue?: ConfigValues[T] | undefined }) => void,
94
+ ): Disposable;
95
+ /**
96
+ * Add a listener for changes to a given key path.
97
+ */
98
+ onDidChange<T extends keyof ConfigValues>(
99
+ keyPath: T,
100
+ options: { scope: string[] | ScopeDescriptor },
101
+ callback: (values: { newValue: ConfigValues[T]; oldValue?: ConfigValues[T] | undefined }) => void,
102
+ ): Disposable;
103
+
104
+ // Managing Settings
105
+ /** Retrieves the setting for the given key. */
106
+ get<T extends keyof ConfigValues>(
107
+ keyPath: T,
108
+ options?: {
109
+ sources?: string[] | undefined;
110
+ excludeSources?: string[] | undefined;
111
+ scope?: string[] | ScopeDescriptor | undefined;
112
+ },
113
+ ): ConfigValues[T];
114
+
115
+ /**
116
+ * Sets the value for a configuration setting.
117
+ *
118
+ * Unless the `source` option is specified, this value is stored in Atom's
119
+ * internal configuration file.
120
+ */
121
+ set<T extends keyof ConfigValues>(
122
+ keyPath: T,
123
+ value: ConfigValues[T],
124
+ options?: { scopeSelector?: string | undefined; source?: string | undefined },
125
+ ): void;
126
+
127
+ /** Restore the setting at `keyPath` to its default value. */
128
+ unset(keyPath: string, options?: { scopeSelector?: string | undefined; source?: string | undefined }): void;
129
+
130
+ /**
131
+ * Get all of the values for the given key path, along with their associated
132
+ * scope selector.
133
+ */
134
+ getAll<T extends keyof ConfigValues>(
135
+ keyPath: T,
136
+ options?: {
137
+ sources?: string[] | undefined;
138
+ excludeSources?: string[] | undefined;
139
+ scope?: ScopeDescriptor | undefined;
140
+ },
141
+ ): Array<{ scopeDescriptor: ScopeDescriptor; value: ConfigValues[T] }>;
142
+
143
+ /**
144
+ * Get an Array of all of the source strings with which settings have been
145
+ * added via {@link set}.
146
+ */
147
+ getSources(): string[];
148
+
149
+ /**
150
+ * Retrieve the schema for a specific key path.
151
+ *
152
+ * The schema will tell you what type the keyPath expects, and other metadata
153
+ * about the config option.
154
+ */
155
+ getSchema(keyPath: string): ConfigSchema | null;
156
+
157
+ /** Get the string path to the config file being used. */
158
+ getUserConfigPath(): string;
159
+
160
+ /**
161
+ * Suppress calls to handler functions registered with {@link onDidChange}
162
+ * and {@link observe} for the duration of `callback`.
163
+ *
164
+ * After `callback` executes, handlers will be called once if the value for
165
+ * their key path has changed.
166
+ */
167
+ transact(callback: () => void): void;
168
+ }