@typescript-deploys/pr-build 5.0.0-pr-49929-73 → 5.0.0-pr-52280-2

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.
@@ -400,14 +400,15 @@ declare namespace ts {
400
400
  JSDocSeeTag = 350,
401
401
  JSDocPropertyTag = 351,
402
402
  JSDocThrowsTag = 352,
403
- SyntaxList = 353,
404
- NotEmittedStatement = 354,
405
- PartiallyEmittedExpression = 355,
406
- CommaListExpression = 356,
407
- MergeDeclarationMarker = 357,
408
- EndOfDeclarationMarker = 358,
409
- SyntheticReferenceExpression = 359,
410
- Count = 360,
403
+ JSDocSatisfiesTag = 353,
404
+ SyntaxList = 354,
405
+ NotEmittedStatement = 355,
406
+ PartiallyEmittedExpression = 356,
407
+ CommaListExpression = 357,
408
+ MergeDeclarationMarker = 358,
409
+ EndOfDeclarationMarker = 359,
410
+ SyntheticReferenceExpression = 360,
411
+ Count = 361,
411
412
  FirstAssignment = 63,
412
413
  LastAssignment = 78,
413
414
  FirstCompoundAssignment = 64,
@@ -436,9 +437,9 @@ declare namespace ts {
436
437
  LastStatement = 256,
437
438
  FirstNode = 163,
438
439
  FirstJSDocNode = 312,
439
- LastJSDocNode = 352,
440
+ LastJSDocNode = 353,
440
441
  FirstJSDocTagNode = 330,
441
- LastJSDocTagNode = 352
442
+ LastJSDocTagNode = 353
442
443
  }
443
444
  type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia;
444
445
  type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral;
@@ -2036,6 +2037,10 @@ declare namespace ts {
2036
2037
  /** If true, then this type literal represents an *array* of its type. */
2037
2038
  readonly isArrayType: boolean;
2038
2039
  }
2040
+ interface JSDocSatisfiesTag extends JSDocTag {
2041
+ readonly kind: SyntaxKind.JSDocSatisfiesTag;
2042
+ readonly typeExpression: JSDocTypeExpression;
2043
+ }
2039
2044
  enum FlowFlags {
2040
2045
  Unreachable = 1,
2041
2046
  Start = 2,
@@ -3882,12 +3887,14 @@ declare namespace ts {
3882
3887
  updateJSDocReadonlyTag(node: JSDocReadonlyTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocReadonlyTag;
3883
3888
  createJSDocUnknownTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocUnknownTag;
3884
3889
  updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: string | NodeArray<JSDocComment> | undefined): JSDocUnknownTag;
3885
- createJSDocDeprecatedTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
3886
- updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
3887
- createJSDocOverrideTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
3888
- updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
3890
+ createJSDocDeprecatedTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
3891
+ updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
3892
+ createJSDocOverrideTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
3893
+ updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
3889
3894
  createJSDocThrowsTag(tagName: Identifier, typeExpression: JSDocTypeExpression | undefined, comment?: string | NodeArray<JSDocComment>): JSDocThrowsTag;
3890
3895
  updateJSDocThrowsTag(node: JSDocThrowsTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment?: string | NodeArray<JSDocComment> | undefined): JSDocThrowsTag;
3896
+ createJSDocSatisfiesTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocSatisfiesTag;
3897
+ updateJSDocSatisfiesTag(node: JSDocSatisfiesTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | NodeArray<JSDocComment> | undefined): JSDocSatisfiesTag;
3891
3898
  createJSDocText(text: string): JSDocText;
3892
3899
  updateJSDocText(node: JSDocText, text: string): JSDocText;
3893
3900
  createJSDocComment(comment?: string | NodeArray<JSDocComment> | undefined, tags?: readonly JSDocTag[] | undefined): JSDoc;
@@ -4250,39 +4257,16 @@ declare namespace ts {
4250
4257
  /**
4251
4258
  * A function that accepts and possibly transforms a node.
4252
4259
  */
4253
- type Visitor<TIn extends Node = Node, TOut extends Node | undefined = TIn | undefined> = (node: TIn) => VisitResult<TOut>;
4254
- /**
4255
- * A function that walks a node using the given visitor, lifting node arrays into single nodes,
4256
- * returning an node which satisfies the test.
4257
- *
4258
- * - If the input node is undefined, then the output is undefined.
4259
- * - If the visitor returns undefined, then the output is undefined.
4260
- * - If the output node is not undefined, then it will satisfy the test function.
4261
- * - In order to obtain a return type that is more specific than `Node`, a test
4262
- * function _must_ be provided, and that function must be a type predicate.
4263
- *
4264
- * For the canonical implementation of this type, @see {visitNode}.
4265
- */
4260
+ type Visitor = (node: Node) => VisitResult<Node>;
4266
4261
  interface NodeVisitor {
4267
- <TIn extends Node | undefined, TVisited extends Node | undefined, TOut extends Node>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited>, test: (node: Node) => node is TOut, lift?: (node: readonly Node[]) => Node): TOut | (TIn & undefined) | (TVisited & undefined);
4268
- <TIn extends Node | undefined, TVisited extends Node | undefined>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited>, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => Node): Node | (TIn & undefined) | (TVisited & undefined);
4262
+ <T extends Node>(nodes: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T;
4263
+ <T extends Node>(nodes: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined;
4269
4264
  }
4270
- /**
4271
- * A function that walks a node array using the given visitor, returning an array whose contents satisfy the test.
4272
- *
4273
- * - If the input node array is undefined, the output is undefined.
4274
- * - If the visitor can return undefined, the node it visits in the array will be reused.
4275
- * - If the output node array is not undefined, then its contents will satisfy the test.
4276
- * - In order to obtain a return type that is more specific than `NodeArray<Node>`, a test
4277
- * function _must_ be provided, and that function must be a type predicate.
4278
- *
4279
- * For the canonical implementation of this type, @see {visitNodes}.
4280
- */
4281
4265
  interface NodesVisitor {
4282
- <TIn extends Node, TInArray extends NodeArray<TIn> | undefined, TOut extends Node>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test: (node: Node) => node is TOut, start?: number, count?: number): NodeArray<TOut> | (TInArray & undefined);
4283
- <TIn extends Node, TInArray extends NodeArray<TIn> | undefined>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<Node> | (TInArray & undefined);
4266
+ <T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
4267
+ <T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
4284
4268
  }
4285
- type VisitResult<T extends Node | undefined> = T | readonly Node[];
4269
+ type VisitResult<T extends Node> = T | readonly T[] | undefined;
4286
4270
  interface Printer {
4287
4271
  /**
4288
4272
  * Print a node and its subtree as-is, without any emit transformations.
@@ -4496,7 +4480,6 @@ declare namespace ts {
4496
4480
  }
4497
4481
  type FileWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind, modifiedTime?: Date) => void;
4498
4482
  type DirectoryWatcherCallback = (fileName: string) => void;
4499
- type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
4500
4483
  interface System {
4501
4484
  args: string[];
4502
4485
  newLine: string;
@@ -4555,8 +4538,8 @@ declare namespace ts {
4555
4538
  function forEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
4556
4539
  function forEachTrailingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined;
4557
4540
  function forEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
4558
- function reduceEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T, initial: U): U | undefined;
4559
- function reduceEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T, initial: U): U | undefined;
4541
+ function reduceEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U | undefined;
4542
+ function reduceEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U | undefined;
4560
4543
  function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
4561
4544
  function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
4562
4545
  /** Optionally, get the shebang */
@@ -4635,7 +4618,7 @@ declare namespace ts {
4635
4618
  function getTypeParameterOwner(d: Declaration): Declaration | undefined;
4636
4619
  function isParameterPropertyDeclaration(node: Node, parent: Node): node is ParameterPropertyDeclaration;
4637
4620
  function isEmptyBindingPattern(node: BindingName): node is BindingPattern;
4638
- function isEmptyBindingElement(node: BindingElement | ArrayBindingElement): boolean;
4621
+ function isEmptyBindingElement(node: BindingElement): boolean;
4639
4622
  function walkUpBindingElementsAndPatterns(binding: BindingElement): VariableDeclaration | ParameterDeclaration;
4640
4623
  function getCombinedModifierFlags(node: Declaration): ModifierFlags;
4641
4624
  function getCombinedNodeFlags(node: Node): NodeFlags;
@@ -4652,7 +4635,7 @@ declare namespace ts {
4652
4635
  function getOriginalNode(node: Node): Node;
4653
4636
  function getOriginalNode<T extends Node>(node: Node, nodeTest: (node: Node) => node is T): T;
4654
4637
  function getOriginalNode(node: Node | undefined): Node | undefined;
4655
- function getOriginalNode<T extends Node>(node: Node | undefined, nodeTest: (node: Node) => node is T): T | undefined;
4638
+ function getOriginalNode<T extends Node>(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined;
4656
4639
  /**
4657
4640
  * Iterates through the parent chain of a node and performs the callback on each parent until the callback
4658
4641
  * returns a truthy value, then returns that value.
@@ -4758,6 +4741,7 @@ declare namespace ts {
4758
4741
  function getJSDocReturnTag(node: Node): JSDocReturnTag | undefined;
4759
4742
  /** Gets the JSDoc template tag for the node if present */
4760
4743
  function getJSDocTemplateTag(node: Node): JSDocTemplateTag | undefined;
4744
+ function getJSDocSatisfiesTag(node: Node): JSDocSatisfiesTag | undefined;
4761
4745
  /** Gets the JSDoc type tag for the node if present and valid */
4762
4746
  function getJSDocTypeTag(node: Node): JSDocTypeTag | undefined;
4763
4747
  /**
@@ -5160,6 +5144,7 @@ declare namespace ts {
5160
5144
  function isJSDocUnknownTag(node: Node): node is JSDocUnknownTag;
5161
5145
  function isJSDocPropertyTag(node: Node): node is JSDocPropertyTag;
5162
5146
  function isJSDocImplementsTag(node: Node): node is JSDocImplementsTag;
5147
+ function isJSDocSatisfiesTag(node: Node): node is JSDocSatisfiesTag;
5163
5148
  function isJSDocThrowsTag(node: Node): node is JSDocThrowsTag;
5164
5149
  function setTextRange<T extends TextRange>(range: T, location: TextRange | undefined): T;
5165
5150
  function canHaveModifiers(node: Node): node is HasModifiers;
@@ -5368,65 +5353,41 @@ declare namespace ts {
5368
5353
  /**
5369
5354
  * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
5370
5355
  *
5371
- * - If the input node is undefined, then the output is undefined.
5372
- * - If the visitor returns undefined, then the output is undefined.
5373
- * - If the output node is not undefined, then it will satisfy the test function.
5374
- * - In order to obtain a return type that is more specific than `Node`, a test
5375
- * function _must_ be provided, and that function must be a type predicate.
5376
- *
5377
5356
  * @param node The Node to visit.
5378
5357
  * @param visitor The callback used to visit the Node.
5379
5358
  * @param test A callback to execute to verify the Node is valid.
5380
5359
  * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
5381
5360
  */
5382
- function visitNode<TIn extends Node | undefined, TVisited extends Node | undefined, TOut extends Node>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited>, test: (node: Node) => node is TOut, lift?: (node: readonly Node[]) => Node): TOut | (TIn & undefined) | (TVisited & undefined);
5361
+ function visitNode<T extends Node>(node: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T;
5383
5362
  /**
5384
5363
  * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
5385
5364
  *
5386
- * - If the input node is undefined, then the output is undefined.
5387
- * - If the visitor returns undefined, then the output is undefined.
5388
- * - If the output node is not undefined, then it will satisfy the test function.
5389
- * - In order to obtain a return type that is more specific than `Node`, a test
5390
- * function _must_ be provided, and that function must be a type predicate.
5391
- *
5392
5365
  * @param node The Node to visit.
5393
5366
  * @param visitor The callback used to visit the Node.
5394
5367
  * @param test A callback to execute to verify the Node is valid.
5395
5368
  * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
5396
5369
  */
5397
- function visitNode<TIn extends Node | undefined, TVisited extends Node | undefined>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited>, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => Node): Node | (TIn & undefined) | (TVisited & undefined);
5370
+ function visitNode<T extends Node>(node: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined;
5398
5371
  /**
5399
5372
  * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
5400
5373
  *
5401
- * - If the input node array is undefined, the output is undefined.
5402
- * - If the visitor can return undefined, the node it visits in the array will be reused.
5403
- * - If the output node array is not undefined, then its contents will satisfy the test.
5404
- * - In order to obtain a return type that is more specific than `NodeArray<Node>`, a test
5405
- * function _must_ be provided, and that function must be a type predicate.
5406
- *
5407
5374
  * @param nodes The NodeArray to visit.
5408
5375
  * @param visitor The callback used to visit a Node.
5409
5376
  * @param test A node test to execute for each node.
5410
5377
  * @param start An optional value indicating the starting offset at which to start visiting.
5411
5378
  * @param count An optional value indicating the maximum number of nodes to visit.
5412
5379
  */
5413
- function visitNodes<TIn extends Node, TInArray extends NodeArray<TIn> | undefined, TOut extends Node>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test: (node: Node) => node is TOut, start?: number, count?: number): NodeArray<TOut> | (TInArray & undefined);
5380
+ function visitNodes<T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
5414
5381
  /**
5415
5382
  * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
5416
5383
  *
5417
- * - If the input node array is undefined, the output is undefined.
5418
- * - If the visitor can return undefined, the node it visits in the array will be reused.
5419
- * - If the output node array is not undefined, then its contents will satisfy the test.
5420
- * - In order to obtain a return type that is more specific than `NodeArray<Node>`, a test
5421
- * function _must_ be provided, and that function must be a type predicate.
5422
- *
5423
5384
  * @param nodes The NodeArray to visit.
5424
5385
  * @param visitor The callback used to visit a Node.
5425
5386
  * @param test A node test to execute for each node.
5426
5387
  * @param start An optional value indicating the starting offset at which to start visiting.
5427
5388
  * @param count An optional value indicating the maximum number of nodes to visit.
5428
5389
  */
5429
- function visitNodes<TIn extends Node, TInArray extends NodeArray<TIn> | undefined>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<Node> | (TInArray & undefined);
5390
+ function visitNodes<T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
5430
5391
  /**
5431
5392
  * Starts a new lexical environment and visits a statement list, ending the lexical environment
5432
5393
  * and merging hoisted declarations upon completion.