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.
- package/.vscode/launch.json +49 -0
- package/.vscode/tasks.json +34 -0
- package/README.md +15 -24
- package/_config.yml +1 -0
- package/{lib → build}/browser/browser.d.ts +0 -0
- package/{lib → build}/browser/browser.js +1 -0
- package/build/browser/browser.js.map +1 -0
- package/{lib → build}/browser/event.d.ts +0 -0
- package/{lib → build}/browser/event.js +3 -1
- package/build/browser/event.js.map +1 -0
- package/{lib → build}/browser/iframe.d.ts +0 -0
- package/{lib/base → build}/browser/iframe.js +1 -0
- package/build/browser/iframe.js.map +1 -0
- package/{lib → build}/browser/keyboardEvent.d.ts +0 -0
- package/{lib → build}/browser/keyboardEvent.js +1 -0
- package/build/browser/keyboardEvent.js.map +1 -0
- package/{lib → build}/browser/mouseEvent.d.ts +0 -0
- package/{lib → build}/browser/mouseEvent.js +1 -0
- package/build/browser/mouseEvent.js.map +1 -0
- package/{lib → build}/common/arrays.d.ts +0 -0
- package/{lib → build}/common/arrays.js +1 -0
- package/build/common/arrays.js.map +1 -0
- package/{lib → build}/common/async.d.ts +0 -0
- package/{lib → build}/common/async.js +1 -0
- package/build/common/async.js.map +1 -0
- package/{lib → build}/common/charCode.d.ts +0 -0
- package/{lib/base → build}/common/charCode.js +1 -0
- package/build/common/charCode.js.map +1 -0
- package/{lib → build}/common/color.d.ts +0 -0
- package/{lib → build}/common/color.js +1 -0
- package/build/common/color.js.map +1 -0
- package/{lib → build}/common/dom.d.ts +0 -0
- package/{lib → build}/common/dom.js +17 -14
- package/build/common/dom.js.map +1 -0
- package/{lib → build}/common/event.d.ts +0 -0
- package/{lib → build}/common/event.js +2 -1
- package/build/common/event.js.map +1 -0
- package/{lib → build}/common/iterator.d.ts +0 -0
- package/{lib → build}/common/iterator.js +1 -0
- package/build/common/iterator.js.map +1 -0
- package/{lib → build}/common/keyCodes.d.ts +0 -0
- package/{lib → build}/common/keyCodes.js +1 -0
- package/build/common/keyCodes.js.map +1 -0
- package/{lib → build}/common/lifecycle.d.ts +0 -0
- package/{lib → build}/common/lifecycle.js +1 -0
- package/build/common/lifecycle.js.map +1 -0
- package/{lib → build}/common/linkedList.d.ts +0 -0
- package/{lib → build}/common/linkedList.js +1 -0
- package/build/common/linkedList.js.map +1 -0
- package/{lib → build}/common/platform.d.ts +0 -0
- package/{lib → build}/common/platform.js +1 -0
- package/build/common/platform.js.map +1 -0
- package/{lib → build}/index.d.ts +0 -0
- package/{lib → build}/index.js +1 -0
- package/build/index.js.map +1 -0
- package/{lib → build}/menu/menu.d.ts +0 -0
- package/{lib → build}/menu/menu.js +39 -38
- package/build/menu/menu.js.map +1 -0
- package/{lib → build}/menu/menuitem.d.ts +10 -2
- package/{lib → build}/menu/menuitem.js +71 -29
- package/build/menu/menuitem.js.map +1 -0
- package/{lib → build}/menubar.d.ts +0 -0
- package/{lib → build}/menubar.js +38 -34
- package/build/menubar.js.map +1 -0
- package/{lib → build}/themebar.d.ts +0 -0
- package/{lib → build}/themebar.js +31 -2
- package/build/themebar.js.map +1 -0
- package/{lib → build}/titlebar.d.ts +0 -0
- package/{lib → build}/titlebar.js +72 -59
- package/build/titlebar.js.map +1 -0
- package/package.json +13 -7
- package/lib/base/browser/browser.d.ts +0 -25
- package/lib/base/browser/browser.js +0 -117
- package/lib/base/browser/canIUse.d.ts +0 -18
- package/lib/base/browser/canIUse.js +0 -63
- package/lib/base/browser/dom.d.ts +0 -230
- package/lib/base/browser/dom.js +0 -1080
- package/lib/base/browser/event.d.ts +0 -12
- package/lib/base/browser/event.js +0 -28
- package/lib/base/browser/iframe.d.ts +0 -33
- package/lib/base/browser/keyboardEvent.d.ts +0 -40
- package/lib/base/browser/keyboardEvent.js +0 -256
- package/lib/base/browser/mouseEvent.d.ts +0 -69
- package/lib/base/browser/mouseEvent.js +0 -146
- package/lib/base/common/arrays.d.ts +0 -149
- package/lib/base/common/arrays.js +0 -549
- package/lib/base/common/async.d.ts +0 -259
- package/lib/base/common/async.js +0 -728
- package/lib/base/common/cancellation.d.ts +0 -29
- package/lib/base/common/cancellation.js +0 -114
- package/lib/base/common/charCode.d.ts +0 -415
- package/lib/base/common/color.d.ts +0 -163
- package/lib/base/common/color.js +0 -495
- package/lib/base/common/errors.d.ts +0 -65
- package/lib/base/common/errors.js +0 -164
- package/lib/base/common/event.d.ts +0 -248
- package/lib/base/common/event.js +0 -703
- package/lib/base/common/functional.d.ts +0 -1
- package/lib/base/common/functional.js +0 -21
- package/lib/base/common/iterator.d.ts +0 -16
- package/lib/base/common/iterator.js +0 -82
- package/lib/base/common/keyCodes.d.ts +0 -268
- package/lib/base/common/keyCodes.js +0 -292
- package/lib/base/common/lifecycle.d.ts +0 -67
- package/lib/base/common/lifecycle.js +0 -234
- package/lib/base/common/linkedList.d.ts +0 -16
- package/lib/base/common/linkedList.js +0 -128
- package/lib/base/common/network.d.ts +0 -65
- package/lib/base/common/network.js +0 -124
- package/lib/base/common/path.d.ts +0 -39
- package/lib/base/common/path.js +0 -1407
- package/lib/base/common/platform.d.ts +0 -53
- package/lib/base/common/platform.js +0 -176
- package/lib/base/common/process.d.ts +0 -5
- package/lib/base/common/process.js +0 -18
- package/lib/base/common/sequence.d.ts +0 -27
- package/lib/base/common/sequence.js +0 -32
- package/lib/base/common/uri.d.ts +0 -153
- package/lib/base/common/uri.js +0 -612
- package/lib/browser/iframe.js +0 -109
- package/lib/common/charCode.js +0 -6
- package/lib/menu.d.ts +0 -53
- package/lib/menu.js +0 -532
- package/lib/menuitem.d.ts +0 -46
- package/lib/menuitem.js +0 -295
- package/lib/vs/base/browser/browser.d.ts +0 -25
- package/lib/vs/base/browser/browser.js +0 -117
- package/lib/vs/base/browser/canIUse.d.ts +0 -18
- package/lib/vs/base/browser/canIUse.js +0 -63
- package/lib/vs/base/browser/dom.d.ts +0 -230
- package/lib/vs/base/browser/dom.js +0 -1080
- package/lib/vs/base/browser/event.d.ts +0 -12
- package/lib/vs/base/browser/event.js +0 -28
- package/lib/vs/base/browser/iframe.d.ts +0 -33
- package/lib/vs/base/browser/iframe.js +0 -109
- package/lib/vs/base/browser/keyboardEvent.d.ts +0 -40
- package/lib/vs/base/browser/keyboardEvent.js +0 -256
- package/lib/vs/base/browser/mouseEvent.d.ts +0 -69
- package/lib/vs/base/browser/mouseEvent.js +0 -146
- package/lib/vs/base/common/arrays.d.ts +0 -149
- package/lib/vs/base/common/arrays.js +0 -549
- package/lib/vs/base/common/async.d.ts +0 -259
- package/lib/vs/base/common/async.js +0 -728
- package/lib/vs/base/common/cancellation.d.ts +0 -29
- package/lib/vs/base/common/cancellation.js +0 -114
- package/lib/vs/base/common/charCode.d.ts +0 -415
- package/lib/vs/base/common/charCode.js +0 -6
- package/lib/vs/base/common/color.d.ts +0 -163
- package/lib/vs/base/common/color.js +0 -495
- package/lib/vs/base/common/errors.d.ts +0 -65
- package/lib/vs/base/common/errors.js +0 -164
- package/lib/vs/base/common/event.d.ts +0 -248
- package/lib/vs/base/common/event.js +0 -703
- package/lib/vs/base/common/functional.d.ts +0 -1
- package/lib/vs/base/common/functional.js +0 -21
- package/lib/vs/base/common/iterator.d.ts +0 -16
- package/lib/vs/base/common/iterator.js +0 -82
- package/lib/vs/base/common/keyCodes.d.ts +0 -268
- package/lib/vs/base/common/keyCodes.js +0 -292
- package/lib/vs/base/common/lifecycle.d.ts +0 -67
- package/lib/vs/base/common/lifecycle.js +0 -234
- package/lib/vs/base/common/linkedList.d.ts +0 -16
- package/lib/vs/base/common/linkedList.js +0 -128
- package/lib/vs/base/common/network.d.ts +0 -65
- package/lib/vs/base/common/network.js +0 -124
- package/lib/vs/base/common/path.d.ts +0 -39
- package/lib/vs/base/common/path.js +0 -1407
- package/lib/vs/base/common/platform.d.ts +0 -53
- package/lib/vs/base/common/platform.js +0 -176
- package/lib/vs/base/common/process.d.ts +0 -5
- package/lib/vs/base/common/process.js +0 -18
- package/lib/vs/base/common/sequence.d.ts +0 -27
- package/lib/vs/base/common/sequence.js +0 -32
- package/lib/vs/base/common/uri.d.ts +0 -153
- 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;
|