custom-electron-titlebar 4.2.0-alpha.2 → 4.2.0

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 (63) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +83 -65
  3. package/package.json +69 -58
  4. package/dist/enums/menu-state.d.ts +0 -6
  5. package/dist/index.d.ts +0 -3
  6. package/dist/index.js +0 -1
  7. package/dist/titlebar.d.ts +0 -143
  8. package/dist/types/menubar-options.d.ts +0 -41
  9. package/dist/types/scss.d.ts +0 -6
  10. package/dist/types/titlebar-options.d.ts +0 -66
  11. package/dist/utils/color.d.ts +0 -2
  12. package/dist/vs/base/browser/browser.d.ts +0 -40
  13. package/dist/vs/base/browser/canIUse.d.ts +0 -17
  14. package/dist/vs/base/browser/dom.d.ts +0 -325
  15. package/dist/vs/base/browser/event.d.ts +0 -27
  16. package/dist/vs/base/browser/fastDomNode.d.ts +0 -59
  17. package/dist/vs/base/browser/globalMouseMoveMonitor.d.ts +0 -29
  18. package/dist/vs/base/browser/iframe.d.ts +0 -33
  19. package/dist/vs/base/browser/keyboardEvent.d.ts +0 -42
  20. package/dist/vs/base/browser/mouseEvent.d.ts +0 -69
  21. package/dist/vs/base/browser/touch.d.ts +0 -39
  22. package/dist/vs/base/browser/ui/actionbar/actionViewItems.d.ts +0 -58
  23. package/dist/vs/base/browser/ui/actionbar/actionbar.d.ts +0 -95
  24. package/dist/vs/base/browser/ui/contextview/contextview.d.ts +0 -94
  25. package/dist/vs/base/browser/ui/menu/menu.d.ts +0 -58
  26. package/dist/vs/base/browser/ui/menu/menubar.d.ts +0 -78
  27. package/dist/vs/base/browser/ui/scrollbar/abstractScrollbar.d.ts +0 -67
  28. package/dist/vs/base/browser/ui/scrollbar/horizontalScrollbar.d.ts +0 -15
  29. package/dist/vs/base/browser/ui/scrollbar/scrollableElement.d.ts +0 -107
  30. package/dist/vs/base/browser/ui/scrollbar/scrollableElementOptions.d.ts +0 -157
  31. package/dist/vs/base/browser/ui/scrollbar/scrollbarArrow.d.ts +0 -25
  32. package/dist/vs/base/browser/ui/scrollbar/scrollbarState.d.ts +0 -75
  33. package/dist/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.d.ts +0 -24
  34. package/dist/vs/base/browser/ui/scrollbar/verticalScrollbar.d.ts +0 -15
  35. package/dist/vs/base/browser/ui/widget.d.ts +0 -16
  36. package/dist/vs/base/common/actions.d.ts +0 -115
  37. package/dist/vs/base/common/arrays.d.ts +0 -168
  38. package/dist/vs/base/common/async.d.ts +0 -510
  39. package/dist/vs/base/common/cache.d.ts +0 -23
  40. package/dist/vs/base/common/cancellation.d.ts +0 -29
  41. package/dist/vs/base/common/charCode.d.ts +0 -405
  42. package/dist/vs/base/common/color.d.ts +0 -159
  43. package/dist/vs/base/common/decorators.d.ts +0 -7
  44. package/dist/vs/base/common/errors.d.ts +0 -77
  45. package/dist/vs/base/common/event.d.ts +0 -274
  46. package/dist/vs/base/common/functional.d.ts +0 -1
  47. package/dist/vs/base/common/iterator.d.ts +0 -31
  48. package/dist/vs/base/common/keyCodes.d.ts +0 -429
  49. package/dist/vs/base/common/keybindings.d.ts +0 -99
  50. package/dist/vs/base/common/lazy.d.ts +0 -19
  51. package/dist/vs/base/common/lifecycle.d.ts +0 -129
  52. package/dist/vs/base/common/linkedList.d.ts +0 -15
  53. package/dist/vs/base/common/platform.d.ts +0 -85
  54. package/dist/vs/base/common/range.d.ts +0 -18
  55. package/dist/vs/base/common/scrollable.d.ts +0 -141
  56. package/dist/vs/base/common/strings.d.ts +0 -215
  57. package/dist/vs/base/common/types.d.ts +0 -89
  58. package/dist/vs/base/common/uint.d.ts +0 -31
  59. package/dist/vs/nls.d.ts +0 -18
  60. package/main/attach-titlebar-to-window.d.ts +0 -3
  61. package/main/index.d.ts +0 -5
  62. package/main/main.js +0 -1
  63. package/main/setup-main.d.ts +0 -2
@@ -1,429 +0,0 @@
1
- /**
2
- * Virtual Key Codes, the value does not hold any inherent meaning.
3
- * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
4
- * But these are "more general", as they should work across browsers & OS`s.
5
- */
6
- export declare const enum KeyCode {
7
- DependsOnKbLayout = -1,
8
- /**
9
- * Placed first to cover the 0 value of the enum.
10
- */
11
- Unknown = 0,
12
- Backspace = 1,
13
- Tab = 2,
14
- Enter = 3,
15
- Shift = 4,
16
- Ctrl = 5,
17
- Alt = 6,
18
- PauseBreak = 7,
19
- CapsLock = 8,
20
- Escape = 9,
21
- Space = 10,
22
- PageUp = 11,
23
- PageDown = 12,
24
- End = 13,
25
- Home = 14,
26
- LeftArrow = 15,
27
- UpArrow = 16,
28
- RightArrow = 17,
29
- DownArrow = 18,
30
- Insert = 19,
31
- Delete = 20,
32
- Digit0 = 21,
33
- Digit1 = 22,
34
- Digit2 = 23,
35
- Digit3 = 24,
36
- Digit4 = 25,
37
- Digit5 = 26,
38
- Digit6 = 27,
39
- Digit7 = 28,
40
- Digit8 = 29,
41
- Digit9 = 30,
42
- KeyA = 31,
43
- KeyB = 32,
44
- KeyC = 33,
45
- KeyD = 34,
46
- KeyE = 35,
47
- KeyF = 36,
48
- KeyG = 37,
49
- KeyH = 38,
50
- KeyI = 39,
51
- KeyJ = 40,
52
- KeyK = 41,
53
- KeyL = 42,
54
- KeyM = 43,
55
- KeyN = 44,
56
- KeyO = 45,
57
- KeyP = 46,
58
- KeyQ = 47,
59
- KeyR = 48,
60
- KeyS = 49,
61
- KeyT = 50,
62
- KeyU = 51,
63
- KeyV = 52,
64
- KeyW = 53,
65
- KeyX = 54,
66
- KeyY = 55,
67
- KeyZ = 56,
68
- Meta = 57,
69
- ContextMenu = 58,
70
- F1 = 59,
71
- F2 = 60,
72
- F3 = 61,
73
- F4 = 62,
74
- F5 = 63,
75
- F6 = 64,
76
- F7 = 65,
77
- F8 = 66,
78
- F9 = 67,
79
- F10 = 68,
80
- F11 = 69,
81
- F12 = 70,
82
- F13 = 71,
83
- F14 = 72,
84
- F15 = 73,
85
- F16 = 74,
86
- F17 = 75,
87
- F18 = 76,
88
- F19 = 77,
89
- NumLock = 78,
90
- ScrollLock = 79,
91
- /**
92
- * Used for miscellaneous characters; it can vary by keyboard.
93
- * For the US standard keyboard, the ';:' key
94
- */
95
- Semicolon = 80,
96
- /**
97
- * For any country/region, the '+' key
98
- * For the US standard keyboard, the '=+' key
99
- */
100
- Equal = 81,
101
- /**
102
- * For any country/region, the ',' key
103
- * For the US standard keyboard, the ',<' key
104
- */
105
- Comma = 82,
106
- /**
107
- * For any country/region, the '-' key
108
- * For the US standard keyboard, the '-_' key
109
- */
110
- Minus = 83,
111
- /**
112
- * For any country/region, the '.' key
113
- * For the US standard keyboard, the '.>' key
114
- */
115
- Period = 84,
116
- /**
117
- * Used for miscellaneous characters; it can vary by keyboard.
118
- * For the US standard keyboard, the '/?' key
119
- */
120
- Slash = 85,
121
- /**
122
- * Used for miscellaneous characters; it can vary by keyboard.
123
- * For the US standard keyboard, the '`~' key
124
- */
125
- Backquote = 86,
126
- /**
127
- * Used for miscellaneous characters; it can vary by keyboard.
128
- * For the US standard keyboard, the '[{' key
129
- */
130
- BracketLeft = 87,
131
- /**
132
- * Used for miscellaneous characters; it can vary by keyboard.
133
- * For the US standard keyboard, the '\|' key
134
- */
135
- Backslash = 88,
136
- /**
137
- * Used for miscellaneous characters; it can vary by keyboard.
138
- * For the US standard keyboard, the ']}' key
139
- */
140
- BracketRight = 89,
141
- /**
142
- * Used for miscellaneous characters; it can vary by keyboard.
143
- * For the US standard keyboard, the ''"' key
144
- */
145
- Quote = 90,
146
- /**
147
- * Used for miscellaneous characters; it can vary by keyboard.
148
- */
149
- OEM_8 = 91,
150
- /**
151
- * Either the angle bracket key or the backslash key on the RT 102-key keyboard.
152
- */
153
- IntlBackslash = 92,
154
- Numpad0 = 93,
155
- Numpad1 = 94,
156
- Numpad2 = 95,
157
- Numpad3 = 96,
158
- Numpad4 = 97,
159
- Numpad5 = 98,
160
- Numpad6 = 99,
161
- Numpad7 = 100,
162
- Numpad8 = 101,
163
- Numpad9 = 102,
164
- NumpadMultiply = 103,
165
- NumpadAdd = 104,
166
- NUMPAD_SEPARATOR = 105,
167
- NumpadSubtract = 106,
168
- NumpadDecimal = 107,
169
- NumpadDivide = 108,
170
- /**
171
- * Cover all key codes when IME is processing input.
172
- */
173
- KEY_IN_COMPOSITION = 109,
174
- ABNT_C1 = 110,
175
- ABNT_C2 = 111,
176
- AudioVolumeMute = 112,
177
- AudioVolumeUp = 113,
178
- AudioVolumeDown = 114,
179
- BrowserSearch = 115,
180
- BrowserHome = 116,
181
- BrowserBack = 117,
182
- BrowserForward = 118,
183
- MediaTrackNext = 119,
184
- MediaTrackPrevious = 120,
185
- MediaStop = 121,
186
- MediaPlayPause = 122,
187
- LaunchMediaPlayer = 123,
188
- LaunchMail = 124,
189
- LaunchApp2 = 125,
190
- /**
191
- * Placed last to cover the length of the enum.
192
- * Please do not depend on this value!
193
- */
194
- MAX_VALUE = 126
195
- }
196
- /**
197
- * keyboardEvent.code
198
- */
199
- export declare const enum ScanCode {
200
- DependsOnKbLayout = -1,
201
- None = 0,
202
- Hyper = 1,
203
- Super = 2,
204
- Fn = 3,
205
- FnLock = 4,
206
- Suspend = 5,
207
- Resume = 6,
208
- Turbo = 7,
209
- Sleep = 8,
210
- WakeUp = 9,
211
- KeyA = 10,
212
- KeyB = 11,
213
- KeyC = 12,
214
- KeyD = 13,
215
- KeyE = 14,
216
- KeyF = 15,
217
- KeyG = 16,
218
- KeyH = 17,
219
- KeyI = 18,
220
- KeyJ = 19,
221
- KeyK = 20,
222
- KeyL = 21,
223
- KeyM = 22,
224
- KeyN = 23,
225
- KeyO = 24,
226
- KeyP = 25,
227
- KeyQ = 26,
228
- KeyR = 27,
229
- KeyS = 28,
230
- KeyT = 29,
231
- KeyU = 30,
232
- KeyV = 31,
233
- KeyW = 32,
234
- KeyX = 33,
235
- KeyY = 34,
236
- KeyZ = 35,
237
- Digit1 = 36,
238
- Digit2 = 37,
239
- Digit3 = 38,
240
- Digit4 = 39,
241
- Digit5 = 40,
242
- Digit6 = 41,
243
- Digit7 = 42,
244
- Digit8 = 43,
245
- Digit9 = 44,
246
- Digit0 = 45,
247
- Enter = 46,
248
- Escape = 47,
249
- Backspace = 48,
250
- Tab = 49,
251
- Space = 50,
252
- Minus = 51,
253
- Equal = 52,
254
- BracketLeft = 53,
255
- BracketRight = 54,
256
- Backslash = 55,
257
- IntlHash = 56,
258
- Semicolon = 57,
259
- Quote = 58,
260
- Backquote = 59,
261
- Comma = 60,
262
- Period = 61,
263
- Slash = 62,
264
- CapsLock = 63,
265
- F1 = 64,
266
- F2 = 65,
267
- F3 = 66,
268
- F4 = 67,
269
- F5 = 68,
270
- F6 = 69,
271
- F7 = 70,
272
- F8 = 71,
273
- F9 = 72,
274
- F10 = 73,
275
- F11 = 74,
276
- F12 = 75,
277
- PrintScreen = 76,
278
- ScrollLock = 77,
279
- Pause = 78,
280
- Insert = 79,
281
- Home = 80,
282
- PageUp = 81,
283
- Delete = 82,
284
- End = 83,
285
- PageDown = 84,
286
- ArrowRight = 85,
287
- ArrowLeft = 86,
288
- ArrowDown = 87,
289
- ArrowUp = 88,
290
- NumLock = 89,
291
- NumpadDivide = 90,
292
- NumpadMultiply = 91,
293
- NumpadSubtract = 92,
294
- NumpadAdd = 93,
295
- NumpadEnter = 94,
296
- Numpad1 = 95,
297
- Numpad2 = 96,
298
- Numpad3 = 97,
299
- Numpad4 = 98,
300
- Numpad5 = 99,
301
- Numpad6 = 100,
302
- Numpad7 = 101,
303
- Numpad8 = 102,
304
- Numpad9 = 103,
305
- Numpad0 = 104,
306
- NumpadDecimal = 105,
307
- IntlBackslash = 106,
308
- ContextMenu = 107,
309
- Power = 108,
310
- NumpadEqual = 109,
311
- F13 = 110,
312
- F14 = 111,
313
- F15 = 112,
314
- F16 = 113,
315
- F17 = 114,
316
- F18 = 115,
317
- F19 = 116,
318
- F20 = 117,
319
- F21 = 118,
320
- F22 = 119,
321
- F23 = 120,
322
- F24 = 121,
323
- Open = 122,
324
- Help = 123,
325
- Select = 124,
326
- Again = 125,
327
- Undo = 126,
328
- Cut = 127,
329
- Copy = 128,
330
- Paste = 129,
331
- Find = 130,
332
- AudioVolumeMute = 131,
333
- AudioVolumeUp = 132,
334
- AudioVolumeDown = 133,
335
- NumpadComma = 134,
336
- IntlRo = 135,
337
- KanaMode = 136,
338
- IntlYen = 137,
339
- Convert = 138,
340
- NonConvert = 139,
341
- Lang1 = 140,
342
- Lang2 = 141,
343
- Lang3 = 142,
344
- Lang4 = 143,
345
- Lang5 = 144,
346
- Abort = 145,
347
- Props = 146,
348
- NumpadParenLeft = 147,
349
- NumpadParenRight = 148,
350
- NumpadBackspace = 149,
351
- NumpadMemoryStore = 150,
352
- NumpadMemoryRecall = 151,
353
- NumpadMemoryClear = 152,
354
- NumpadMemoryAdd = 153,
355
- NumpadMemorySubtract = 154,
356
- NumpadClear = 155,
357
- NumpadClearEntry = 156,
358
- ControlLeft = 157,
359
- ShiftLeft = 158,
360
- AltLeft = 159,
361
- MetaLeft = 160,
362
- ControlRight = 161,
363
- ShiftRight = 162,
364
- AltRight = 163,
365
- MetaRight = 164,
366
- BrightnessUp = 165,
367
- BrightnessDown = 166,
368
- MediaPlay = 167,
369
- MediaRecord = 168,
370
- MediaFastForward = 169,
371
- MediaRewind = 170,
372
- MediaTrackNext = 171,
373
- MediaTrackPrevious = 172,
374
- MediaStop = 173,
375
- Eject = 174,
376
- MediaPlayPause = 175,
377
- MediaSelect = 176,
378
- LaunchMail = 177,
379
- LaunchApp2 = 178,
380
- LaunchApp1 = 179,
381
- SelectTask = 180,
382
- LaunchScreenSaver = 181,
383
- BrowserSearch = 182,
384
- BrowserHome = 183,
385
- BrowserBack = 184,
386
- BrowserForward = 185,
387
- BrowserStop = 186,
388
- BrowserRefresh = 187,
389
- BrowserFavorites = 188,
390
- ZoomToggle = 189,
391
- MailReply = 190,
392
- MailForward = 191,
393
- MailSend = 192,
394
- MAX_VALUE = 193
395
- }
396
- export declare const EVENT_KEY_CODE_MAP: {
397
- [keyCode: number]: KeyCode;
398
- };
399
- export declare const NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE: {
400
- [nativeKeyCode: string]: KeyCode;
401
- };
402
- export declare const ScanCodeUtils: {
403
- lowerCaseToEnum: (scanCode: string) => number;
404
- toEnum: (scanCode: string) => number;
405
- toString: (scanCode: ScanCode) => string;
406
- };
407
- /**
408
- * -1 if a ScanCode => KeyCode mapping depends on kb layout.
409
- */
410
- export declare const IMMUTABLE_CODE_TO_KEY_CODE: KeyCode[];
411
- /**
412
- * -1 if a KeyCode => ScanCode mapping depends on kb layout.
413
- */
414
- export declare const IMMUTABLE_KEY_CODE_TO_CODE: ScanCode[];
415
- export declare namespace KeyCodeUtils {
416
- function toString(keyCode: KeyCode): string;
417
- function fromString(key: string): KeyCode;
418
- function toUserSettingsUS(keyCode: KeyCode): string;
419
- function toUserSettingsGeneral(keyCode: KeyCode): string;
420
- function fromUserSettings(key: string): KeyCode;
421
- function toElectronAccelerator(keyCode: KeyCode): string | null;
422
- }
423
- export declare const enum KeyMod {
424
- CtrlCmd = 2048,
425
- Shift = 1024,
426
- Alt = 512,
427
- WinCtrl = 256
428
- }
429
- export declare function KeyChord(firstPart: number, secondPart: number): number;
@@ -1,99 +0,0 @@
1
- import { KeyCode, ScanCode } from 'vs/base/common/keyCodes';
2
- import { OperatingSystem } from 'vs/base/common/platform';
3
- export declare function createSimpleKeybinding(keybinding: number, OS: OperatingSystem): SimpleKeybinding;
4
- export interface Modifiers {
5
- readonly ctrlKey: boolean;
6
- readonly shiftKey: boolean;
7
- readonly altKey: boolean;
8
- readonly metaKey: boolean;
9
- }
10
- export interface IBaseKeybinding extends Modifiers {
11
- isDuplicateModifierCase(): boolean;
12
- }
13
- export declare class SimpleKeybinding implements IBaseKeybinding {
14
- readonly ctrlKey: boolean;
15
- readonly shiftKey: boolean;
16
- readonly altKey: boolean;
17
- readonly metaKey: boolean;
18
- readonly keyCode: KeyCode;
19
- constructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, keyCode: KeyCode);
20
- equals(other: SimpleKeybinding): boolean;
21
- getHashCode(): string;
22
- isModifierKey(): boolean;
23
- /**
24
- * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?
25
- */
26
- isDuplicateModifierCase(): boolean;
27
- }
28
- export declare class ScanCodeBinding implements IBaseKeybinding {
29
- readonly ctrlKey: boolean;
30
- readonly shiftKey: boolean;
31
- readonly altKey: boolean;
32
- readonly metaKey: boolean;
33
- readonly scanCode: ScanCode;
34
- constructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, scanCode: ScanCode);
35
- equals(other: ScanCodeBinding): boolean;
36
- /**
37
- * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?
38
- */
39
- isDuplicateModifierCase(): boolean;
40
- }
41
- export declare class ResolvedKeybindingPart {
42
- readonly ctrlKey: boolean;
43
- readonly shiftKey: boolean;
44
- readonly altKey: boolean;
45
- readonly metaKey: boolean;
46
- readonly keyLabel: string | null;
47
- readonly keyAriaLabel: string | null;
48
- constructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, kbLabel: string | null, kbAriaLabel: string | null);
49
- }
50
- export declare type KeybindingModifier = 'ctrl' | 'shift' | 'alt' | 'meta';
51
- /**
52
- * A resolved keybinding. Can be a simple keybinding or a chord keybinding.
53
- */
54
- export declare abstract class ResolvedKeybinding {
55
- /**
56
- * This prints the binding in a format suitable for displaying in the UI.
57
- */
58
- abstract getLabel(): string | null;
59
- /**
60
- * This prints the binding in a format suitable for ARIA.
61
- */
62
- abstract getAriaLabel(): string | null;
63
- /**
64
- * This prints the binding in a format suitable for electron's accelerators.
65
- * See https://github.com/electron/electron/blob/master/docs/api/accelerator.md
66
- */
67
- abstract getElectronAccelerator(): string | null;
68
- /**
69
- * This prints the binding in a format suitable for user settings.
70
- */
71
- abstract getUserSettingsLabel(): string | null;
72
- /**
73
- * Is the user settings label reflecting the label?
74
- */
75
- abstract isWYSIWYG(): boolean;
76
- /**
77
- * Is the binding a chord?
78
- */
79
- abstract isChord(): boolean;
80
- /**
81
- * Returns the parts that comprise of the keybinding.
82
- * Simple keybindings return one element.
83
- */
84
- abstract getParts(): ResolvedKeybindingPart[];
85
- /**
86
- * Returns the parts that should be used for dispatching.
87
- * Returns null for parts consisting of only modifier keys
88
- * @example keybinding "Shift" -> null
89
- * @example keybinding ("D" with shift == true) -> "shift+D"
90
- */
91
- abstract getDispatchParts(): (string | null)[];
92
- /**
93
- * Returns the parts that should be used for dispatching single modifier keys
94
- * Returns null for parts that contain more than one modifier or a regular key.
95
- * @example keybinding "Shift" -> "shift"
96
- * @example keybinding ("D" with shift == true") -> null
97
- */
98
- abstract getSingleModifierDispatchParts(): (KeybindingModifier | null)[];
99
- }
@@ -1,19 +0,0 @@
1
- /**
2
- * A value that is resolved synchronously when it is first needed.
3
- */
4
- export interface Lazy<T> {
5
- hasValue(): boolean;
6
- getValue(): T;
7
- map<R>(f: (x: T) => R): Lazy<R>;
8
- }
9
- export declare class Lazy<T> {
10
- private readonly executor;
11
- private _didRun;
12
- private _value?;
13
- private _error;
14
- constructor(executor: () => T);
15
- /**
16
- * Get the wrapped value without forcing evaluation.
17
- */
18
- get rawValue(): T | undefined;
19
- }
@@ -1,129 +0,0 @@
1
- export interface IDisposableTracker {
2
- /**
3
- * Is called on construction of a disposable.
4
- */
5
- trackDisposable(disposable: IDisposable): void;
6
- /**
7
- * Is called when a disposable is registered as child of another disposable (e.g. {@link DisposableStore}).
8
- * If parent is `null`, the disposable is removed from its former parent.
9
- */
10
- setParent(child: IDisposable, parent: IDisposable | null): void;
11
- /**
12
- * Is called after a disposable is disposed.
13
- */
14
- markAsDisposed(disposable: IDisposable): void;
15
- /**
16
- * Indicates that the given object is a singleton which does not need to be disposed.
17
- */
18
- markAsSingleton(disposable: IDisposable): void;
19
- }
20
- export declare function setDisposableTracker(tracker: IDisposableTracker | null): void;
21
- /**
22
- * Indicates that the given object is a singleton which does not need to be disposed.
23
- */
24
- export declare function markAsSingleton<T extends IDisposable>(singleton: T): T;
25
- export declare class MultiDisposeError extends Error {
26
- readonly errors: any[];
27
- constructor(errors: any[]);
28
- }
29
- export interface IDisposable {
30
- dispose(): void;
31
- }
32
- export declare function isDisposable<E extends object>(thing: E): thing is E & IDisposable;
33
- export declare function dispose<T extends IDisposable>(disposable: T): T;
34
- export declare function dispose<T extends IDisposable>(disposable: T | undefined): T | undefined;
35
- export declare function dispose<T extends IDisposable, A extends IterableIterator<T> = IterableIterator<T>>(disposables: IterableIterator<T>): A;
36
- export declare function dispose<T extends IDisposable>(disposables: Array<T>): Array<T>;
37
- export declare function dispose<T extends IDisposable>(disposables: ReadonlyArray<T>): ReadonlyArray<T>;
38
- export declare function combinedDisposable(...disposables: IDisposable[]): IDisposable;
39
- export declare function toDisposable(fn: () => void): IDisposable;
40
- export declare class DisposableStore implements IDisposable {
41
- static DISABLE_DISPOSED_WARNING: boolean;
42
- private _toDispose;
43
- private _isDisposed;
44
- constructor();
45
- /**
46
- * Dispose of all registered disposables and mark this object as disposed.
47
- *
48
- * Any future disposables added to this object will be disposed of on `add`.
49
- */
50
- dispose(): void;
51
- /**
52
- * Returns `true` if this object has been disposed
53
- */
54
- get isDisposed(): boolean;
55
- /**
56
- * Dispose of all registered disposables but do not mark this object as disposed.
57
- */
58
- clear(): void;
59
- add<T extends IDisposable>(o: T): T;
60
- }
61
- export declare abstract class Disposable implements IDisposable {
62
- static readonly None: Readonly<IDisposable>;
63
- protected readonly _store: DisposableStore;
64
- constructor();
65
- dispose(): void;
66
- protected _register<T extends IDisposable>(o: T): T;
67
- }
68
- /**
69
- * Manages the lifecycle of a disposable value that may be changed.
70
- *
71
- * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can
72
- * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.
73
- */
74
- export declare class MutableDisposable<T extends IDisposable> implements IDisposable {
75
- private _value?;
76
- private _isDisposed;
77
- constructor();
78
- get value(): T | undefined;
79
- set value(value: T | undefined);
80
- clear(): void;
81
- dispose(): void;
82
- /**
83
- * Clears the value, but does not dispose it.
84
- * The old value is returned.
85
- */
86
- clearAndLeak(): T | undefined;
87
- }
88
- export declare class RefCountedDisposable {
89
- private readonly _disposable;
90
- private _counter;
91
- constructor(_disposable: IDisposable);
92
- acquire(): this;
93
- release(): this;
94
- }
95
- /**
96
- * A safe disposable can be `unset` so that a leaked reference (listener)
97
- * can be cut-off.
98
- */
99
- export declare class SafeDisposable implements IDisposable {
100
- dispose: () => void;
101
- unset: () => void;
102
- isset: () => boolean;
103
- constructor();
104
- set(fn: Function): this;
105
- }
106
- export interface IReference<T> extends IDisposable {
107
- readonly object: T;
108
- }
109
- export declare abstract class ReferenceCollection<T> {
110
- private readonly references;
111
- acquire(key: string, ...args: any[]): IReference<T>;
112
- protected abstract createReferencedObject(key: string, ...args: any[]): T;
113
- protected abstract destroyReferencedObject(key: string, object: T): void;
114
- }
115
- /**
116
- * Unwraps a reference collection of promised values. Makes sure
117
- * references are disposed whenever promises get rejected.
118
- */
119
- export declare class AsyncReferenceCollection<T> {
120
- private referenceCollection;
121
- constructor(referenceCollection: ReferenceCollection<Promise<T>>);
122
- acquire(key: string, ...args: any[]): Promise<IReference<T>>;
123
- }
124
- export declare class ImmortalReference<T> implements IReference<T> {
125
- object: T;
126
- constructor(object: T);
127
- dispose(): void;
128
- }
129
- export declare function disposeOnReturn(fn: (store: DisposableStore) => void): void;
@@ -1,15 +0,0 @@
1
- export declare class LinkedList<E> {
2
- private _first;
3
- private _last;
4
- private _size;
5
- get size(): number;
6
- isEmpty(): boolean;
7
- clear(): void;
8
- unshift(element: E): () => void;
9
- push(element: E): () => void;
10
- private _insert;
11
- shift(): E | undefined;
12
- pop(): E | undefined;
13
- private _remove;
14
- [Symbol.iterator](): Iterator<E>;
15
- }