@typescript-deploys/pr-build 5.7.0-pr-57718-9 → 5.8.0-pr-57838-3

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/_tsserver.js CHANGED
@@ -283,13 +283,7 @@ function initializeNodeSystem() {
283
283
  return (_a = global.gc) == null ? void 0 : _a.call(global);
284
284
  };
285
285
  }
286
- let cancellationToken;
287
- try {
288
- const factory = require("./cancellationToken.js");
289
- cancellationToken = factory(sys4.args);
290
- } catch {
291
- cancellationToken = typescript_exports.server.nullCancellationToken;
292
- }
286
+ const cancellationToken = createCancellationToken(sys4.args);
293
287
  const localeStr = typescript_exports.server.findArgument("--locale");
294
288
  if (localeStr) {
295
289
  (0, typescript_exports.validateLocaleAndSetLanguage)(localeStr, sys4);
@@ -577,6 +571,48 @@ function startNodeSession(options, logger, cancellationToken) {
577
571
  return (0, typescript_exports.combinePaths)((0, typescript_exports.normalizeSlashes)(homePath), cacheFolder);
578
572
  }
579
573
  }
574
+ function pipeExists(name) {
575
+ return import_fs.default.existsSync(name);
576
+ }
577
+ function createCancellationToken(args) {
578
+ let cancellationPipeName;
579
+ for (let i = 0; i < args.length - 1; i++) {
580
+ if (args[i] === "--cancellationPipeName") {
581
+ cancellationPipeName = args[i + 1];
582
+ break;
583
+ }
584
+ }
585
+ if (!cancellationPipeName) {
586
+ return typescript_exports.server.nullCancellationToken;
587
+ }
588
+ if (cancellationPipeName.charAt(cancellationPipeName.length - 1) === "*") {
589
+ const namePrefix = cancellationPipeName.slice(0, -1);
590
+ if (namePrefix.length === 0 || namePrefix.includes("*")) {
591
+ throw new Error("Invalid name for template cancellation pipe: it should have length greater than 2 characters and contain only one '*'.");
592
+ }
593
+ let perRequestPipeName;
594
+ let currentRequestId;
595
+ return {
596
+ isCancellationRequested: () => perRequestPipeName !== void 0 && pipeExists(perRequestPipeName),
597
+ setRequest(requestId) {
598
+ currentRequestId = requestId;
599
+ perRequestPipeName = namePrefix + requestId;
600
+ },
601
+ resetRequest(requestId) {
602
+ if (currentRequestId !== requestId) {
603
+ throw new Error(`Mismatched request id, expected ${currentRequestId}, actual ${requestId}`);
604
+ }
605
+ perRequestPipeName = void 0;
606
+ }
607
+ };
608
+ } else {
609
+ return {
610
+ isCancellationRequested: () => pipeExists(cancellationPipeName),
611
+ setRequest: (_requestId) => void 0,
612
+ resetRequest: (_requestId) => void 0
613
+ };
614
+ }
615
+ }
580
616
 
581
617
  // src/tsserver/server.ts
582
618
  function findArgumentStringArray(argName) {
@@ -110,9 +110,9 @@ interface ClassMethodDecoratorContext<
110
110
  };
111
111
 
112
112
  /**
113
- * Adds a callback to be invoked either before static initializers are run (when
114
- * decorating a `static` element), or before instance initializers are run (when
115
- * decorating a non-`static` element).
113
+ * Adds a callback to be invoked either after static methods are defined but before
114
+ * static initializers are run (when decorating a `static` element), or before instance
115
+ * initializers are run (when decorating a non-`static` element).
116
116
  *
117
117
  * @example
118
118
  * ```ts
@@ -176,9 +176,9 @@ interface ClassGetterDecoratorContext<
176
176
  };
177
177
 
178
178
  /**
179
- * Adds a callback to be invoked either before static initializers are run (when
180
- * decorating a `static` element), or before instance initializers are run (when
181
- * decorating a non-`static` element).
179
+ * Adds a callback to be invoked either after static methods are defined but before
180
+ * static initializers are run (when decorating a `static` element), or before instance
181
+ * initializers are run (when decorating a non-`static` element).
182
182
  */
183
183
  addInitializer(initializer: (this: This) => void): void;
184
184
 
@@ -223,9 +223,9 @@ interface ClassSetterDecoratorContext<
223
223
  };
224
224
 
225
225
  /**
226
- * Adds a callback to be invoked either before static initializers are run (when
227
- * decorating a `static` element), or before instance initializers are run (when
228
- * decorating a non-`static` element).
226
+ * Adds a callback to be invoked either after static methods are defined but before
227
+ * static initializers are run (when decorating a `static` element), or before instance
228
+ * initializers are run (when decorating a non-`static` element).
229
229
  */
230
230
  addInitializer(initializer: (this: This) => void): void;
231
231
 
@@ -279,9 +279,8 @@ interface ClassAccessorDecoratorContext<
279
279
  };
280
280
 
281
281
  /**
282
- * Adds a callback to be invoked either before static initializers are run (when
283
- * decorating a `static` element), or before instance initializers are run (when
284
- * decorating a non-`static` element).
282
+ * Adds a callback to be invoked immediately after the auto `accessor` being
283
+ * decorated is initialized (regardless if the `accessor` is `static` or not).
285
284
  */
286
285
  addInitializer(initializer: (this: This) => void): void;
287
286
 
@@ -376,9 +375,8 @@ interface ClassFieldDecoratorContext<
376
375
  };
377
376
 
378
377
  /**
379
- * Adds a callback to be invoked either before static initializers are run (when
380
- * decorating a `static` element), or before instance initializers are run (when
381
- * decorating a non-`static` element).
378
+ * Adds a callback to be invoked immediately after the field being decorated
379
+ * is initialized (regardless if the field is `static` or not).
382
380
  */
383
381
  addInitializer(initializer: (this: This) => void): void;
384
382
 
@@ -391,6 +391,7 @@ interface BigInt64ArrayConstructor {
391
391
  new (length?: number): BigInt64Array<ArrayBuffer>;
392
392
  new (array: ArrayLike<bigint> | Iterable<bigint>): BigInt64Array<ArrayBuffer>;
393
393
  new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): BigInt64Array<TArrayBuffer>;
394
+ new (array: ArrayLike<bigint> | ArrayBuffer): BigInt64Array<ArrayBuffer>;
394
395
 
395
396
  /** The size in bytes of each element in the array. */
396
397
  readonly BYTES_PER_ELEMENT: number;
@@ -667,6 +668,7 @@ interface BigUint64ArrayConstructor {
667
668
  new (length?: number): BigUint64Array<ArrayBuffer>;
668
669
  new (array: ArrayLike<bigint> | Iterable<bigint>): BigUint64Array<ArrayBuffer>;
669
670
  new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): BigUint64Array<TArrayBuffer>;
671
+ new (array: ArrayLike<bigint> | ArrayBuffer): BigUint64Array<ArrayBuffer>;
670
672
 
671
673
  /** The size in bytes of each element in the array. */
672
674
  readonly BYTES_PER_ELEMENT: number;
package/lib/lib.es5.d.ts CHANGED
@@ -696,7 +696,7 @@ interface Math {
696
696
  */
697
697
  atan(x: number): number;
698
698
  /**
699
- * Returns the angle (in radians) from the X axis to a point.
699
+ * Returns the angle (in radians) between the X axis and the line going through both the origin and the given point.
700
700
  * @param y A numeric expression representing the cartesian y-coordinate.
701
701
  * @param x A numeric expression representing the cartesian x-coordinate.
702
702
  */
@@ -23,3 +23,4 @@ and limitations under the License.
23
23
  /// <reference lib="esnext.collection" />
24
24
  /// <reference lib="esnext.array" />
25
25
  /// <reference lib="esnext.iterator" />
26
+ /// <reference lib="esnext.promise" />
@@ -0,0 +1,34 @@
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
+ /// <reference no-default-lib="true"/>
18
+
19
+ interface PromiseConstructor {
20
+ /**
21
+ * Takes a callback of any kind (returns or throws, synchronously or asynchronously) and wraps its result
22
+ * in a Promise.
23
+ *
24
+ * @param callbackFn A function that is called synchronously. It can do anything: either return
25
+ * a value, throw an error, or return a promise.
26
+ * @param args Additional arguments, that will be passed to the callback.
27
+ *
28
+ * @returns A Promise that is:
29
+ * - Already fulfilled, if the callback synchronously returns a value.
30
+ * - Already rejected, if the callback synchronously throws an error.
31
+ * - Asynchronously fulfilled or rejected, if the callback returns a promise.
32
+ */
33
+ try<T, U extends unknown[]>(callbackFn: (...args: U) => T | PromiseLike<T>, ...args: U): Promise<Awaited<T>>;
34
+ }
@@ -123,7 +123,6 @@ declare namespace ts {
123
123
  ProvideInlayHints = "provideInlayHints",
124
124
  WatchChange = "watchChange",
125
125
  MapCode = "mapCode",
126
- CopilotRelated = "copilotRelated",
127
126
  }
128
127
  /**
129
128
  * A TypeScript Server message
@@ -1487,6 +1486,10 @@ declare namespace ts {
1487
1486
  command: CommandTypes.Quickinfo;
1488
1487
  arguments: FileLocationRequestArgs;
1489
1488
  }
1489
+ export interface QuickInfoRequestArgs extends FileLocationRequestArgs {
1490
+ /** TODO */
1491
+ verbosityLevel?: number;
1492
+ }
1490
1493
  /**
1491
1494
  * Body of QuickInfoResponse.
1492
1495
  */
@@ -1520,6 +1523,10 @@ declare namespace ts {
1520
1523
  * JSDoc tags associated with symbol.
1521
1524
  */
1522
1525
  tags: JSDocTagInfo[];
1526
+ /**
1527
+ * TODO
1528
+ */
1529
+ canIncreaseVerbosityLevel?: boolean;
1523
1530
  }
1524
1531
  /**
1525
1532
  * Quickinfo response message.
@@ -1831,16 +1838,6 @@ declare namespace ts {
1831
1838
  export interface MapCodeResponse extends Response {
1832
1839
  body: readonly FileCodeEdits[];
1833
1840
  }
1834
- export interface CopilotRelatedRequest extends FileRequest {
1835
- command: CommandTypes.CopilotRelated;
1836
- arguments: FileRequestArgs;
1837
- }
1838
- export interface CopilotRelatedItems {
1839
- relatedFiles: readonly string[];
1840
- }
1841
- export interface CopilotRelatedResponse extends Response {
1842
- body: CopilotRelatedItems;
1843
- }
1844
1841
  /**
1845
1842
  * Synchronous request for semantic diagnostics of one file.
1846
1843
  */
@@ -3644,7 +3641,7 @@ declare namespace ts {
3644
3641
  readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[] | undefined, depth?: number): string[];
3645
3642
  }
3646
3643
  }
3647
- const versionMajorMinor = "5.7";
3644
+ const versionMajorMinor = "5.8";
3648
3645
  /** The version of the TypeScript compiler release */
3649
3646
  const version: string;
3650
3647
  /**
@@ -7426,8 +7423,9 @@ declare namespace ts {
7426
7423
  NonNullAssertions = 4,
7427
7424
  PartiallyEmittedExpressions = 8,
7428
7425
  ExpressionsWithTypeArguments = 16,
7429
- Assertions = 6,
7430
- All = 31,
7426
+ Satisfies = 32,
7427
+ Assertions = 38,
7428
+ All = 63,
7431
7429
  ExcludeJSDocTypeAssertion = -2147483648,
7432
7430
  }
7433
7431
  type ImmediatelyInvokedFunctionExpression = CallExpression & {
@@ -10757,6 +10755,7 @@ declare namespace ts {
10757
10755
  displayParts?: SymbolDisplayPart[];
10758
10756
  documentation?: SymbolDisplayPart[];
10759
10757
  tags?: JSDocTagInfo[];
10758
+ canIncreaseVerbosityLevel?: boolean;
10760
10759
  }
10761
10760
  type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
10762
10761
  interface RenameInfoSuccess {