@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.
- package/.github/workflows/publish.yml +33 -0
- package/LICENSE.md +8 -0
- package/README.md +187 -0
- package/atom-i18n/config.d.ts +9 -0
- package/atom-i18n/index.d.ts +4 -0
- package/autocomplete-plus/config.d.ts +140 -0
- package/autocomplete-plus/index.d.ts +200 -0
- package/dependencies/event-kit/index.d.ts +143 -0
- package/dependencies/first-mate/index.d.ts +1 -0
- package/dependencies/first-mate/src/first-mate.d.ts +1 -0
- package/dependencies/first-mate/src/grammar.d.ts +119 -0
- package/dependencies/pathwatcher/index.d.ts +1 -0
- package/dependencies/pathwatcher/src/directory.d.ts +98 -0
- package/dependencies/pathwatcher/src/file.d.ts +115 -0
- package/dependencies/pathwatcher/src/main.d.ts +2 -0
- package/dependencies/service-hub/index.d.ts +3 -0
- package/dependencies/service-hub/src/consumer.d.ts +8 -0
- package/dependencies/service-hub/src/provider.d.ts +14 -0
- package/dependencies/service-hub/src/service-hub.d.ts +46 -0
- package/dependencies/service-hub/src/util.d.ts +1 -0
- package/dependencies/text-buffer/index.d.ts +1 -0
- package/dependencies/text-buffer/src/display-marker-layer.d.ts +182 -0
- package/dependencies/text-buffer/src/display-marker.d.ts +232 -0
- package/dependencies/text-buffer/src/helpers.d.ts +11 -0
- package/dependencies/text-buffer/src/marker-layer.d.ts +117 -0
- package/dependencies/text-buffer/src/marker.d.ts +207 -0
- package/dependencies/text-buffer/src/point.d.ts +102 -0
- package/dependencies/text-buffer/src/range.d.ts +141 -0
- package/dependencies/text-buffer/src/text-buffer.d.ts +759 -0
- package/index.d.ts +72 -0
- package/linter/config.d.ts +26 -0
- package/linter/index.d.ts +108 -0
- package/package.json +61 -0
- package/src/atom-environment.d.ts +361 -0
- package/src/branding.d.ts +19 -0
- package/src/buffered-node-process.d.ts +10 -0
- package/src/buffered-process.d.ts +88 -0
- package/src/clipboard.d.ts +14 -0
- package/src/color.d.ts +11 -0
- package/src/command-registry.d.ts +118 -0
- package/src/config-schema.d.ts +271 -0
- package/src/config.d.ts +168 -0
- package/src/context-menu-manager.d.ts +65 -0
- package/src/cursor.d.ts +252 -0
- package/src/decoration.d.ts +156 -0
- package/src/deserializer-manager.d.ts +15 -0
- package/src/dock.d.ts +121 -0
- package/src/get-window-load-settings.d.ts +26 -0
- package/src/git-repository.d.ts +174 -0
- package/src/grammar-registry.d.ts +241 -0
- package/src/gutter.d.ts +118 -0
- package/src/history-manager.d.ts +28 -0
- package/src/keymap-extensions.d.ts +190 -0
- package/src/language-mode.d.ts +314 -0
- package/src/layer-decoration.d.ts +31 -0
- package/src/menu-manager.d.ts +24 -0
- package/src/notification-manager.d.ts +37 -0
- package/src/notification.d.ts +79 -0
- package/src/other-types.d.ts +283 -0
- package/src/package-manager.d.ts +103 -0
- package/src/package.d.ts +33 -0
- package/src/pane.d.ts +604 -0
- package/src/panel.d.ts +38 -0
- package/src/path-watcher.d.ts +35 -0
- package/src/project.d.ts +110 -0
- package/src/scope-descriptor.d.ts +8 -0
- package/src/selection.d.ts +341 -0
- package/src/style-manager.d.ts +68 -0
- package/src/task.d.ts +38 -0
- package/src/text-editor-component.d.ts +15 -0
- package/src/text-editor-element.d.ts +48 -0
- package/src/text-editor-registry.d.ts +48 -0
- package/src/text-editor.d.ts +1416 -0
- package/src/theme-manager.d.ts +29 -0
- package/src/tooltip-manager.d.ts +42 -0
- package/src/tooltip.d.ts +63 -0
- package/src/ui.d.ts +101 -0
- package/src/view-registry.d.ts +34 -0
- package/src/wasm-tree-sitter-grammar.d.ts +305 -0
- package/src/wasm-tree-sitter-language-mode.d.ts +294 -0
- package/src/workspace-center.d.ts +117 -0
- package/src/workspace.d.ts +485 -0
- package/status-bar/config.d.ts +23 -0
- package/status-bar/index.d.ts +51 -0
- package/tool-bar/config.d.ts +20 -0
- package/tool-bar/index.d.ts +235 -0
- package/tsconfig.json +8 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
// tool-bar 1.2.x
|
|
2
|
+
// https://web.pulsar-edit.dev/packages/tool-bar
|
|
3
|
+
// Definitions by: aminya <https://github.com/aminya>
|
|
4
|
+
|
|
5
|
+
/// <reference path="./config.d.ts" />
|
|
6
|
+
|
|
7
|
+
import { Disposable, TooltipPlacement } from "../index";
|
|
8
|
+
|
|
9
|
+
export declare interface ButtonOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Icon name.
|
|
12
|
+
*
|
|
13
|
+
* ## Example:
|
|
14
|
+
* ```js
|
|
15
|
+
* icon: 'octoface',
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
icon?: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Icon set name.
|
|
22
|
+
*
|
|
23
|
+
* It can be chosen among these:
|
|
24
|
+
*
|
|
25
|
+
* - Not given: if `iconset` is not given Octicons (default Pulsar's flavor)
|
|
26
|
+
* is chosen
|
|
27
|
+
* - `ion` with `ios-` and `md- `prefixes for the icon names (Ionicons)
|
|
28
|
+
* - `fa` and fab for brands (FontAwesome)
|
|
29
|
+
* - `fi` (Foundation)
|
|
30
|
+
* - `icomoon` (IcoMoon)
|
|
31
|
+
* - `devicon` (Devicon)
|
|
32
|
+
* - `mdi` (MaterialDesignIcons)
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* {
|
|
36
|
+
* icon: 'ios-gear-a',
|
|
37
|
+
* iconset: 'ion'
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
iconset?: undefined | "ion" | "fa" | "fab" | "fi" | "icomoon" | "devicon" | "mdi";
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* You can use `text` to add text for a button or to use HTML for a button
|
|
45
|
+
* (if `html` is set to `true`).
|
|
46
|
+
*
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* {
|
|
50
|
+
* text: '<b>BIG</b> button',
|
|
51
|
+
* html: true,
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
text?: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* If set to `true`, `text` will be rendered as HTML.
|
|
59
|
+
*/
|
|
60
|
+
html?: boolean;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The callback must be either
|
|
64
|
+
*
|
|
65
|
+
* - Pulsar command: a string or array of strings,
|
|
66
|
+
* - a custom callback function, or
|
|
67
|
+
* - an object where the keys are key modifiers (`alt`, `ctrl` or `shift`)
|
|
68
|
+
* and the values are commands or custom functions.
|
|
69
|
+
*
|
|
70
|
+
* ## Example:
|
|
71
|
+
* ```ts
|
|
72
|
+
* callback: 'application:about',
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* ## Example - Callback with modifiers
|
|
76
|
+
* ```ts
|
|
77
|
+
* {
|
|
78
|
+
* callback: {
|
|
79
|
+
* '': 'application:cmd-1', // Without modifiers is default action
|
|
80
|
+
* 'alt': 'application:cmd-2',
|
|
81
|
+
* 'ctrl': 'application:cmd-3', // With function callback
|
|
82
|
+
* 'shift'(data) {
|
|
83
|
+
* console.log(data);
|
|
84
|
+
* },
|
|
85
|
+
* 'alt+shift': 'application:cmd-5', // Multiple modifiers
|
|
86
|
+
* 'alt+ctrl+shift': 'application:cmd-6' // All modifiers
|
|
87
|
+
* },
|
|
88
|
+
* data: 'foo'
|
|
89
|
+
* }
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
callback:
|
|
93
|
+
| string
|
|
94
|
+
| Array<string>
|
|
95
|
+
| ((data?: any) => void)
|
|
96
|
+
| { [modifier: string]: string }
|
|
97
|
+
| { [modifier: string]: (data?: any) => void };
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* `data` can be passed as the input argument of callback if callback is of
|
|
101
|
+
* type
|
|
102
|
+
* - `(data: any) => void)` or
|
|
103
|
+
* - `{ [modifier: string]: ((data: any) => void) }`,
|
|
104
|
+
*/
|
|
105
|
+
data?: any;
|
|
106
|
+
|
|
107
|
+
/** (optional) defaults to `50` */
|
|
108
|
+
priority?: number;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The tooltip option may be a string or an object that is passed to Pulsar's
|
|
112
|
+
* TooltipManager.
|
|
113
|
+
*/
|
|
114
|
+
tooltip?:
|
|
115
|
+
| string // minimally sets title
|
|
116
|
+
// similar to what TooltipManager.add options accepts:
|
|
117
|
+
| { item?: object }
|
|
118
|
+
| ({
|
|
119
|
+
title?: string | (() => string);
|
|
120
|
+
html?: boolean;
|
|
121
|
+
keyBindingCommand?: string;
|
|
122
|
+
keyBindingTarget?: HTMLElement;
|
|
123
|
+
} & {
|
|
124
|
+
class?: string;
|
|
125
|
+
placement?: TooltipPlacement | (() => TooltipPlacement);
|
|
126
|
+
trigger?: "click" | "hover" | "focus" | "manual";
|
|
127
|
+
delay?: { show: number; hide: number };
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
/** Color of the button. */
|
|
131
|
+
color?: string;
|
|
132
|
+
|
|
133
|
+
/** Color of the button's background. */
|
|
134
|
+
background?: string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Buttons can be styled with arbitrary CSS through classes.
|
|
138
|
+
* An example of how the class can be used is show below.
|
|
139
|
+
*
|
|
140
|
+
* ## Example:
|
|
141
|
+
* ```ts
|
|
142
|
+
* class: 'my-awesome-class'
|
|
143
|
+
* ```
|
|
144
|
+
*
|
|
145
|
+
* ## Example:
|
|
146
|
+
* ```ts
|
|
147
|
+
* class: ['multiple', 'classes', 'also', 'works']
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
class?: string | Array<string>;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export declare interface SpacerOptions {
|
|
154
|
+
/** (optional) defaults to `50` */
|
|
155
|
+
priority?: number;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
declare interface ToolBarButtonView {
|
|
159
|
+
element: HTMLButtonElement;
|
|
160
|
+
subscriptions: Disposable;
|
|
161
|
+
priority: number;
|
|
162
|
+
options: ButtonOptions;
|
|
163
|
+
group: string;
|
|
164
|
+
enabled: boolean;
|
|
165
|
+
|
|
166
|
+
setEnabled(enabled: boolean): void;
|
|
167
|
+
|
|
168
|
+
setSelected(selected: boolean): void;
|
|
169
|
+
|
|
170
|
+
getSelected(): boolean;
|
|
171
|
+
|
|
172
|
+
_onMouseDown(event: MouseEvent): void;
|
|
173
|
+
|
|
174
|
+
_onClick(event: MouseEvent): void;
|
|
175
|
+
|
|
176
|
+
executeCallback(event: MouseEvent): void;
|
|
177
|
+
|
|
178
|
+
destroy(): void;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare interface ToolBarSpacerView {
|
|
182
|
+
element: HTMLHRElement;
|
|
183
|
+
priority: number;
|
|
184
|
+
group: string;
|
|
185
|
+
|
|
186
|
+
destroy(): void;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export declare interface ToolBarManager {
|
|
190
|
+
/** Adds a button. The input to this function is a `ButtonOptions` object */
|
|
191
|
+
addButton(options: ButtonOptions): ToolBarButtonView;
|
|
192
|
+
|
|
193
|
+
/** Adds a spacer. Optionally, you can pass a `SpacerOptions` object */
|
|
194
|
+
addSpacer(options?: SpacerOptions): ToolBarSpacerView;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Use the method removeItems to remove the buttons added by your package.
|
|
198
|
+
* This is particular useful in your package deactivate method, but can be
|
|
199
|
+
* used at any time.
|
|
200
|
+
*/
|
|
201
|
+
removeItems(): void;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* The onDidDestroy method takes a function that will be called when the
|
|
205
|
+
* tool-bar package is destroyed. This is useful if your package needs to do
|
|
206
|
+
* cleanup when the tool-bar is deactivated but your package continues
|
|
207
|
+
* running.
|
|
208
|
+
*/
|
|
209
|
+
onDidDestroy(callback: () => void): void;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Passed as an input to `consumeToolBar(getToolBar: getToolBarManager)`
|
|
214
|
+
* function of your package.
|
|
215
|
+
*
|
|
216
|
+
* In your main package file, add the following methods and replace
|
|
217
|
+
* your-package-name with your package name.
|
|
218
|
+
*
|
|
219
|
+
* ```ts
|
|
220
|
+
* let toolBar: ToolBarManager
|
|
221
|
+
*
|
|
222
|
+
* export function consumeToolBar(getToolBar: getToolBarManager) {
|
|
223
|
+
* toolBar = getToolBar("packageName");
|
|
224
|
+
* // Add buttons and spacers here...
|
|
225
|
+
* }
|
|
226
|
+
*
|
|
227
|
+
* export function deactivate() {
|
|
228
|
+
* if (toolBar) {
|
|
229
|
+
* toolBar.removeItems();
|
|
230
|
+
* toolBar = null;
|
|
231
|
+
* }
|
|
232
|
+
* }
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
export type getToolBarManager = (packageName: string) => ToolBarManager;
|