@typescript-deploys/pr-build 5.0.0-pr-51033-2 → 5.0.0-pr-50820-64

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/README.md CHANGED
@@ -33,8 +33,6 @@ There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob
33
33
  * Help each other in the [TypeScript Community Discord](https://discord.gg/typescript).
34
34
  * Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
35
35
  * [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md).
36
- * Read the archived language specification ([docx](https://github.com/microsoft/TypeScript/blob/main/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.docx?raw=true),
37
- [pdf](https://github.com/microsoft/TypeScript/blob/main/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/main/doc/spec-ARCHIVED.md)).
38
36
 
39
37
  This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
40
38
  the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com)
@@ -30,6 +30,10 @@ var __copyProps = (to, from, except, desc) => {
30
30
  return to;
31
31
  };
32
32
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
33
+ // If the importer is in node compatibility mode or this is not an ESM
34
+ // file that has been converted to a CommonJS file using a Babel-
35
+ // compatible transform (i.e. "__esModule" has not been set), then set
36
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
37
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
38
  mod
35
39
  ));
@@ -77,6 +81,7 @@ function createCancellationToken(args) {
77
81
  } else {
78
82
  return {
79
83
  isCancellationRequested: () => pipeExists(cancellationPipeName),
84
+ // TODO: GH#18217
80
85
  setRequest: (_requestId) => void 0,
81
86
  resetRequest: (_requestId) => void 0
82
87
  };
@@ -0,0 +1,352 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+
18
+ /// <reference no-default-lib="true"/>
19
+
20
+
21
+ /**
22
+ * The decorator context types provided to class member decorators.
23
+ */
24
+ type ClassMemberDecoratorContext =
25
+ | ClassMethodDecoratorContext
26
+ | ClassGetterDecoratorContext
27
+ | ClassSetterDecoratorContext
28
+ | ClassFieldDecoratorContext
29
+ | ClassAccessorDecoratorContext
30
+ ;
31
+
32
+ /**
33
+ * The decorator context types provided to any decorator.
34
+ */
35
+ type DecoratorContext =
36
+ | ClassDecoratorContext
37
+ | ClassMemberDecoratorContext
38
+ ;
39
+
40
+ /**
41
+ * Context provided to a class decorator.
42
+ * @template Class The type of the decorated class associated with this context.
43
+ */
44
+ interface ClassDecoratorContext<
45
+ Class extends abstract new (...args: any) => any = abstract new (...args: any) => any,
46
+ > {
47
+ /** The kind of element that was decorated. */
48
+ readonly kind: "class";
49
+
50
+ /** The name of the decorated class. */
51
+ readonly name: string | undefined;
52
+
53
+ /**
54
+ * Adds a callback to be invoked after the class definition has been finalized.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * function customElement(name: string): ClassDecoratorFunction {
59
+ * return (target, { addInitializer }) => {
60
+ * addInitializer(function () {
61
+ * customElements.define(name, this);
62
+ * });
63
+ * }
64
+ * }
65
+ *
66
+ * @customElement("my-element")
67
+ * class MyElement {}
68
+ * ```
69
+ */
70
+ addInitializer(initializer: (this: Class) => void): void;
71
+ }
72
+
73
+ /**
74
+ * Context provided to a class method decorator.
75
+ * @template This The type on which the class element will be defined. For a static class element, this will be
76
+ * the type of the constructor. For a non-static class element, this will be the type of the instance.
77
+ * @template Value The type of the decorated class method.
78
+ */
79
+ interface ClassMethodDecoratorContext<
80
+ This = unknown,
81
+ Value extends (this: This, ...args: any) => any = (this: This, ...args: any) => any,
82
+ > {
83
+ /** The kind of class member that was decorated. */
84
+ readonly kind: "method";
85
+
86
+ /** The name of the decorated class member. */
87
+ readonly name: string | symbol;
88
+
89
+ /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */
90
+ readonly static: boolean;
91
+
92
+ /** A value indicating whether the class member has a private name. */
93
+ readonly private: boolean;
94
+
95
+ /** An object that can be used to access the current value of the class member at runtime. */
96
+ readonly access: {
97
+ /**
98
+ * Gets the current value of the method from the provided receiver.
99
+ *
100
+ * @example
101
+ * let fn = context.access.get.call(instance);
102
+ */
103
+ get(this: This): Value;
104
+ };
105
+
106
+ /**
107
+ * Adds a callback to be invoked either before static initializers are run (when
108
+ * decorating a `static` member), or before instance initializers are run (when
109
+ * decorating a non-`static` member).
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * const bound: ClassMethodDecoratorFunction = (value, { name, private: isPrivate, addInitializer }) {
114
+ * if (isPrivate) throw new TypeError("Not supported on private methods.");
115
+ * addInitializer(function () {
116
+ * this[name] = this[name].bind(this);
117
+ * });
118
+ * }
119
+ *
120
+ * class C {
121
+ * message = "Hello";
122
+ *
123
+ * @bound
124
+ * m() {
125
+ * console.log(this.message);
126
+ * }
127
+ * }
128
+ * ```
129
+ */
130
+ addInitializer(initializer: (this: This) => void): void;
131
+ }
132
+
133
+ /**
134
+ * Context provided to a class getter decorator.
135
+ * @template This The type on which the class element will be defined. For a static class element, this will be
136
+ * the type of the constructor. For a non-static class element, this will be the type of the instance.
137
+ * @template Value The property type of the decorated class getter.
138
+ */
139
+ interface ClassGetterDecoratorContext<
140
+ This = unknown,
141
+ Value = unknown,
142
+ > {
143
+ /** The kind of class member that was decorated. */
144
+ readonly kind: "getter";
145
+
146
+ /** The name of the decorated class member. */
147
+ readonly name: string | symbol;
148
+
149
+ /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */
150
+ readonly static: boolean;
151
+
152
+ /** A value indicating whether the class member has a private name. */
153
+ readonly private: boolean;
154
+
155
+ /** An object that can be used to access the current value of the class member at runtime. */
156
+ readonly access: {
157
+ /**
158
+ * Invokes the getter on the provided receiver.
159
+ *
160
+ * @example
161
+ * let value = context.access.get.call(instance);
162
+ */
163
+ get(this: This): Value;
164
+ };
165
+
166
+ /**
167
+ * Adds a callback to be invoked either before static initializers are run (when
168
+ * decorating a `static` member), or before instance initializers are run (when
169
+ * decorating a non-`static` member).
170
+ */
171
+ addInitializer(initializer: (this: This) => void): void;
172
+ }
173
+
174
+ /**
175
+ * Context provided to a class setter decorator.
176
+ * @template This The type on which the class element will be defined. For a static class element, this will be
177
+ * the type of the constructor. For a non-static class element, this will be the type of the instance.
178
+ * @template Value The type of the decorated class setter.
179
+ */
180
+ interface ClassSetterDecoratorContext<
181
+ This = unknown,
182
+ Value = unknown,
183
+ > {
184
+ /** The kind of class member that was decorated. */
185
+ readonly kind: "setter";
186
+
187
+ /** The name of the decorated class member. */
188
+ readonly name: string | symbol;
189
+
190
+ /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */
191
+ readonly static: boolean;
192
+
193
+ /** A value indicating whether the class member has a private name. */
194
+ readonly private: boolean;
195
+
196
+ /** An object that can be used to access the current value of the class member at runtime. */
197
+ readonly access: {
198
+ /**
199
+ * Invokes the setter on the provided receiver.
200
+ *
201
+ * @example
202
+ * context.access.set.call(instance, value);
203
+ */
204
+ set(this: This, value: Value): void;
205
+ };
206
+
207
+ /**
208
+ * Adds a callback to be invoked either before static initializers are run (when
209
+ * decorating a `static` member), or before instance initializers are run (when
210
+ * decorating a non-`static` member).
211
+ */
212
+ addInitializer(initializer: (this: This) => void): void;
213
+ }
214
+
215
+ /**
216
+ * Context provided to a class `accessor` field decorator.
217
+ * @template This The type on which the class element will be defined. For a static class element, this will be
218
+ * the type of the constructor. For a non-static class element, this will be the type of the instance.
219
+ * @template Value The type of decorated class field.
220
+ */
221
+ interface ClassAccessorDecoratorContext<
222
+ This = unknown,
223
+ Value = unknown,
224
+ > {
225
+ /** The kind of class member that was decorated. */
226
+ readonly kind: "accessor";
227
+
228
+ /** The name of the decorated class member. */
229
+ readonly name: string | symbol;
230
+
231
+ /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */
232
+ readonly static: boolean;
233
+
234
+ /** A value indicating whether the class member has a private name. */
235
+ readonly private: boolean;
236
+
237
+ /** An object that can be used to access the current value of the class member at runtime. */
238
+ readonly access: {
239
+ /**
240
+ * Invokes the getter on the provided receiver.
241
+ *
242
+ * @example
243
+ * let value = context.access.get.call(instance);
244
+ */
245
+ get(this: This): Value;
246
+
247
+ /**
248
+ * Invokes the setter on the provided receiver.
249
+ *
250
+ * @example
251
+ * context.access.set.call(instance, value);
252
+ */
253
+ set(this: This, value: Value): void;
254
+ };
255
+
256
+ /**
257
+ * Adds a callback to be invoked either before static initializers are run (when
258
+ * decorating a `static` member), or before instance initializers are run (when
259
+ * decorating a non-`static` member).
260
+ */
261
+ addInitializer(initializer: (this: This) => void): void;
262
+ }
263
+
264
+ /**
265
+ * Describes the target provided to class `accessor` field decorators.
266
+ * @template This The `this` type to which the target applies.
267
+ * @template Value The property type for the class `accessor` field.
268
+ */
269
+ interface ClassAccessorDecoratorTarget<This, Value> {
270
+ /**
271
+ * Invokes the getter that was defined prior to decorator application.
272
+ *
273
+ * @example
274
+ * let value = target.get.call(instance);
275
+ */
276
+ get(this: This): Value;
277
+
278
+ /**
279
+ * Invokes the setter that was defined prior to decorator application.
280
+ *
281
+ * @example
282
+ * target.set.call(instance, value);
283
+ */
284
+ set(this: This, value: Value): void;
285
+ }
286
+
287
+ /**
288
+ * Describes the allowed return value from a class `accessor` field decorator.
289
+ * @template This The `this` type to which the target applies.
290
+ * @template Value The property type for the class `accessor` field.
291
+ */
292
+ interface ClassAccessorDecoratorResult<This, Value> {
293
+ /**
294
+ * An optional replacement getter function. If not provided, the existing getter function is used instead.
295
+ */
296
+ get?(this: This): Value;
297
+
298
+ /**
299
+ * An optional replacement setter function. If not provided, the existing setter function is used instead.
300
+ */
301
+ set?(this: This, value: Value): void;
302
+
303
+ /**
304
+ * An optional initializer mutator that is invoked when the underlying field initializer is evaluated.
305
+ * @param value The incoming initializer value.
306
+ * @returns The replacement initializer value.
307
+ */
308
+ init?(this: This, value: Value): Value;
309
+ }
310
+
311
+ /**
312
+ * Context provided to a class field decorator.
313
+ * @template This The type on which the class element will be defined. For a static class element, this will be
314
+ * the type of the constructor. For a non-static class element, this will be the type of the instance.
315
+ * @template Value The type of the decorated class field.
316
+ */
317
+ interface ClassFieldDecoratorContext<
318
+ This = unknown,
319
+ Value = unknown,
320
+ > {
321
+ /** The kind of class member that was decorated. */
322
+ readonly kind: "field";
323
+
324
+ /** The name of the decorated class member. */
325
+ readonly name: string | symbol;
326
+
327
+ /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */
328
+ readonly static: boolean;
329
+
330
+ /** A value indicating whether the class member has a private name. */
331
+ readonly private: boolean;
332
+
333
+ /** An object that can be used to access the current value of the class member at runtime. */
334
+ readonly access: {
335
+ /**
336
+ * Gets the value of the field on the provided receiver.
337
+ */
338
+ get(this: This): Value;
339
+
340
+ /**
341
+ * Sets the value of the field on the provided receiver.
342
+ */
343
+ set(this: This, value: Value): void;
344
+ };
345
+
346
+ /**
347
+ * Adds a callback to be invoked either before static initializers are run (when
348
+ * decorating a `static` member), or before instance initializers are run (when
349
+ * decorating a non-`static` member).
350
+ */
351
+ addInitializer(initializer: (this: This) => void): void;
352
+ }
@@ -0,0 +1,24 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+
18
+ /// <reference no-default-lib="true"/>
19
+
20
+
21
+ declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
22
+ declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
23
+ declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
24
+ declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
@@ -25,3 +25,4 @@ and limitations under the License.
25
25
  /// <reference lib="es2022.object" />
26
26
  /// <reference lib="es2022.sharedmemory" />
27
27
  /// <reference lib="es2022.string" />
28
+ /// <reference lib="es2022.regexp" />
@@ -0,0 +1,41 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+
18
+ /// <reference no-default-lib="true"/>
19
+
20
+
21
+ interface RegExpMatchArray {
22
+ indices?: RegExpIndicesArray;
23
+ }
24
+
25
+ interface RegExpExecArray {
26
+ indices?: RegExpIndicesArray;
27
+ }
28
+
29
+ interface RegExpIndicesArray extends Array<[number, number]> {
30
+ groups?: {
31
+ [key: string]: [number, number];
32
+ };
33
+ }
34
+
35
+ interface RegExp {
36
+ /**
37
+ * Returns a Boolean value indicating the state of the hasIndices flag (d) used with with a regular expression.
38
+ * Default is false. Read-only.
39
+ */
40
+ readonly hasIndices: boolean;
41
+ }
package/lib/lib.es5.d.ts CHANGED
@@ -18,6 +18,9 @@ and limitations under the License.
18
18
  /// <reference no-default-lib="true"/>
19
19
 
20
20
 
21
+ /// <reference lib="decorators" />
22
+ /// <reference lib="decorators.legacy" />
23
+
21
24
  /////////////////////////////
22
25
  /// ECMAScript APIs
23
26
  /////////////////////////////
@@ -1137,6 +1140,13 @@ interface JSON {
1137
1140
  * If a member contains nested objects, the nested objects are transformed before the parent object is.
1138
1141
  */
1139
1142
  parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;
1143
+ /**
1144
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
1145
+ * @param value A JavaScript value, usually an object or array, to be converted.
1146
+ * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
1147
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
1148
+ */
1149
+ stringify(value: Function | Symbol | undefined, replacer?: (number | string)[] | null, space?: string | number): undefined;
1140
1150
  /**
1141
1151
  * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
1142
1152
  * @param value A JavaScript value, usually an object or array, to be converted.
@@ -1503,11 +1513,6 @@ interface TypedPropertyDescriptor<T> {
1503
1513
  set?: (value: T) => void;
1504
1514
  }
1505
1515
 
1506
- declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
1507
- declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
1508
- declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
1509
- declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
1510
-
1511
1516
  declare type PromiseConstructorLike = new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void) => PromiseLike<T>;
1512
1517
 
1513
1518
  interface PromiseLike<T> {