typescript 5.0.0-dev.20230208 → 5.0.0-dev.20230210
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/lib.decorators.d.ts +112 -95
- package/lib/tsc.js +569 -127
- package/lib/tsserver.js +591 -140
- package/lib/tsserverlibrary.js +591 -140
- package/lib/typescript.js +591 -140
- package/lib/typingsInstaller.js +21 -5
- package/package.json +1 -1
package/lib/lib.decorators.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ and limitations under the License.
|
|
|
17
17
|
/// <reference no-default-lib="true"/>
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* The decorator context types provided to class
|
|
20
|
+
* The decorator context types provided to class element decorators.
|
|
21
21
|
*/
|
|
22
22
|
type ClassMemberDecoratorContext =
|
|
23
23
|
| ClassMethodDecoratorContext
|
|
@@ -78,34 +78,37 @@ interface ClassMethodDecoratorContext<
|
|
|
78
78
|
This = unknown,
|
|
79
79
|
Value extends (this: This, ...args: any) => any = (this: This, ...args: any) => any,
|
|
80
80
|
> {
|
|
81
|
-
/** The kind of class
|
|
81
|
+
/** The kind of class element that was decorated. */
|
|
82
82
|
readonly kind: "method";
|
|
83
83
|
|
|
84
|
-
/** The name of the decorated class
|
|
84
|
+
/** The name of the decorated class element. */
|
|
85
85
|
readonly name: string | symbol;
|
|
86
86
|
|
|
87
|
-
/** A value indicating whether the class
|
|
87
|
+
/** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
|
|
88
88
|
readonly static: boolean;
|
|
89
89
|
|
|
90
|
-
/** A value indicating whether the class
|
|
90
|
+
/** A value indicating whether the class element has a private name. */
|
|
91
91
|
readonly private: boolean;
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
93
|
+
/** An object that can be used to access the current value of the class element at runtime. */
|
|
94
|
+
readonly access: {
|
|
95
|
+
/**
|
|
96
|
+
* Determines whether an object has a property with the same name as the decorated element.
|
|
97
|
+
*/
|
|
98
|
+
has(object: This): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Gets the current value of the method from the provided object.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* let fn = context.access.get(instance);
|
|
104
|
+
*/
|
|
105
|
+
get(object: This): Value;
|
|
106
|
+
};
|
|
104
107
|
|
|
105
108
|
/**
|
|
106
109
|
* Adds a callback to be invoked either before static initializers are run (when
|
|
107
|
-
* decorating a `static`
|
|
108
|
-
* decorating a non-`static`
|
|
110
|
+
* decorating a `static` element), or before instance initializers are run (when
|
|
111
|
+
* decorating a non-`static` element).
|
|
109
112
|
*
|
|
110
113
|
* @example
|
|
111
114
|
* ```ts
|
|
@@ -139,34 +142,37 @@ interface ClassGetterDecoratorContext<
|
|
|
139
142
|
This = unknown,
|
|
140
143
|
Value = unknown,
|
|
141
144
|
> {
|
|
142
|
-
/** The kind of class
|
|
145
|
+
/** The kind of class element that was decorated. */
|
|
143
146
|
readonly kind: "getter";
|
|
144
147
|
|
|
145
|
-
/** The name of the decorated class
|
|
148
|
+
/** The name of the decorated class element. */
|
|
146
149
|
readonly name: string | symbol;
|
|
147
150
|
|
|
148
|
-
/** A value indicating whether the class
|
|
151
|
+
/** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
|
|
149
152
|
readonly static: boolean;
|
|
150
153
|
|
|
151
|
-
/** A value indicating whether the class
|
|
154
|
+
/** A value indicating whether the class element has a private name. */
|
|
152
155
|
readonly private: boolean;
|
|
153
156
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
157
|
+
/** An object that can be used to access the current value of the class element at runtime. */
|
|
158
|
+
readonly access: {
|
|
159
|
+
/**
|
|
160
|
+
* Determines whether an object has a property with the same name as the decorated element.
|
|
161
|
+
*/
|
|
162
|
+
has(object: This): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Invokes the getter on the provided object.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* let value = context.access.get(instance);
|
|
168
|
+
*/
|
|
169
|
+
get(object: This): Value;
|
|
170
|
+
};
|
|
165
171
|
|
|
166
172
|
/**
|
|
167
173
|
* Adds a callback to be invoked either before static initializers are run (when
|
|
168
|
-
* decorating a `static`
|
|
169
|
-
* decorating a non-`static`
|
|
174
|
+
* decorating a `static` element), or before instance initializers are run (when
|
|
175
|
+
* decorating a non-`static` element).
|
|
170
176
|
*/
|
|
171
177
|
addInitializer(initializer: (this: This) => void): void;
|
|
172
178
|
}
|
|
@@ -181,34 +187,37 @@ interface ClassSetterDecoratorContext<
|
|
|
181
187
|
This = unknown,
|
|
182
188
|
Value = unknown,
|
|
183
189
|
> {
|
|
184
|
-
/** The kind of class
|
|
190
|
+
/** The kind of class element that was decorated. */
|
|
185
191
|
readonly kind: "setter";
|
|
186
192
|
|
|
187
|
-
/** The name of the decorated class
|
|
193
|
+
/** The name of the decorated class element. */
|
|
188
194
|
readonly name: string | symbol;
|
|
189
195
|
|
|
190
|
-
/** A value indicating whether the class
|
|
196
|
+
/** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
|
|
191
197
|
readonly static: boolean;
|
|
192
198
|
|
|
193
|
-
/** A value indicating whether the class
|
|
199
|
+
/** A value indicating whether the class element has a private name. */
|
|
194
200
|
readonly private: boolean;
|
|
195
201
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
202
|
+
/** An object that can be used to access the current value of the class element at runtime. */
|
|
203
|
+
readonly access: {
|
|
204
|
+
/**
|
|
205
|
+
* Determines whether an object has a property with the same name as the decorated element.
|
|
206
|
+
*/
|
|
207
|
+
has(object: This): boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Invokes the setter on the provided object.
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* context.access.set(instance, value);
|
|
213
|
+
*/
|
|
214
|
+
set(object: This, value: Value): void;
|
|
215
|
+
};
|
|
207
216
|
|
|
208
217
|
/**
|
|
209
218
|
* Adds a callback to be invoked either before static initializers are run (when
|
|
210
|
-
* decorating a `static`
|
|
211
|
-
* decorating a non-`static`
|
|
219
|
+
* decorating a `static` element), or before instance initializers are run (when
|
|
220
|
+
* decorating a non-`static` element).
|
|
212
221
|
*/
|
|
213
222
|
addInitializer(initializer: (this: This) => void): void;
|
|
214
223
|
}
|
|
@@ -223,42 +232,46 @@ interface ClassAccessorDecoratorContext<
|
|
|
223
232
|
This = unknown,
|
|
224
233
|
Value = unknown,
|
|
225
234
|
> {
|
|
226
|
-
/** The kind of class
|
|
235
|
+
/** The kind of class element that was decorated. */
|
|
227
236
|
readonly kind: "accessor";
|
|
228
237
|
|
|
229
|
-
/** The name of the decorated class
|
|
238
|
+
/** The name of the decorated class element. */
|
|
230
239
|
readonly name: string | symbol;
|
|
231
240
|
|
|
232
|
-
/** A value indicating whether the class
|
|
241
|
+
/** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
|
|
233
242
|
readonly static: boolean;
|
|
234
243
|
|
|
235
|
-
/** A value indicating whether the class
|
|
244
|
+
/** A value indicating whether the class element has a private name. */
|
|
236
245
|
readonly private: boolean;
|
|
237
246
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
247
|
+
/** An object that can be used to access the current value of the class element at runtime. */
|
|
248
|
+
readonly access: {
|
|
249
|
+
/**
|
|
250
|
+
* Determines whether an object has a property with the same name as the decorated element.
|
|
251
|
+
*/
|
|
252
|
+
has(object: This): boolean;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Invokes the getter on the provided object.
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* let value = context.access.get(instance);
|
|
259
|
+
*/
|
|
260
|
+
get(object: This): Value;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Invokes the setter on the provided object.
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* context.access.set(instance, value);
|
|
267
|
+
*/
|
|
268
|
+
set(object: This, value: Value): void;
|
|
269
|
+
};
|
|
257
270
|
|
|
258
271
|
/**
|
|
259
272
|
* Adds a callback to be invoked either before static initializers are run (when
|
|
260
|
-
* decorating a `static`
|
|
261
|
-
* decorating a non-`static`
|
|
273
|
+
* decorating a `static` element), or before instance initializers are run (when
|
|
274
|
+
* decorating a non-`static` element).
|
|
262
275
|
*/
|
|
263
276
|
addInitializer(initializer: (this: This) => void): void;
|
|
264
277
|
}
|
|
@@ -320,36 +333,40 @@ interface ClassFieldDecoratorContext<
|
|
|
320
333
|
This = unknown,
|
|
321
334
|
Value = unknown,
|
|
322
335
|
> {
|
|
323
|
-
/** The kind of class
|
|
336
|
+
/** The kind of class element that was decorated. */
|
|
324
337
|
readonly kind: "field";
|
|
325
338
|
|
|
326
|
-
/** The name of the decorated class
|
|
339
|
+
/** The name of the decorated class element. */
|
|
327
340
|
readonly name: string | symbol;
|
|
328
341
|
|
|
329
|
-
/** A value indicating whether the class
|
|
342
|
+
/** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
|
|
330
343
|
readonly static: boolean;
|
|
331
344
|
|
|
332
|
-
/** A value indicating whether the class
|
|
345
|
+
/** A value indicating whether the class element has a private name. */
|
|
333
346
|
readonly private: boolean;
|
|
334
347
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
// get(this: This): Value;
|
|
348
|
+
/** An object that can be used to access the current value of the class element at runtime. */
|
|
349
|
+
readonly access: {
|
|
350
|
+
/**
|
|
351
|
+
* Determines whether an object has a property with the same name as the decorated element.
|
|
352
|
+
*/
|
|
353
|
+
has(object: This): boolean;
|
|
342
354
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
355
|
+
/**
|
|
356
|
+
* Gets the value of the field on the provided object.
|
|
357
|
+
*/
|
|
358
|
+
get(object: This): Value;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Sets the value of the field on the provided object.
|
|
362
|
+
*/
|
|
363
|
+
set(object: This, value: Value): void;
|
|
364
|
+
};
|
|
348
365
|
|
|
349
366
|
/**
|
|
350
367
|
* Adds a callback to be invoked either before static initializers are run (when
|
|
351
|
-
* decorating a `static`
|
|
352
|
-
* decorating a non-`static`
|
|
368
|
+
* decorating a `static` element), or before instance initializers are run (when
|
|
369
|
+
* decorating a non-`static` element).
|
|
353
370
|
*/
|
|
354
371
|
addInitializer(initializer: (this: This) => void): void;
|
|
355
372
|
}
|