@adminide-stack/extension-api 12.0.4-alpha.92 → 13.0.1-alpha.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.
- package/lib/connections/jsonrpc2/connection.js +0 -10
- package/lib/connections/jsonrpc2/connection.js.map +1 -1
- package/lib/connections/jsonrpc2/events.js.map +1 -1
- package/lib/connections/jsonrpc2/linkedMap.js.map +1 -1
- package/lib/connections/jsonrpc2/messages.js.map +1 -1
- package/lib/connections/jsonrpc2/test-helper.js.map +1 -1
- package/lib/connections/jsonrpc2/trace.js.map +1 -1
- package/lib/connections/jsonrpc2/transport.js.map +1 -1
- package/lib/connections/jsonrpc2/transports/webWorker.js.map +1 -1
- package/lib/connections/proxy/proxy.js.map +1 -1
- package/lib/connections/remote-rpc/browser-remote-rpc.d.ts +3 -1
- package/lib/connections/remote-rpc/browser-remote-rpc.js +26 -19
- package/lib/connections/remote-rpc/browser-remote-rpc.js.map +1 -1
- package/lib/connections/remote-rpc/rxjs-websockets.js.map +1 -1
- package/lib/constants/action-types.d.ts +4 -0
- package/lib/constants/action-types.js +5 -1
- package/lib/constants/action-types.js.map +1 -1
- package/lib/constants/types.js.map +1 -1
- package/lib/core/expr/evaluator.js.map +1 -1
- package/lib/core/expr/lexer.js.map +1 -1
- package/lib/core/expr/parser.js.map +1 -1
- package/lib/core/types/ext-host-types.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/interfaces/command.d.ts +5 -1
- package/lib/interfaces/contributions/contribution.js.map +1 -1
- package/lib/interfaces/ext-services/ai-services.d.ts +2 -11
- package/lib/interfaces/ext-services/code-javascript-service.d.ts +9 -0
- package/lib/interfaces/ext-services/index.d.ts +1 -0
- package/lib/interfaces/model.js.map +1 -1
- package/lib/interfaces/platform-context.d.ts +7 -0
- package/lib/interfaces/text-document.js.map +1 -1
- package/lib/interfaces/webview/webview.js.map +1 -1
- package/lib/middlewares/extensionController.js.map +1 -1
- package/lib/protocol/client.protocol.d.ts +85 -15
- package/lib/protocol/client.protocol.js.map +1 -1
- package/lib/protocol/common.protocol.js.map +1 -1
- package/lib/protocol/editor-missing-types.js.map +1 -1
- package/lib/protocol/proxy-identifier.js.map +1 -1
- package/lib/protocol/rpc-logger.js.map +1 -1
- package/lib/protocol/rpc-protocol.js +10 -4
- package/lib/protocol/rpc-protocol.js.map +1 -1
- package/lib/protocol/server.protocol.d.ts +4 -4
- package/lib/protocol/server.protocol.js.map +1 -1
- package/lib/protocol/shared/editor.js.map +1 -1
- package/lib/protocol/temporary-types.js.map +1 -1
- package/lib/protocol/utils/lazy-promise.js.map +1 -1
- package/lib/react/components/view-component/ViewComponent.js.map +1 -1
- package/lib/react/useExtensionController.js +1 -1
- package/lib/react/useExtensionController.js.map +1 -1
- package/lib/services/code/index.d.ts +1 -0
- package/lib/services/code/javascript/autocomplete-demo.d.ts +49 -0
- package/lib/services/code/javascript/code-javascript-service.d.ts +100 -0
- package/lib/services/code/javascript/code-javascript-service.js +193 -0
- package/lib/services/code/javascript/code-javascript-service.js.map +1 -0
- package/lib/services/code/javascript/handler/evaluate.d.ts +14 -0
- package/lib/services/code/javascript/index.d.ts +9 -0
- package/lib/services/code/javascript/jslibrary/autocomplete/definitions/base64-js.json.js +13 -0
- package/lib/services/code/javascript/jslibrary/autocomplete/definitions/base64-js.json.js.map +1 -0
- package/lib/services/code/javascript/jslibrary/autocomplete/definitions/browser.json.js +441 -0
- package/lib/services/code/javascript/jslibrary/autocomplete/definitions/browser.json.js.map +1 -0
- package/lib/services/code/javascript/jslibrary/autocomplete/definitions/ecmascript.json.js +1973 -0
- package/lib/services/code/javascript/jslibrary/autocomplete/definitions/ecmascript.json.js.map +1 -0
- package/lib/services/code/javascript/jslibrary/autocomplete/definitions/lodash.json.js +1546 -0
- package/lib/services/code/javascript/jslibrary/autocomplete/definitions/lodash.json.js.map +1 -0
- package/lib/services/code/javascript/jslibrary/autocomplete/index.d.ts +45 -0
- package/lib/services/code/javascript/jslibrary/autocomplete/index.js +56 -0
- package/lib/services/code/javascript/jslibrary/autocomplete/index.js.map +1 -0
- package/lib/services/code/javascript/jslibrary/autocomplete-manager.d.ts +94 -0
- package/lib/services/code/javascript/jslibrary/autocomplete-manager.js +249 -0
- package/lib/services/code/javascript/jslibrary/autocomplete-manager.js.map +1 -0
- package/lib/services/code/javascript/jslibrary/definitions.d.ts +465 -0
- package/lib/services/code/javascript/jslibrary/index.d.ts +4 -0
- package/lib/services/code/javascript/jslibrary/index.js +14 -0
- package/lib/services/code/javascript/jslibrary/index.js.map +1 -0
- package/lib/services/code/javascript/jslibrary/library-manager.d.ts +53 -0
- package/lib/services/code/javascript/jslibrary/library-manager.js +65 -0
- package/lib/services/code/javascript/jslibrary/library-manager.js.map +1 -0
- package/lib/services/code/javascript/jslibrary/reset.d.ts +2 -0
- package/lib/services/code/javascript/jslibrary/reset.js +33 -0
- package/lib/services/code/javascript/jslibrary/reset.js.map +1 -0
- package/lib/services/code/javascript/utils/dom.d.ts +4 -0
- package/lib/services/code/javascript/utils/dom.js +138 -0
- package/lib/services/code/javascript/utils/dom.js.map +1 -0
- package/lib/services/code/javascript/utils/library-utils.d.ts +12 -0
- package/lib/services/code/javascript/utils/library-utils.js +76 -0
- package/lib/services/code/javascript/utils/library-utils.js.map +1 -0
- package/lib/services/code/javascript/utils/messages.d.ts +21 -0
- package/lib/services/code/javascript/utils/messages.js +25 -0
- package/lib/services/code/javascript/utils/messages.js.map +1 -0
- package/lib/services/code/javascript/utils/tern-definitions.d.ts +4 -0
- package/lib/services/code/javascript/utils/tern-definitions.js +75 -0
- package/lib/services/code/javascript/utils/tern-definitions.js.map +1 -0
- package/lib/services/code/javascript/utils/types.d.ts +26 -0
- package/lib/services/code/javascript/utils/types.js +16 -0
- package/lib/services/code/javascript/utils/types.js.map +1 -0
- package/lib/utils/abortable-rx.js.map +1 -1
- package/lib/utils/errors.js.map +1 -1
- package/lib/utils/extensions.d.ts +11 -0
- package/lib/utils/extensions.js +38 -1
- package/lib/utils/extensions.js.map +1 -1
- package/lib/utils/helper.test.js.map +1 -1
- package/lib/utils/paths-util.js.map +1 -1
- package/lib/utils/rxjs/combineLatestOrDefault.js.map +1 -1
- package/lib/utils/util.js.map +1 -1
- package/package.json +6 -5
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Predefined Tern definitions for JavaScript libraries and built-in objects
|
|
3
|
+
*/
|
|
4
|
+
export declare const TERN_DEFINITIONS: {
|
|
5
|
+
readonly 'base64-js': {
|
|
6
|
+
readonly '!name': "base64-js";
|
|
7
|
+
readonly btoa: {
|
|
8
|
+
readonly '!doc': "creates a base-64 encoded ASCII string from a \"string\" of binary data";
|
|
9
|
+
readonly '!type': "fn(aString: string) -> string";
|
|
10
|
+
};
|
|
11
|
+
readonly atob: {
|
|
12
|
+
readonly '!doc': "decodes a base64 encoded string";
|
|
13
|
+
readonly '!type': "fn(bString: string) -> string";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
readonly browser: {
|
|
17
|
+
readonly '!name': "browser";
|
|
18
|
+
readonly console: {
|
|
19
|
+
readonly assert: {
|
|
20
|
+
readonly '!type': "fn(assertion: bool, text: string)";
|
|
21
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/Web/API/Console.assert";
|
|
22
|
+
readonly '!doc': "Writes an error message to the console if the assertion is false.";
|
|
23
|
+
};
|
|
24
|
+
readonly clear: {
|
|
25
|
+
readonly '!type': "fn()";
|
|
26
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/Web/API/Console/clear";
|
|
27
|
+
readonly '!doc': "Clear the console.";
|
|
28
|
+
};
|
|
29
|
+
readonly count: {
|
|
30
|
+
readonly '!type': "fn(label?: string)";
|
|
31
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/Web/API/Console.count";
|
|
32
|
+
readonly '!doc': "Logs the number of times that this particular call to count() has been called.";
|
|
33
|
+
};
|
|
34
|
+
readonly debug: "console.log";
|
|
35
|
+
readonly dir: {
|
|
36
|
+
readonly '!type': "fn(object: ?)";
|
|
37
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/Web/API/Console.dir";
|
|
38
|
+
readonly '!doc': "Displays an interactive list of the properties of the specified JavaScript object.";
|
|
39
|
+
};
|
|
40
|
+
readonly error: {
|
|
41
|
+
readonly '!type': "fn(...msg: ?)";
|
|
42
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/DOM/console.error";
|
|
43
|
+
readonly '!doc': "Outputs an error message to the Web Console.";
|
|
44
|
+
};
|
|
45
|
+
readonly group: {
|
|
46
|
+
readonly '!type': "fn(label?: string)";
|
|
47
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/Web/API/Console.group";
|
|
48
|
+
readonly '!doc': "Creates a new inline group in the Web Console log.";
|
|
49
|
+
};
|
|
50
|
+
readonly groupCollapsed: {
|
|
51
|
+
readonly '!type': "fn(label?: string)";
|
|
52
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/Web/API/Console.groupCollapsed";
|
|
53
|
+
readonly '!doc': "Creates a new inline group in the Web Console log.";
|
|
54
|
+
};
|
|
55
|
+
readonly groupEnd: {
|
|
56
|
+
readonly '!type': "fn()";
|
|
57
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/Web/API/Console.groupEnd";
|
|
58
|
+
readonly '!doc': "Exits the current inline group in the Web Console.";
|
|
59
|
+
};
|
|
60
|
+
readonly info: {
|
|
61
|
+
readonly '!type': "fn(...msg: ?)";
|
|
62
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/DOM/console.info";
|
|
63
|
+
readonly '!doc': "Outputs an informational message to the Web Console.";
|
|
64
|
+
};
|
|
65
|
+
readonly log: {
|
|
66
|
+
readonly '!type': "fn(...msg: ?)";
|
|
67
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/DOM/console.log";
|
|
68
|
+
readonly '!doc': "Outputs a message to the Web Console.";
|
|
69
|
+
};
|
|
70
|
+
readonly table: {
|
|
71
|
+
readonly '!type': "fn(data: []|?, columns?: [])";
|
|
72
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/Web/API/Console/table";
|
|
73
|
+
readonly '!doc': "Displays tabular data as a table.";
|
|
74
|
+
};
|
|
75
|
+
readonly time: {
|
|
76
|
+
readonly '!type': "fn(label: string)";
|
|
77
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/Web/API/Console.time";
|
|
78
|
+
readonly '!doc': "Starts a timer you can use to track how long an operation takes.";
|
|
79
|
+
};
|
|
80
|
+
readonly timeEnd: {
|
|
81
|
+
readonly '!type': "fn(label: string)";
|
|
82
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/Web/API/Console.timeEnd";
|
|
83
|
+
readonly '!doc': "Stops a timer that was previously started by calling console.time().";
|
|
84
|
+
};
|
|
85
|
+
readonly trace: {
|
|
86
|
+
readonly '!type': "fn()";
|
|
87
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/Web/API/Console.trace";
|
|
88
|
+
readonly '!doc': "Outputs a stack trace to the Web Console.";
|
|
89
|
+
};
|
|
90
|
+
readonly warn: {
|
|
91
|
+
readonly '!type': "fn(...msg: ?)";
|
|
92
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/DOM/console.warn";
|
|
93
|
+
readonly '!doc': "Outputs a warning message to the Web Console.";
|
|
94
|
+
};
|
|
95
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/Web/API/Console";
|
|
96
|
+
readonly '!doc': "The console object provides access to the browser's debugging console.";
|
|
97
|
+
};
|
|
98
|
+
readonly crypto: {
|
|
99
|
+
readonly getRandomValues: {
|
|
100
|
+
readonly '!type': "fn([number])";
|
|
101
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/DOM/window.crypto.getRandomValues";
|
|
102
|
+
readonly '!doc': "This methods lets you get cryptographically random values.";
|
|
103
|
+
};
|
|
104
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/DOM/window.crypto.getRandomValues";
|
|
105
|
+
readonly '!doc': "This methods lets you get cryptographically random values.";
|
|
106
|
+
};
|
|
107
|
+
readonly Blob: {
|
|
108
|
+
readonly '!type': "fn(parts: [?], options?: ?)";
|
|
109
|
+
readonly prototype: {
|
|
110
|
+
readonly size: {
|
|
111
|
+
readonly '!type': "number";
|
|
112
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/Web/API/Blob/size";
|
|
113
|
+
readonly '!doc': "The size, in bytes, of the data contained in the Blob object. Read only.";
|
|
114
|
+
};
|
|
115
|
+
readonly type: {
|
|
116
|
+
readonly '!type': "string";
|
|
117
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/Web/API/Blob/type";
|
|
118
|
+
readonly '!doc': "An ASCII-encoded string indicating the MIME type of the data contained in the Blob.";
|
|
119
|
+
};
|
|
120
|
+
readonly slice: {
|
|
121
|
+
readonly '!type': "fn(start: number, end?: number, type?: string) -> +Blob";
|
|
122
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/DOM/Blob";
|
|
123
|
+
readonly '!doc': "Returns a new Blob object containing the data in the specified range of bytes.";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/DOM/Blob";
|
|
127
|
+
readonly '!doc': "A Blob object represents a file-like object of immutable, raw data.";
|
|
128
|
+
};
|
|
129
|
+
readonly setTimeout: {
|
|
130
|
+
readonly '!type': "fn(f: fn(), ms: number) -> number";
|
|
131
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/DOM/window.setTimeout";
|
|
132
|
+
readonly '!doc': "Calls a function or executes a code snippet after specified delay.";
|
|
133
|
+
};
|
|
134
|
+
readonly clearTimeout: {
|
|
135
|
+
readonly '!type': "fn(timerId: number)";
|
|
136
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/DOM/window.clearTimeout";
|
|
137
|
+
readonly '!doc': "Clears the function scheduled to run by setTimeout().";
|
|
138
|
+
};
|
|
139
|
+
readonly fetch: {
|
|
140
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API";
|
|
141
|
+
readonly '!doc': "The Fetch API provides an interface for fetching resources (including across the network).";
|
|
142
|
+
readonly '!type': "fn(url: string, options?: ?) -> +Promise[:t=+Response]";
|
|
143
|
+
};
|
|
144
|
+
readonly URL: {
|
|
145
|
+
readonly '!type': "fn(url: string, base?: string)";
|
|
146
|
+
readonly createObjectURL: {
|
|
147
|
+
readonly '!type': "fn(object: +Blob|+File): string";
|
|
148
|
+
};
|
|
149
|
+
readonly canParse: {
|
|
150
|
+
readonly '!type': "fn(url: string, base?: string): bool";
|
|
151
|
+
};
|
|
152
|
+
readonly revokeObjectURL: {
|
|
153
|
+
readonly '!type': "fn(url: string): void";
|
|
154
|
+
};
|
|
155
|
+
readonly prototype: {
|
|
156
|
+
readonly hash: {
|
|
157
|
+
readonly '!type': "string";
|
|
158
|
+
};
|
|
159
|
+
readonly host: {
|
|
160
|
+
readonly '!type': "string";
|
|
161
|
+
};
|
|
162
|
+
readonly hostname: {
|
|
163
|
+
readonly '!type': "string";
|
|
164
|
+
};
|
|
165
|
+
readonly href: {
|
|
166
|
+
readonly '!type': "string";
|
|
167
|
+
};
|
|
168
|
+
readonly origin: {
|
|
169
|
+
readonly '!type': "string";
|
|
170
|
+
};
|
|
171
|
+
readonly pathname: {
|
|
172
|
+
readonly '!type': "string";
|
|
173
|
+
};
|
|
174
|
+
readonly port: {
|
|
175
|
+
readonly '!type': "string";
|
|
176
|
+
};
|
|
177
|
+
readonly protocol: {
|
|
178
|
+
readonly '!type': "string";
|
|
179
|
+
};
|
|
180
|
+
readonly search: {
|
|
181
|
+
readonly '!type': "string";
|
|
182
|
+
};
|
|
183
|
+
readonly toString: {
|
|
184
|
+
readonly '!type': "fn() -> string";
|
|
185
|
+
};
|
|
186
|
+
readonly toJSON: {
|
|
187
|
+
readonly '!type': "fn() -> string";
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
readonly ecmascript: {
|
|
193
|
+
readonly '!name': "ecmascript";
|
|
194
|
+
readonly '!define': {
|
|
195
|
+
readonly 'Error.prototype': "Error.prototype";
|
|
196
|
+
readonly propertyDescriptor: {
|
|
197
|
+
readonly enumerable: "bool";
|
|
198
|
+
readonly configurable: "bool";
|
|
199
|
+
readonly value: "?";
|
|
200
|
+
readonly writable: "bool";
|
|
201
|
+
readonly get: "fn() -> ?";
|
|
202
|
+
readonly set: "fn(value: ?)";
|
|
203
|
+
};
|
|
204
|
+
readonly 'Promise.prototype': {
|
|
205
|
+
readonly catch: {
|
|
206
|
+
readonly '!doc': "The catch() method returns a Promise and deals with rejected cases only.";
|
|
207
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch";
|
|
208
|
+
readonly '!type': "fn(onRejected: fn(reason: ?)) -> !this";
|
|
209
|
+
};
|
|
210
|
+
readonly then: {
|
|
211
|
+
readonly '!doc': "The then() method returns a Promise.";
|
|
212
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then";
|
|
213
|
+
readonly '!type': "fn(onFulfilled: fn(value: ?), onRejected: fn(reason: ?)) -> !custom:Promise_then";
|
|
214
|
+
readonly '!effects': readonly ["call !0 !this.:t"];
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
readonly Object: {
|
|
219
|
+
readonly '!type': "fn()";
|
|
220
|
+
readonly getPrototypeOf: {
|
|
221
|
+
readonly '!type': "fn(obj: ?) -> ?";
|
|
222
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/getPrototypeOf";
|
|
223
|
+
readonly '!doc': "Returns the prototype (i.e. the internal prototype) of the specified object.";
|
|
224
|
+
};
|
|
225
|
+
readonly create: {
|
|
226
|
+
readonly '!type': "fn(proto: ?) -> !custom:Object_create";
|
|
227
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create";
|
|
228
|
+
readonly '!doc': "Creates a new object with the specified prototype object and properties.";
|
|
229
|
+
};
|
|
230
|
+
readonly keys: {
|
|
231
|
+
readonly '!type': "fn(obj: ?) -> [string]";
|
|
232
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/keys";
|
|
233
|
+
readonly '!doc': "Returns an array of a given object's own enumerable properties.";
|
|
234
|
+
};
|
|
235
|
+
readonly assign: {
|
|
236
|
+
readonly '!type': "fn(target: ?, source: ?, source?: ?) -> !0";
|
|
237
|
+
readonly '!effects': readonly ["copy !1 !0", "copy !2 !0", "copy !3 !0"];
|
|
238
|
+
readonly '!doc': "The Object.assign() method is used to copy the values of all enumerable own properties.";
|
|
239
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign";
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
readonly Array: {
|
|
243
|
+
readonly '!type': "fn(size: number) -> !custom:Array_ctor";
|
|
244
|
+
readonly isArray: {
|
|
245
|
+
readonly '!type': "fn(value: ?) -> bool";
|
|
246
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/isArray";
|
|
247
|
+
readonly '!doc': "Returns true if an object is an array, false if it is not.";
|
|
248
|
+
};
|
|
249
|
+
readonly from: {
|
|
250
|
+
readonly '!type': "fn(arrayLike: ?, mapFn?: fn(elt: ?, i: number) -> ?, thisArg?: ?) -> [!0.<i>]";
|
|
251
|
+
readonly '!effects': readonly ["call !1 this=!2 !0.<i> number"];
|
|
252
|
+
readonly '!doc': "The Array.from() method creates a new Array instance from an array-like or iterable object.";
|
|
253
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from";
|
|
254
|
+
};
|
|
255
|
+
readonly prototype: {
|
|
256
|
+
readonly '!stdProto': "Array";
|
|
257
|
+
readonly length: {
|
|
258
|
+
readonly '!type': "number";
|
|
259
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/length";
|
|
260
|
+
readonly '!doc': "An unsigned, 32-bit integer that specifies the number of elements in an array.";
|
|
261
|
+
};
|
|
262
|
+
readonly push: {
|
|
263
|
+
readonly '!type': "fn(newelt: ?) -> number";
|
|
264
|
+
readonly '!effects': readonly ["propagate !0 !this.<i>"];
|
|
265
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/push";
|
|
266
|
+
readonly '!doc': "Mutates an array by appending the given elements and returning the new length.";
|
|
267
|
+
};
|
|
268
|
+
readonly pop: {
|
|
269
|
+
readonly '!type': "fn() -> !this.<i>";
|
|
270
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/pop";
|
|
271
|
+
readonly '!doc': "Removes the last element from an array and returns that element.";
|
|
272
|
+
};
|
|
273
|
+
readonly map: {
|
|
274
|
+
readonly '!type': "fn(f: fn(elt: ?, i: number, array: +Array) -> ?, context?: ?) -> [!0.!ret]";
|
|
275
|
+
readonly '!effects': readonly ["call !0 this=!1 !this.<i> number !this"];
|
|
276
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/map";
|
|
277
|
+
readonly '!doc': "Creates a new array with the results of calling a provided function on every element.";
|
|
278
|
+
};
|
|
279
|
+
readonly filter: {
|
|
280
|
+
readonly '!type': "fn(test: fn(elt: ?, i: number, array: +Array) -> bool, context?: ?) -> !this";
|
|
281
|
+
readonly '!effects': readonly ["call !0 this=!1 !this.<i> number !this"];
|
|
282
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/filter";
|
|
283
|
+
readonly '!doc': "Creates a new array with all elements that pass the test implemented by the provided function.";
|
|
284
|
+
};
|
|
285
|
+
readonly forEach: {
|
|
286
|
+
readonly '!type': "fn(f: fn(elt: ?, i: number, array: +Array), context?: ?)";
|
|
287
|
+
readonly '!effects': readonly ["call !0 this=!1 !this.<i> number !this"];
|
|
288
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach";
|
|
289
|
+
readonly '!doc': "Executes a provided function once per array element.";
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
readonly String: {
|
|
294
|
+
readonly '!type': "fn(value: ?) -> string";
|
|
295
|
+
readonly prototype: {
|
|
296
|
+
readonly '!stdProto': "String";
|
|
297
|
+
readonly length: {
|
|
298
|
+
readonly '!type': "number";
|
|
299
|
+
readonly '!url': "https://developer.mozilla.org/en/docs/JavaScript/Reference/Global_Objects/String/length";
|
|
300
|
+
readonly '!doc': "Represents the length of a string.";
|
|
301
|
+
};
|
|
302
|
+
readonly charAt: {
|
|
303
|
+
readonly '!type': "fn(i: number) -> string";
|
|
304
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/charAt";
|
|
305
|
+
readonly '!doc': "Returns the specified character from a string.";
|
|
306
|
+
};
|
|
307
|
+
readonly indexOf: {
|
|
308
|
+
readonly '!type': "fn(char: string, from?: number) -> number";
|
|
309
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/indexOf";
|
|
310
|
+
readonly '!doc': "Returns the index within the calling String object of the first occurrence of the specified value.";
|
|
311
|
+
};
|
|
312
|
+
readonly substring: {
|
|
313
|
+
readonly '!type': "fn(from: number, to?: number) -> string";
|
|
314
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/substring";
|
|
315
|
+
readonly '!doc': "Returns a subset of a string between one index and another.";
|
|
316
|
+
};
|
|
317
|
+
readonly split: {
|
|
318
|
+
readonly '!type': "fn(pattern?: string|+RegExp, limit?: number) -> [string]";
|
|
319
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/split";
|
|
320
|
+
readonly '!doc': "Splits a String object into an array of strings by separating the string into substrings.";
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
readonly Math: {
|
|
325
|
+
readonly PI: {
|
|
326
|
+
readonly '!type': "number";
|
|
327
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/PI";
|
|
328
|
+
readonly '!doc': "The ratio of the circumference of a circle to its diameter, approximately 3.14159.";
|
|
329
|
+
};
|
|
330
|
+
readonly abs: {
|
|
331
|
+
readonly '!type': "fn(number) -> number";
|
|
332
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/abs";
|
|
333
|
+
readonly '!doc': "Returns the absolute value of a number.";
|
|
334
|
+
};
|
|
335
|
+
readonly floor: {
|
|
336
|
+
readonly '!type': "fn(number) -> number";
|
|
337
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/floor";
|
|
338
|
+
readonly '!doc': "Returns the largest integer less than or equal to a number.";
|
|
339
|
+
};
|
|
340
|
+
readonly random: {
|
|
341
|
+
readonly '!type': "fn() -> number";
|
|
342
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/random";
|
|
343
|
+
readonly '!doc': "Returns a floating-point, pseudo-random number in the range [0, 1).";
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
readonly JSON: {
|
|
347
|
+
readonly parse: {
|
|
348
|
+
readonly '!type': "fn(json: string, reviver?: fn(key: string, value: ?) -> ?) -> ?";
|
|
349
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/parse";
|
|
350
|
+
readonly '!doc': "Parse a string as JSON, optionally transforming the value produced by parsing.";
|
|
351
|
+
};
|
|
352
|
+
readonly stringify: {
|
|
353
|
+
readonly '!type': "fn(value: ?, replacer?: fn(key: string, value: ?) -> ?, space?: string|number) -> string";
|
|
354
|
+
readonly '!url': "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify";
|
|
355
|
+
readonly '!doc': "Convert a value to JSON.";
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
readonly lodash: {
|
|
360
|
+
readonly '!name': "LIB/lodash";
|
|
361
|
+
readonly _: {
|
|
362
|
+
readonly chunk: {
|
|
363
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#chunk";
|
|
364
|
+
readonly '!doc': "Creates an array of elements split into groups the length of size.";
|
|
365
|
+
readonly '!type': "fn(array, [size])";
|
|
366
|
+
};
|
|
367
|
+
readonly compact: {
|
|
368
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#compact";
|
|
369
|
+
readonly '!doc': "Creates an array with all falsey values removed.";
|
|
370
|
+
readonly '!type': "fn(array)";
|
|
371
|
+
};
|
|
372
|
+
readonly map: {
|
|
373
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#map";
|
|
374
|
+
readonly '!doc': "Creates an array of values by running each element in collection thru iteratee.";
|
|
375
|
+
readonly '!type': "fn(collection, [iteratee])";
|
|
376
|
+
};
|
|
377
|
+
readonly filter: {
|
|
378
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#filter";
|
|
379
|
+
readonly '!doc': "Iterates over elements of collection, returning an array of all elements predicate returns truthy for.";
|
|
380
|
+
readonly '!type': "fn(collection, [predicate])";
|
|
381
|
+
};
|
|
382
|
+
readonly find: {
|
|
383
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#find";
|
|
384
|
+
readonly '!doc': "Iterates over elements of collection, returning the first element predicate returns truthy for.";
|
|
385
|
+
readonly '!type': "fn(collection, [predicate], [fromIndex])";
|
|
386
|
+
};
|
|
387
|
+
readonly forEach: {
|
|
388
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#forEach";
|
|
389
|
+
readonly '!doc': "Iterates over elements of collection and invokes iteratee for each element.";
|
|
390
|
+
readonly '!type': "fn(collection, [iteratee])";
|
|
391
|
+
};
|
|
392
|
+
readonly reduce: {
|
|
393
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#reduce";
|
|
394
|
+
readonly '!doc': "Reduces collection to a value which is the accumulated result of running each element in collection thru iteratee.";
|
|
395
|
+
readonly '!type': "fn(collection, [iteratee], [accumulator])";
|
|
396
|
+
};
|
|
397
|
+
readonly clone: {
|
|
398
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#clone";
|
|
399
|
+
readonly '!doc': "Creates a shallow clone of value.";
|
|
400
|
+
readonly '!type': "fn(value)";
|
|
401
|
+
};
|
|
402
|
+
readonly cloneDeep: {
|
|
403
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#cloneDeep";
|
|
404
|
+
readonly '!doc': "This method is like _.clone except that it recursively clones value.";
|
|
405
|
+
readonly '!type': "fn(value)";
|
|
406
|
+
};
|
|
407
|
+
readonly isArray: {
|
|
408
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#isArray";
|
|
409
|
+
readonly '!doc': "Checks if value is classified as an Array object.";
|
|
410
|
+
readonly '!type': "fn(value)";
|
|
411
|
+
};
|
|
412
|
+
readonly isObject: {
|
|
413
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#isObject";
|
|
414
|
+
readonly '!doc': "Checks if value is the language type of Object.";
|
|
415
|
+
readonly '!type': "fn(value)";
|
|
416
|
+
};
|
|
417
|
+
readonly isString: {
|
|
418
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#isString";
|
|
419
|
+
readonly '!doc': "Checks if value is classified as a String primitive or object.";
|
|
420
|
+
readonly '!type': "fn(value)";
|
|
421
|
+
};
|
|
422
|
+
readonly get: {
|
|
423
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#get";
|
|
424
|
+
readonly '!doc': "Gets the value at path of object.";
|
|
425
|
+
readonly '!type': "fn(object, path, [defaultValue])";
|
|
426
|
+
};
|
|
427
|
+
readonly set: {
|
|
428
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#set";
|
|
429
|
+
readonly '!doc': "Sets the value at path of object.";
|
|
430
|
+
readonly '!type': "fn(object, path, value)";
|
|
431
|
+
};
|
|
432
|
+
readonly merge: {
|
|
433
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#merge";
|
|
434
|
+
readonly '!doc': "This method is like _.assign except that it recursively merges own and inherited enumerable string keyed properties.";
|
|
435
|
+
readonly '!type': "fn(object, [sources])";
|
|
436
|
+
};
|
|
437
|
+
readonly pick: {
|
|
438
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#pick";
|
|
439
|
+
readonly '!doc': "Creates an object composed of the picked object properties.";
|
|
440
|
+
readonly '!type': "fn(object, [paths])";
|
|
441
|
+
};
|
|
442
|
+
readonly omit: {
|
|
443
|
+
readonly '!url': "https://lodash.com/docs/4.17.15#omit";
|
|
444
|
+
readonly '!doc': "The opposite of _.pick; this method creates an object composed of the own and inherited enumerable property paths of object that are not omitted.";
|
|
445
|
+
readonly '!type': "fn(object, [paths])";
|
|
446
|
+
};
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
/**
|
|
451
|
+
* Get Tern definition for a specific library
|
|
452
|
+
*/
|
|
453
|
+
export declare function getTernDefinition(libraryName: string): Record<string, any> | null;
|
|
454
|
+
/**
|
|
455
|
+
* Get all available library names
|
|
456
|
+
*/
|
|
457
|
+
export declare function getAvailableLibraries(): string[];
|
|
458
|
+
/**
|
|
459
|
+
* Combine multiple Tern definitions
|
|
460
|
+
*/
|
|
461
|
+
export declare function combineTernDefinitions(...definitions: Record<string, any>[]): Record<string, any>;
|
|
462
|
+
/**
|
|
463
|
+
* Create a complete Tern server configuration with the specified libraries
|
|
464
|
+
*/
|
|
465
|
+
export declare function createTernConfig(libraries?: string[]): any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Default libraries
|
|
2
|
+
const defaultLibraries = [{
|
|
3
|
+
accessor: ['_'],
|
|
4
|
+
version: '4.17.21',
|
|
5
|
+
docsURL: 'https://lodash.com/docs/4.17.21',
|
|
6
|
+
name: 'lodash'
|
|
7
|
+
}];
|
|
8
|
+
const JSLibraries = [...defaultLibraries];
|
|
9
|
+
const libraryReservedIdentifiers = defaultLibraries.reduce((acc, lib) => {
|
|
10
|
+
lib.accessor.forEach(a => {
|
|
11
|
+
acc[a] = true;
|
|
12
|
+
});
|
|
13
|
+
return acc;
|
|
14
|
+
}, {});export{JSLibraries,defaultLibraries,libraryReservedIdentifiers};//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/services/code/javascript/jslibrary/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;AACO,MAAM,gBAAgB,GAAgB,CAAA;AACzC,EAAA,QAAA,EAAA,CAAA,GAAA,CAAA;SACI,EAAA,SAAW;AACX,EAAA,OAAA,EAAA,iCAAkB;AAClB,EAAA,IAAA,EAAA;AACA,CAAA;AACH,MAAA,WAAA,GAAA,CAAA,GAAA,gBAAA;AACH,MAAA,0BAAA,GAAA,gBAAA,CAAA,MAAA,CAAA,CAAA,GAAA,EAAA,GAAA,KAAA;AAEF,EAAA,GAAA,CAAM,QAAO,CAAA,OAAA,CAAA,CAAW,IAAI;AAE5B,IAAA,GAAO,CAAA,CAAA,CAAA,GAAM,IAAA;IACT;AACI,EAAA,OAAA,GAAI;AACR,CAAA,EAAA,EAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Library Manager for JavaScript Runtime Libraries
|
|
3
|
+
* Manages installed libraries and their global objects
|
|
4
|
+
*/
|
|
5
|
+
import { JSLibrary } from '../utils/types';
|
|
6
|
+
/**
|
|
7
|
+
* Information about an installed library
|
|
8
|
+
*/
|
|
9
|
+
export interface InstalledLibraryInfo {
|
|
10
|
+
identifier: string;
|
|
11
|
+
library: JSLibrary;
|
|
12
|
+
global: unknown;
|
|
13
|
+
installTime: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Manages JavaScript libraries and their runtime objects
|
|
17
|
+
*/
|
|
18
|
+
export declare class LibraryManager {
|
|
19
|
+
private installedLibraries;
|
|
20
|
+
/**
|
|
21
|
+
* Install a library with its global object
|
|
22
|
+
*/
|
|
23
|
+
installLibrary(identifier: string, library: JSLibrary, global: unknown): void;
|
|
24
|
+
/**
|
|
25
|
+
* Uninstall a library
|
|
26
|
+
*/
|
|
27
|
+
uninstallLibrary(identifier: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Get installed library information
|
|
30
|
+
*/
|
|
31
|
+
getInstalledLibrary(identifier: string): InstalledLibraryInfo | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Get all installed libraries
|
|
34
|
+
*/
|
|
35
|
+
getInstalledLibraries(): InstalledLibraryInfo[];
|
|
36
|
+
/**
|
|
37
|
+
* Check if a library is installed
|
|
38
|
+
*/
|
|
39
|
+
isLibraryInstalled(identifier: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Get available libraries (from the default set)
|
|
42
|
+
*/
|
|
43
|
+
getAvailableLibraries(): JSLibrary[];
|
|
44
|
+
/**
|
|
45
|
+
* Clear all installed libraries
|
|
46
|
+
*/
|
|
47
|
+
clearAll(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Get library count
|
|
50
|
+
*/
|
|
51
|
+
getLibraryCount(): number;
|
|
52
|
+
}
|
|
53
|
+
export declare const libraryManager: LibraryManager;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {JSLibraries}from'./index.js';/**
|
|
2
|
+
* Library Manager for JavaScript Runtime Libraries
|
|
3
|
+
* Manages installed libraries and their global objects
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Manages JavaScript libraries and their runtime objects
|
|
7
|
+
*/
|
|
8
|
+
class LibraryManager {
|
|
9
|
+
installedLibraries = new Map();
|
|
10
|
+
/**
|
|
11
|
+
* Install a library with its global object
|
|
12
|
+
*/
|
|
13
|
+
installLibrary(identifier, library, global) {
|
|
14
|
+
this.installedLibraries.set(identifier, {
|
|
15
|
+
identifier,
|
|
16
|
+
library,
|
|
17
|
+
global,
|
|
18
|
+
installTime: Date.now()
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Uninstall a library
|
|
23
|
+
*/
|
|
24
|
+
uninstallLibrary(identifier) {
|
|
25
|
+
return this.installedLibraries.delete(identifier);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get installed library information
|
|
29
|
+
*/
|
|
30
|
+
getInstalledLibrary(identifier) {
|
|
31
|
+
return this.installedLibraries.get(identifier);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get all installed libraries
|
|
35
|
+
*/
|
|
36
|
+
getInstalledLibraries() {
|
|
37
|
+
return Array.from(this.installedLibraries.values());
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Check if a library is installed
|
|
41
|
+
*/
|
|
42
|
+
isLibraryInstalled(identifier) {
|
|
43
|
+
return this.installedLibraries.has(identifier);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get available libraries (from the default set)
|
|
47
|
+
*/
|
|
48
|
+
getAvailableLibraries() {
|
|
49
|
+
return [...JSLibraries];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Clear all installed libraries
|
|
53
|
+
*/
|
|
54
|
+
clearAll() {
|
|
55
|
+
this.installedLibraries.clear();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get library count
|
|
59
|
+
*/
|
|
60
|
+
getLibraryCount() {
|
|
61
|
+
return this.installedLibraries.size;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Export singleton instance
|
|
65
|
+
const libraryManager = new LibraryManager();export{LibraryManager,libraryManager};//# sourceMappingURL=library-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-manager.js","sources":["../../../../../src/services/code/javascript/jslibrary/library-manager.ts"],"sourcesContent":[null],"names":[],"mappings":"qCAAA;;;AAGG;AAeH;;AAEG;MACU,cAAc,CAAA;AACf,EAAA,kBAAA,GAAkB,IAAG,GAAI,EAAG;AAEpC;;AAEG;AACH,EAAA,cAAA,CAAA,UAAe,EAAkB,OAAE,EAAkB,MAAE,EAAe;AAClE,IAAA,IAAA,CAAA,kBAAK,CAAA,GAAkB,CAAC;gBACpB;aACA;YACA;AACA,MAAA,WAAA,EAAA,IAAW,CAAA,GAAE;AAChB,KAAA,CAAA;;AAGL;;AAEG;AACH,EAAA,gBAAA,CAAA,UAAiB,EAAkB;WAC/B,IAAO,CAAA,kBAAK,CAAA,iBAA0B,CAAA;;AAG1C;;AAEG;AACH,EAAA,mBAAA,CAAA,UAAoB,EAAkB;WAClC,IAAO,CAAA,kBAAK,CAAA,GAAkB,CAAC,UAAI,CAAA;;AAGvC;;AAEG;uBACH,GAAqB;WACjB,KAAO,CAAA,IAAM,CAAA,IAAK,CAAA,kBAAK,CAAA,MAAmB,EAAA,CAAA;;AAG9C;;AAEG;AACH,EAAA,kBAAA,CAAA,UAAmB,EAAkB;WACjC,IAAO,CAAA,kBAAK,CAAA,GAAkB,CAAC,UAAI,CAAA;;AAGvC;;AAEG;uBACH,GAAqB;AACjB,IAAA,OAAA,CAAA,GAAO,WAAI,CAAA;;AAGf;;AAEG;UACH,GAAQ;AACJ,IAAA,IAAA,CAAA,kBAAK,CAAA,KAAmB,EAAA;;AAG5B;;AAEG;iBACH,GAAe;AACX,IAAA,OAAA,IAAO,CAAA,kBAAK,CAAA,IAAmB;;AAEtC;AAED;AACO,MAAM,cAAc,GAAG,IAAI,cAAc"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import*as lodash from'lodash-es';import {libraryReservedIdentifiers,JSLibraries,defaultLibraries}from'./index.js';const defaultLibImplementations = {
|
|
2
|
+
lodash
|
|
3
|
+
// We are removing some functionalities of node-forge because they wont
|
|
4
|
+
// work in the worker thread
|
|
5
|
+
// forge: /*#__PURE*/ _.omit(forge, ["tls", "http", "xhr", "socket", "task"]),
|
|
6
|
+
};
|
|
7
|
+
// Invalid Entity Identifiers for dependency management
|
|
8
|
+
const invalidEntityIdentifiers = {
|
|
9
|
+
...libraryReservedIdentifiers
|
|
10
|
+
};
|
|
11
|
+
function resetJSLibraries() {
|
|
12
|
+
JSLibraries.length = 0;
|
|
13
|
+
JSLibraries.push(...defaultLibraries);
|
|
14
|
+
const defaultLibraryAccessors = defaultLibraries.map(lib => lib.accessor[0]);
|
|
15
|
+
for (const key of Object.keys(libraryReservedIdentifiers)) {
|
|
16
|
+
if (defaultLibraryAccessors.includes(key)) {
|
|
17
|
+
// eslint-disable-next-line no-continue
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
delete globalThis[key];
|
|
22
|
+
} catch (e) {
|
|
23
|
+
globalThis[key] = undefined;
|
|
24
|
+
}
|
|
25
|
+
// We have to update invalidEntityIdentifiers as well
|
|
26
|
+
delete libraryReservedIdentifiers[key];
|
|
27
|
+
delete invalidEntityIdentifiers[key];
|
|
28
|
+
}
|
|
29
|
+
JSLibraries.forEach(library => {
|
|
30
|
+
if (!(library.name in defaultLibImplementations)) throw new Error(`resetJSLibraries(): implementation for library ${library.name} not found. Have you forgotten to add it to the defaultLibrariesImpls object?`);
|
|
31
|
+
globalThis[library.accessor[0]] = defaultLibImplementations[library.name];
|
|
32
|
+
});
|
|
33
|
+
}export{invalidEntityIdentifiers,resetJSLibraries};//# sourceMappingURL=reset.js.map
|