custom-electron-titlebar 3.2.5 → 3.2.9

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 (175) hide show
  1. package/.vscode/launch.json +49 -0
  2. package/.vscode/tasks.json +34 -0
  3. package/README.md +15 -24
  4. package/_config.yml +1 -0
  5. package/{lib → build}/browser/browser.d.ts +0 -0
  6. package/{lib → build}/browser/browser.js +1 -0
  7. package/build/browser/browser.js.map +1 -0
  8. package/{lib → build}/browser/event.d.ts +0 -0
  9. package/{lib → build}/browser/event.js +3 -1
  10. package/build/browser/event.js.map +1 -0
  11. package/{lib → build}/browser/iframe.d.ts +0 -0
  12. package/{lib/base → build}/browser/iframe.js +1 -0
  13. package/build/browser/iframe.js.map +1 -0
  14. package/{lib → build}/browser/keyboardEvent.d.ts +0 -0
  15. package/{lib → build}/browser/keyboardEvent.js +1 -0
  16. package/build/browser/keyboardEvent.js.map +1 -0
  17. package/{lib → build}/browser/mouseEvent.d.ts +0 -0
  18. package/{lib → build}/browser/mouseEvent.js +1 -0
  19. package/build/browser/mouseEvent.js.map +1 -0
  20. package/{lib → build}/common/arrays.d.ts +0 -0
  21. package/{lib → build}/common/arrays.js +1 -0
  22. package/build/common/arrays.js.map +1 -0
  23. package/{lib → build}/common/async.d.ts +0 -0
  24. package/{lib → build}/common/async.js +1 -0
  25. package/build/common/async.js.map +1 -0
  26. package/{lib → build}/common/charCode.d.ts +0 -0
  27. package/{lib/base → build}/common/charCode.js +1 -0
  28. package/build/common/charCode.js.map +1 -0
  29. package/{lib → build}/common/color.d.ts +0 -0
  30. package/{lib → build}/common/color.js +1 -0
  31. package/build/common/color.js.map +1 -0
  32. package/{lib → build}/common/dom.d.ts +0 -0
  33. package/{lib → build}/common/dom.js +17 -14
  34. package/build/common/dom.js.map +1 -0
  35. package/{lib → build}/common/event.d.ts +0 -0
  36. package/{lib → build}/common/event.js +2 -1
  37. package/build/common/event.js.map +1 -0
  38. package/{lib → build}/common/iterator.d.ts +0 -0
  39. package/{lib → build}/common/iterator.js +1 -0
  40. package/build/common/iterator.js.map +1 -0
  41. package/{lib → build}/common/keyCodes.d.ts +0 -0
  42. package/{lib → build}/common/keyCodes.js +1 -0
  43. package/build/common/keyCodes.js.map +1 -0
  44. package/{lib → build}/common/lifecycle.d.ts +0 -0
  45. package/{lib → build}/common/lifecycle.js +1 -0
  46. package/build/common/lifecycle.js.map +1 -0
  47. package/{lib → build}/common/linkedList.d.ts +0 -0
  48. package/{lib → build}/common/linkedList.js +1 -0
  49. package/build/common/linkedList.js.map +1 -0
  50. package/{lib → build}/common/platform.d.ts +0 -0
  51. package/{lib → build}/common/platform.js +1 -0
  52. package/build/common/platform.js.map +1 -0
  53. package/{lib → build}/index.d.ts +0 -0
  54. package/{lib → build}/index.js +1 -0
  55. package/build/index.js.map +1 -0
  56. package/{lib → build}/menu/menu.d.ts +0 -0
  57. package/{lib → build}/menu/menu.js +39 -38
  58. package/build/menu/menu.js.map +1 -0
  59. package/{lib → build}/menu/menuitem.d.ts +10 -2
  60. package/{lib → build}/menu/menuitem.js +71 -29
  61. package/build/menu/menuitem.js.map +1 -0
  62. package/{lib → build}/menubar.d.ts +0 -0
  63. package/{lib → build}/menubar.js +38 -34
  64. package/build/menubar.js.map +1 -0
  65. package/{lib → build}/themebar.d.ts +0 -0
  66. package/{lib → build}/themebar.js +31 -2
  67. package/build/themebar.js.map +1 -0
  68. package/{lib → build}/titlebar.d.ts +0 -0
  69. package/{lib → build}/titlebar.js +72 -59
  70. package/build/titlebar.js.map +1 -0
  71. package/package.json +13 -7
  72. package/lib/base/browser/browser.d.ts +0 -25
  73. package/lib/base/browser/browser.js +0 -117
  74. package/lib/base/browser/canIUse.d.ts +0 -18
  75. package/lib/base/browser/canIUse.js +0 -63
  76. package/lib/base/browser/dom.d.ts +0 -230
  77. package/lib/base/browser/dom.js +0 -1080
  78. package/lib/base/browser/event.d.ts +0 -12
  79. package/lib/base/browser/event.js +0 -28
  80. package/lib/base/browser/iframe.d.ts +0 -33
  81. package/lib/base/browser/keyboardEvent.d.ts +0 -40
  82. package/lib/base/browser/keyboardEvent.js +0 -256
  83. package/lib/base/browser/mouseEvent.d.ts +0 -69
  84. package/lib/base/browser/mouseEvent.js +0 -146
  85. package/lib/base/common/arrays.d.ts +0 -149
  86. package/lib/base/common/arrays.js +0 -549
  87. package/lib/base/common/async.d.ts +0 -259
  88. package/lib/base/common/async.js +0 -728
  89. package/lib/base/common/cancellation.d.ts +0 -29
  90. package/lib/base/common/cancellation.js +0 -114
  91. package/lib/base/common/charCode.d.ts +0 -415
  92. package/lib/base/common/color.d.ts +0 -163
  93. package/lib/base/common/color.js +0 -495
  94. package/lib/base/common/errors.d.ts +0 -65
  95. package/lib/base/common/errors.js +0 -164
  96. package/lib/base/common/event.d.ts +0 -248
  97. package/lib/base/common/event.js +0 -703
  98. package/lib/base/common/functional.d.ts +0 -1
  99. package/lib/base/common/functional.js +0 -21
  100. package/lib/base/common/iterator.d.ts +0 -16
  101. package/lib/base/common/iterator.js +0 -82
  102. package/lib/base/common/keyCodes.d.ts +0 -268
  103. package/lib/base/common/keyCodes.js +0 -292
  104. package/lib/base/common/lifecycle.d.ts +0 -67
  105. package/lib/base/common/lifecycle.js +0 -234
  106. package/lib/base/common/linkedList.d.ts +0 -16
  107. package/lib/base/common/linkedList.js +0 -128
  108. package/lib/base/common/network.d.ts +0 -65
  109. package/lib/base/common/network.js +0 -124
  110. package/lib/base/common/path.d.ts +0 -39
  111. package/lib/base/common/path.js +0 -1407
  112. package/lib/base/common/platform.d.ts +0 -53
  113. package/lib/base/common/platform.js +0 -176
  114. package/lib/base/common/process.d.ts +0 -5
  115. package/lib/base/common/process.js +0 -18
  116. package/lib/base/common/sequence.d.ts +0 -27
  117. package/lib/base/common/sequence.js +0 -32
  118. package/lib/base/common/uri.d.ts +0 -153
  119. package/lib/base/common/uri.js +0 -612
  120. package/lib/browser/iframe.js +0 -109
  121. package/lib/common/charCode.js +0 -6
  122. package/lib/menu.d.ts +0 -53
  123. package/lib/menu.js +0 -532
  124. package/lib/menuitem.d.ts +0 -46
  125. package/lib/menuitem.js +0 -295
  126. package/lib/vs/base/browser/browser.d.ts +0 -25
  127. package/lib/vs/base/browser/browser.js +0 -117
  128. package/lib/vs/base/browser/canIUse.d.ts +0 -18
  129. package/lib/vs/base/browser/canIUse.js +0 -63
  130. package/lib/vs/base/browser/dom.d.ts +0 -230
  131. package/lib/vs/base/browser/dom.js +0 -1080
  132. package/lib/vs/base/browser/event.d.ts +0 -12
  133. package/lib/vs/base/browser/event.js +0 -28
  134. package/lib/vs/base/browser/iframe.d.ts +0 -33
  135. package/lib/vs/base/browser/iframe.js +0 -109
  136. package/lib/vs/base/browser/keyboardEvent.d.ts +0 -40
  137. package/lib/vs/base/browser/keyboardEvent.js +0 -256
  138. package/lib/vs/base/browser/mouseEvent.d.ts +0 -69
  139. package/lib/vs/base/browser/mouseEvent.js +0 -146
  140. package/lib/vs/base/common/arrays.d.ts +0 -149
  141. package/lib/vs/base/common/arrays.js +0 -549
  142. package/lib/vs/base/common/async.d.ts +0 -259
  143. package/lib/vs/base/common/async.js +0 -728
  144. package/lib/vs/base/common/cancellation.d.ts +0 -29
  145. package/lib/vs/base/common/cancellation.js +0 -114
  146. package/lib/vs/base/common/charCode.d.ts +0 -415
  147. package/lib/vs/base/common/charCode.js +0 -6
  148. package/lib/vs/base/common/color.d.ts +0 -163
  149. package/lib/vs/base/common/color.js +0 -495
  150. package/lib/vs/base/common/errors.d.ts +0 -65
  151. package/lib/vs/base/common/errors.js +0 -164
  152. package/lib/vs/base/common/event.d.ts +0 -248
  153. package/lib/vs/base/common/event.js +0 -703
  154. package/lib/vs/base/common/functional.d.ts +0 -1
  155. package/lib/vs/base/common/functional.js +0 -21
  156. package/lib/vs/base/common/iterator.d.ts +0 -16
  157. package/lib/vs/base/common/iterator.js +0 -82
  158. package/lib/vs/base/common/keyCodes.d.ts +0 -268
  159. package/lib/vs/base/common/keyCodes.js +0 -292
  160. package/lib/vs/base/common/lifecycle.d.ts +0 -67
  161. package/lib/vs/base/common/lifecycle.js +0 -234
  162. package/lib/vs/base/common/linkedList.d.ts +0 -16
  163. package/lib/vs/base/common/linkedList.js +0 -128
  164. package/lib/vs/base/common/network.d.ts +0 -65
  165. package/lib/vs/base/common/network.js +0 -124
  166. package/lib/vs/base/common/path.d.ts +0 -39
  167. package/lib/vs/base/common/path.js +0 -1407
  168. package/lib/vs/base/common/platform.d.ts +0 -53
  169. package/lib/vs/base/common/platform.js +0 -176
  170. package/lib/vs/base/common/process.d.ts +0 -5
  171. package/lib/vs/base/common/process.js +0 -18
  172. package/lib/vs/base/common/sequence.d.ts +0 -27
  173. package/lib/vs/base/common/sequence.js +0 -32
  174. package/lib/vs/base/common/uri.d.ts +0 -153
  175. package/lib/vs/base/common/uri.js +0 -612
@@ -1,53 +0,0 @@
1
- export interface IProcessEnvironment {
2
- [key: string]: string;
3
- }
4
- export declare const enum Platform {
5
- Web = 0,
6
- Mac = 1,
7
- Linux = 2,
8
- Windows = 3
9
- }
10
- export declare function PlatformToString(platform: Platform): "Windows" | "Linux" | "Web" | "Mac";
11
- export declare const isWindows: boolean;
12
- export declare const isMacintosh: boolean;
13
- export declare const isLinux: boolean;
14
- export declare const isNative: boolean;
15
- export declare const isWeb: boolean;
16
- export declare const isIOS: boolean;
17
- export declare const platform: Platform;
18
- export declare const userAgent: string;
19
- export declare function isRootUser(): boolean;
20
- /**
21
- * The language used for the user interface. The format of
22
- * the string is all lower case (e.g. zh-tw for Traditional
23
- * Chinese)
24
- */
25
- export declare const language: string;
26
- export declare namespace Language {
27
- function value(): string;
28
- function isDefaultVariant(): boolean;
29
- function isDefault(): boolean;
30
- }
31
- /**
32
- * The OS locale or the locale specified by --locale. The format of
33
- * the string is all lower case (e.g. zh-tw for Traditional
34
- * Chinese). The UI is not necessarily shown in the provided locale.
35
- */
36
- export declare const locale: string;
37
- /**
38
- * The translatios that are available through language packs.
39
- */
40
- export declare const translationsConfigFile: string;
41
- export declare const globals: any;
42
- interface ISetImmediate {
43
- (callback: (...args: any[]) => void): void;
44
- }
45
- export declare const setImmediate: ISetImmediate;
46
- export declare const enum OperatingSystem {
47
- Windows = 1,
48
- Macintosh = 2,
49
- Linux = 3
50
- }
51
- export declare const OS: OperatingSystem;
52
- export declare function isLittleEndian(): boolean;
53
- export {};
@@ -1,176 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Microsoft Corporation. All rights reserved.
4
- * Licensed under the MIT License. See License.txt in the project root for license information.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isLittleEndian = exports.OS = exports.setImmediate = exports.globals = exports.translationsConfigFile = exports.locale = exports.Language = exports.language = exports.isRootUser = exports.userAgent = exports.platform = exports.isIOS = exports.isWeb = exports.isNative = exports.isLinux = exports.isMacintosh = exports.isWindows = exports.PlatformToString = void 0;
8
- const LANGUAGE_DEFAULT = 'en';
9
- let _isWindows = false;
10
- let _isMacintosh = false;
11
- let _isLinux = false;
12
- let _isNative = false;
13
- let _isWeb = false;
14
- let _isIOS = false;
15
- let _locale = undefined;
16
- let _language = LANGUAGE_DEFAULT;
17
- let _translationsConfigFile = undefined;
18
- let _userAgent = undefined;
19
- const isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer');
20
- // OS detection
21
- if (typeof navigator === 'object' && !isElectronRenderer) {
22
- _userAgent = navigator.userAgent;
23
- _isWindows = _userAgent.indexOf('Windows') >= 0;
24
- _isMacintosh = _userAgent.indexOf('Macintosh') >= 0;
25
- _isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;
26
- _isLinux = _userAgent.indexOf('Linux') >= 0;
27
- _isWeb = true;
28
- _locale = navigator.language;
29
- _language = _locale;
30
- }
31
- else if (typeof process === 'object') {
32
- // _isWindows = (process.platform === 'darwin'); // uncomment this and comment the next 2 lines to test it on macos
33
- _isWindows = (process.platform === 'win32');
34
- _isMacintosh = (process.platform === 'darwin');
35
- _isLinux = (process.platform === 'linux');
36
- _locale = LANGUAGE_DEFAULT;
37
- _language = LANGUAGE_DEFAULT;
38
- const rawNlsConfig = process.env['VSCODE_NLS_CONFIG'];
39
- if (rawNlsConfig) {
40
- try {
41
- const nlsConfig = JSON.parse(rawNlsConfig);
42
- const resolved = nlsConfig.availableLanguages['*'];
43
- _locale = nlsConfig.locale;
44
- // VSCode's default language is 'en'
45
- _language = resolved ? resolved : LANGUAGE_DEFAULT;
46
- _translationsConfigFile = nlsConfig._translationsConfigFile;
47
- }
48
- catch (e) {
49
- }
50
- }
51
- _isNative = true;
52
- }
53
- function PlatformToString(platform) {
54
- switch (platform) {
55
- case 0 /* Web */: return 'Web';
56
- case 1 /* Mac */: return 'Mac';
57
- case 2 /* Linux */: return 'Linux';
58
- case 3 /* Windows */: return 'Windows';
59
- }
60
- }
61
- exports.PlatformToString = PlatformToString;
62
- let _platform = 0 /* Web */;
63
- if (_isMacintosh) {
64
- _platform = 1 /* Mac */;
65
- }
66
- else if (_isWindows) {
67
- _platform = 3 /* Windows */;
68
- }
69
- else if (_isLinux) {
70
- _platform = 2 /* Linux */;
71
- }
72
- // use the first two lines for development on MacOS only.
73
- // export const isWindows = true || _isWindows;
74
- // export const isMacintosh = false && _isMacintosh;
75
- exports.isWindows = _isWindows;
76
- exports.isMacintosh = _isMacintosh;
77
- exports.isLinux = _isLinux;
78
- exports.isNative = _isNative;
79
- exports.isWeb = _isWeb;
80
- exports.isIOS = _isIOS;
81
- exports.platform = _platform;
82
- exports.userAgent = _userAgent;
83
- function isRootUser() {
84
- return _isNative && !_isWindows && (process.getuid() === 0);
85
- }
86
- exports.isRootUser = isRootUser;
87
- /**
88
- * The language used for the user interface. The format of
89
- * the string is all lower case (e.g. zh-tw for Traditional
90
- * Chinese)
91
- */
92
- exports.language = _language;
93
- var Language;
94
- (function (Language) {
95
- function value() {
96
- return exports.language;
97
- }
98
- Language.value = value;
99
- function isDefaultVariant() {
100
- if (exports.language.length === 2) {
101
- return exports.language === 'en';
102
- }
103
- else if (exports.language.length >= 3) {
104
- return exports.language[0] === 'e' && exports.language[1] === 'n' && exports.language[2] === '-';
105
- }
106
- else {
107
- return false;
108
- }
109
- }
110
- Language.isDefaultVariant = isDefaultVariant;
111
- function isDefault() {
112
- return exports.language === 'en';
113
- }
114
- Language.isDefault = isDefault;
115
- })(Language = exports.Language || (exports.Language = {}));
116
- /**
117
- * The OS locale or the locale specified by --locale. The format of
118
- * the string is all lower case (e.g. zh-tw for Traditional
119
- * Chinese). The UI is not necessarily shown in the provided locale.
120
- */
121
- exports.locale = _locale;
122
- /**
123
- * The translatios that are available through language packs.
124
- */
125
- exports.translationsConfigFile = _translationsConfigFile;
126
- const _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {});
127
- exports.globals = _globals;
128
- exports.setImmediate = (function defineSetImmediate() {
129
- if (exports.globals.setImmediate) {
130
- return exports.globals.setImmediate.bind(exports.globals);
131
- }
132
- if (typeof exports.globals.postMessage === 'function' && !exports.globals.importScripts) {
133
- let pending = [];
134
- exports.globals.addEventListener('message', (e) => {
135
- if (e.data && e.data.vscodeSetImmediateId) {
136
- for (let i = 0, len = pending.length; i < len; i++) {
137
- const candidate = pending[i];
138
- if (candidate.id === e.data.vscodeSetImmediateId) {
139
- pending.splice(i, 1);
140
- candidate.callback();
141
- return;
142
- }
143
- }
144
- }
145
- });
146
- let lastId = 0;
147
- return (callback) => {
148
- const myId = ++lastId;
149
- pending.push({
150
- id: myId,
151
- callback: callback
152
- });
153
- exports.globals.postMessage({ vscodeSetImmediateId: myId }, '*');
154
- };
155
- }
156
- if (typeof process !== 'undefined' && typeof process.nextTick === 'function') {
157
- return process.nextTick.bind(process);
158
- }
159
- const _promise = Promise.resolve();
160
- return (callback) => _promise.then(callback);
161
- })();
162
- exports.OS = (_isMacintosh || _isIOS ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */));
163
- let _isLittleEndian = true;
164
- let _isLittleEndianComputed = false;
165
- function isLittleEndian() {
166
- if (!_isLittleEndianComputed) {
167
- _isLittleEndianComputed = true;
168
- const test = new Uint8Array(2);
169
- test[0] = 1;
170
- test[1] = 2;
171
- const view = new Uint16Array(test.buffer);
172
- _isLittleEndian = (view[0] === (2 << 8) + 1);
173
- }
174
- return _isLittleEndian;
175
- }
176
- exports.isLittleEndian = isLittleEndian;
@@ -1,5 +0,0 @@
1
- import { IProcessEnvironment } from 'vs/base/common/platform';
2
- export declare const cwd: () => string;
3
- export declare const env: IProcessEnvironment;
4
- export declare const platform: string;
5
- export declare const nextTick: (callback: (...args: any[]) => void) => void;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Microsoft Corporation. All rights reserved.
4
- * Licensed under the MIT License. See License.txt in the project root for license information.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.nextTick = exports.platform = exports.env = exports.cwd = void 0;
8
- const platform_1 = require("vs/base/common/platform");
9
- const safeProcess = (typeof process === 'undefined') ? {
10
- cwd() { return '/'; },
11
- env: Object.create(null),
12
- get platform() { return platform_1.isWindows ? 'win32' : platform_1.isMacintosh ? 'darwin' : 'linux'; },
13
- nextTick(callback) { return platform_1.setImmediate(callback); }
14
- } : process;
15
- exports.cwd = safeProcess.cwd;
16
- exports.env = safeProcess.env;
17
- exports.platform = safeProcess.platform;
18
- exports.nextTick = safeProcess.nextTick;
@@ -1,27 +0,0 @@
1
- import { Event } from 'vs/base/common/event';
2
- export interface ISplice<T> {
3
- readonly start: number;
4
- readonly deleteCount: number;
5
- readonly toInsert: T[];
6
- }
7
- export interface ISpliceable<T> {
8
- splice(start: number, deleteCount: number, toInsert: T[]): void;
9
- }
10
- export interface ISequence<T> {
11
- readonly elements: T[];
12
- readonly onDidSplice: Event<ISplice<T>>;
13
- }
14
- export declare class Sequence<T> implements ISequence<T>, ISpliceable<T> {
15
- readonly elements: T[];
16
- private readonly _onDidSplice;
17
- readonly onDidSplice: Event<ISplice<T>>;
18
- splice(start: number, deleteCount: number, toInsert?: T[]): void;
19
- }
20
- export declare class SimpleSequence<T> implements ISequence<T> {
21
- private _elements;
22
- get elements(): T[];
23
- readonly onDidSplice: Event<ISplice<T>>;
24
- private disposable;
25
- constructor(elements: T[], onDidAdd: Event<T>, onDidRemove: Event<T>);
26
- dispose(): void;
27
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Microsoft Corporation. All rights reserved.
4
- * Licensed under the MIT License. See License.txt in the project root for license information.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SimpleSequence = exports.Sequence = void 0;
8
- const event_1 = require("vs/base/common/event");
9
- class Sequence {
10
- constructor() {
11
- this.elements = [];
12
- this._onDidSplice = new event_1.Emitter();
13
- this.onDidSplice = this._onDidSplice.event;
14
- }
15
- splice(start, deleteCount, toInsert = []) {
16
- this.elements.splice(start, deleteCount, ...toInsert);
17
- this._onDidSplice.fire({ start, deleteCount, toInsert });
18
- }
19
- }
20
- exports.Sequence = Sequence;
21
- class SimpleSequence {
22
- constructor(elements, onDidAdd, onDidRemove) {
23
- this._elements = [...elements];
24
- this.onDidSplice = event_1.Event.any(event_1.Event.map(onDidAdd, e => ({ start: this.elements.length, deleteCount: 0, toInsert: [e] })), event_1.Event.map(event_1.Event.filter(event_1.Event.map(onDidRemove, e => this.elements.indexOf(e)), i => i > -1), i => ({ start: i, deleteCount: 1, toInsert: [] })));
25
- this.disposable = this.onDidSplice(({ start, deleteCount, toInsert }) => this._elements.splice(start, deleteCount, ...toInsert));
26
- }
27
- get elements() { return this._elements; }
28
- dispose() {
29
- this.disposable.dispose();
30
- }
31
- }
32
- exports.SimpleSequence = SimpleSequence;
@@ -1,153 +0,0 @@
1
- /**
2
- * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.
3
- * This class is a simple parser which creates the basic component parts
4
- * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
5
- * and encoding.
6
- *
7
- * ```txt
8
- * foo://example.com:8042/over/there?name=ferret#nose
9
- * \_/ \______________/\_________/ \_________/ \__/
10
- * | | | | |
11
- * scheme authority path query fragment
12
- * | _____________________|__
13
- * / \ / \
14
- * urn:example:animal:ferret:nose
15
- * ```
16
- */
17
- export declare class URI implements UriComponents {
18
- static isUri(thing: any): thing is URI;
19
- /**
20
- * scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'.
21
- * The part before the first colon.
22
- */
23
- readonly scheme: string;
24
- /**
25
- * authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'.
26
- * The part between the first double slashes and the next slash.
27
- */
28
- readonly authority: string;
29
- /**
30
- * path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'.
31
- */
32
- readonly path: string;
33
- /**
34
- * query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'.
35
- */
36
- readonly query: string;
37
- /**
38
- * fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'.
39
- */
40
- readonly fragment: string;
41
- /**
42
- * @internal
43
- */
44
- protected constructor(scheme: string, authority?: string, path?: string, query?: string, fragment?: string, _strict?: boolean);
45
- /**
46
- * @internal
47
- */
48
- protected constructor(components: UriComponents);
49
- /**
50
- * Returns a string representing the corresponding file system path of this URI.
51
- * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the
52
- * platform specific path separator.
53
- *
54
- * * Will *not* validate the path for invalid characters and semantics.
55
- * * Will *not* look at the scheme of this URI.
56
- * * The result shall *not* be used for display purposes but for accessing a file on disk.
57
- *
58
- *
59
- * The *difference* to `URI#path` is the use of the platform specific separator and the handling
60
- * of UNC paths. See the below sample of a file-uri with an authority (UNC path).
61
- *
62
- * ```ts
63
- const u = URI.parse('file://server/c$/folder/file.txt')
64
- u.authority === 'server'
65
- u.path === '/shares/c$/file.txt'
66
- u.fsPath === '\\server\c$\folder\file.txt'
67
- ```
68
- *
69
- * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,
70
- * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working
71
- * with URIs that represent files on disk (`file` scheme).
72
- */
73
- get fsPath(): string;
74
- with(change: {
75
- scheme?: string;
76
- authority?: string | null;
77
- path?: string | null;
78
- query?: string | null;
79
- fragment?: string | null;
80
- }): URI;
81
- /**
82
- * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`,
83
- * `file:///usr/home`, or `scheme:with/path`.
84
- *
85
- * @param value A string which represents an URI (see `URI#toString`).
86
- */
87
- static parse(value: string, _strict?: boolean): URI;
88
- /**
89
- * Creates a new URI from a file system path, e.g. `c:\my\files`,
90
- * `/usr/home`, or `\\server\share\some\path`.
91
- *
92
- * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument
93
- * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**
94
- * `URI.parse('file://' + path)` because the path might contain characters that are
95
- * interpreted (# and ?). See the following sample:
96
- * ```ts
97
- const good = URI.file('/coding/c#/project1');
98
- good.scheme === 'file';
99
- good.path === '/coding/c#/project1';
100
- good.fragment === '';
101
- const bad = URI.parse('file://' + '/coding/c#/project1');
102
- bad.scheme === 'file';
103
- bad.path === '/coding/c'; // path is now broken
104
- bad.fragment === '/project1';
105
- ```
106
- *
107
- * @param path A file system path (see `URI#fsPath`)
108
- */
109
- static file(path: string): URI;
110
- static from(components: {
111
- scheme: string;
112
- authority?: string;
113
- path?: string;
114
- query?: string;
115
- fragment?: string;
116
- }): URI;
117
- /**
118
- * Join a URI path with path fragments and normalizes the resulting path.
119
- *
120
- * @param uri The input URI.
121
- * @param pathFragment The path fragment to add to the URI path.
122
- * @returns The resulting URI.
123
- */
124
- static joinPath(uri: URI, ...pathFragment: string[]): URI;
125
- /**
126
- * Creates a string representation for this URI. It's guaranteed that calling
127
- * `URI.parse` with the result of this function creates an URI which is equal
128
- * to this URI.
129
- *
130
- * * The result shall *not* be used for display purposes but for externalization or transport.
131
- * * The result will be encoded using the percentage encoding and encoding happens mostly
132
- * ignore the scheme-specific encoding rules.
133
- *
134
- * @param skipEncoding Do not encode the result, default is `false`
135
- */
136
- toString(skipEncoding?: boolean): string;
137
- toJSON(): UriComponents;
138
- static revive(data: UriComponents | URI): URI;
139
- static revive(data: UriComponents | URI | undefined): URI | undefined;
140
- static revive(data: UriComponents | URI | null): URI | null;
141
- static revive(data: UriComponents | URI | undefined | null): URI | undefined | null;
142
- }
143
- export interface UriComponents {
144
- scheme: string;
145
- authority: string;
146
- path: string;
147
- query: string;
148
- fragment: string;
149
- }
150
- /**
151
- * Compute `fsPath` for the given uri
152
- */
153
- export declare function uriToFsPath(uri: URI, keepDriveLetterCasing: boolean): string;