@typescript-deploys/pr-build 4.9.0-pr-49929-7 → 4.9.0-pr-50776-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.
@@ -3320,6 +3320,7 @@ declare namespace ts {
3320
3320
  */
3321
3321
  resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
3322
3322
  getEnvironmentVariable?(name: string): string | undefined;
3323
+ hasInvalidatedResolution?(filePath: Path): boolean;
3323
3324
  createHash?(data: string): string;
3324
3325
  getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
3325
3326
  }
@@ -3765,10 +3766,10 @@ declare namespace ts {
3765
3766
  updateJSDocReadonlyTag(node: JSDocReadonlyTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocReadonlyTag;
3766
3767
  createJSDocUnknownTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocUnknownTag;
3767
3768
  updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: string | NodeArray<JSDocComment> | undefined): JSDocUnknownTag;
3768
- createJSDocDeprecatedTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
3769
- updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
3770
- createJSDocOverrideTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
3771
- updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
3769
+ createJSDocDeprecatedTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
3770
+ updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
3771
+ createJSDocOverrideTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
3772
+ updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
3772
3773
  createJSDocText(text: string): JSDocText;
3773
3774
  updateJSDocText(node: JSDocText, text: string): JSDocText;
3774
3775
  createJSDocComment(comment?: string | NodeArray<JSDocComment> | undefined, tags?: readonly JSDocTag[] | undefined): JSDoc;
@@ -3950,45 +3951,24 @@ declare namespace ts {
3950
3951
  * A function that is used to initialize and return a `Transformer` callback, which in turn
3951
3952
  * will be used to transform one or more nodes.
3952
3953
  */
3953
- export type TransformerFactory<TIn extends Node, TOut extends Node | undefined = TIn> = (context: TransformationContext) => Transformer<TIn, TOut>;
3954
+ export type TransformerFactory<T extends Node> = (context: TransformationContext) => Transformer<T>;
3954
3955
  /**
3955
3956
  * A function that transforms a node.
3956
3957
  */
3957
- export type Transformer<TIn extends Node, TOut extends Node | undefined = TIn> = (node: TIn) => TOut;
3958
- export type VisitResult<T extends Node | undefined> = T | readonly Node[];
3958
+ export type Transformer<T extends Node> = (node: T) => T;
3959
3959
  /**
3960
3960
  * A function that accepts and possibly transforms a node.
3961
3961
  */
3962
- export type Visitor<TIn extends Node = Node, TOut extends Node | undefined = TIn> = (node: TIn) => VisitResult<TOut>;
3963
- /**
3964
- * A function that walks a node using the given visitor, lifting node arrays into single nodes,
3965
- * returning an node which satisfies the test.
3966
- *
3967
- * This type is complicated, but intends to encode the following behaviors:
3968
- *
3969
- * - If the input node is potentially undefined, the output is potentially undefined.
3970
- * - If the visitor can return undefined, the output is potentially undefined.
3971
- * - If the output node is not undefined, then it will satisfy the test.
3972
- *
3973
- * @see {visitNode}
3974
- */
3962
+ export type Visitor = (node: Node) => VisitResult<Node>;
3975
3963
  export interface NodeVisitor {
3976
- <TIn extends Node | undefined, TVisited extends Node | undefined, TAssert extends NonNullable<TVisited>, TOut extends TIn extends undefined ? TAssert | undefined : TVisited extends undefined ? TAssert | undefined : TAssert>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited> | undefined, test?: ((node: Node) => node is TAssert) | ((node: Node) => boolean), lift?: (node: readonly Node[]) => Node): TOut;
3964
+ <T extends Node>(nodes: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T;
3965
+ <T extends Node>(nodes: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined;
3977
3966
  }
3978
- /**
3979
- * A function that walks a node array using the given visitor, returning an array whose contents satisfy the test.
3980
- *
3981
- * This type is complicated, but intends to encode the following behaviors:
3982
- *
3983
- * - If the input node array is potentially undefined, the output is potentially undefined.
3984
- * - If the visitor can return undefined, the output may not be undefined; these nodes will be left in the output.
3985
- * - If the output node array is not undefined, then its contents will satisfy the test.
3986
- *
3987
- * @see {visitNodes}
3988
- */
3989
3967
  export interface NodesVisitor {
3990
- <TIn extends Node, TArray extends NodeArray<TIn> | undefined, TVisited extends Node | undefined, TAssert extends NonNullable<TVisited>, TOutArray extends TArray extends undefined ? NodeArray<TAssert> | undefined : NodeArray<TAssert>>(nodes: TArray, visitor: Visitor<TIn, TVisited> | undefined, test?: ((node: Node) => node is TAssert) | ((node: Node) => boolean), start?: number, count?: number): TOutArray;
3968
+ <T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
3969
+ <T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
3991
3970
  }
3971
+ export type VisitResult<T extends Node> = T | readonly T[] | undefined;
3992
3972
  export interface Printer {
3993
3973
  /**
3994
3974
  * Print a node and its subtree as-is, without any emit transformations.
@@ -4307,8 +4287,8 @@ declare namespace ts {
4307
4287
  function forEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
4308
4288
  function forEachTrailingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined;
4309
4289
  function forEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
4310
- 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;
4311
- 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;
4290
+ 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;
4291
+ 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;
4312
4292
  function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
4313
4293
  function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
4314
4294
  /** Optionally, get the shebang */
@@ -4354,7 +4334,7 @@ declare namespace ts {
4354
4334
  };
4355
4335
  function isParameterPropertyDeclaration(node: Node, parent: Node): node is ParameterPropertyDeclaration;
4356
4336
  function isEmptyBindingPattern(node: BindingName): node is BindingPattern;
4357
- function isEmptyBindingElement(node: BindingElement | ArrayBindingElement): boolean;
4337
+ function isEmptyBindingElement(node: BindingElement): boolean;
4358
4338
  function walkUpBindingElementsAndPatterns(binding: BindingElement): VariableDeclaration | ParameterDeclaration;
4359
4339
  function getCombinedModifierFlags(node: Declaration): ModifierFlags;
4360
4340
  function getCombinedNodeFlags(node: Node): NodeFlags;
@@ -4371,7 +4351,7 @@ declare namespace ts {
4371
4351
  function getOriginalNode(node: Node): Node;
4372
4352
  function getOriginalNode<T extends Node>(node: Node, nodeTest: (node: Node) => node is T): T;
4373
4353
  function getOriginalNode(node: Node | undefined): Node | undefined;
4374
- function getOriginalNode<T extends Node>(node: Node | undefined, nodeTest: (node: Node) => node is T): T | undefined;
4354
+ function getOriginalNode<T extends Node>(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined;
4375
4355
  /**
4376
4356
  * Iterates through the parent chain of a node and performs the callback on each parent until the callback
4377
4357
  * returns a truthy value, then returns that value.
@@ -4567,7 +4547,6 @@ declare namespace ts {
4567
4547
  */
4568
4548
  function isTypeNode(node: Node): node is TypeNode;
4569
4549
  function isFunctionOrConstructorTypeNode(node: Node): node is FunctionTypeNode | ConstructorTypeNode;
4570
- function isBindingOrAssignmentElement(node: Node): node is BindingOrAssignmentElement;
4571
4550
  function isPropertyAccessOrQualifiedName(node: Node): node is PropertyAccessExpression | QualifiedName;
4572
4551
  function isCallLikeExpression(node: Node): node is CallLikeExpression;
4573
4552
  function isCallOrNewExpression(node: Node): node is CallExpression | NewExpression;
@@ -5084,7 +5063,26 @@ declare namespace ts {
5084
5063
  * @param test A callback to execute to verify the Node is valid.
5085
5064
  * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
5086
5065
  */
5087
- function visitNode<TIn extends Node | undefined, TVisited extends Node | undefined, TAssert extends NonNullable<TVisited>, TOut extends TIn extends undefined ? TAssert | undefined : TVisited extends undefined ? TAssert | undefined : TAssert>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited> | undefined, test?: ((node: Node) => node is TAssert) | ((node: Node) => boolean), lift?: (node: readonly Node[]) => Node): TOut;
5066
+ function visitNode<T extends Node>(node: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T;
5067
+ /**
5068
+ * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
5069
+ *
5070
+ * @param node The Node to visit.
5071
+ * @param visitor The callback used to visit the Node.
5072
+ * @param test A callback to execute to verify the Node is valid.
5073
+ * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
5074
+ */
5075
+ function visitNode<T extends Node>(node: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined;
5076
+ /**
5077
+ * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
5078
+ *
5079
+ * @param nodes The NodeArray to visit.
5080
+ * @param visitor The callback used to visit a Node.
5081
+ * @param test A node test to execute for each node.
5082
+ * @param start An optional value indicating the starting offset at which to start visiting.
5083
+ * @param count An optional value indicating the maximum number of nodes to visit.
5084
+ */
5085
+ function visitNodes<T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
5088
5086
  /**
5089
5087
  * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
5090
5088
  *
@@ -5094,37 +5092,37 @@ declare namespace ts {
5094
5092
  * @param start An optional value indicating the starting offset at which to start visiting.
5095
5093
  * @param count An optional value indicating the maximum number of nodes to visit.
5096
5094
  */
5097
- function visitNodes<TIn extends Node, TArray extends NodeArray<TIn> | undefined, TVisited extends Node | undefined, TAssert extends NonNullable<TVisited>, TOutArray extends TArray extends undefined ? NodeArray<TAssert> | undefined : NodeArray<TAssert>>(nodes: TArray, visitor: Visitor<TIn, TVisited> | undefined, test?: ((node: Node) => node is TAssert) | ((node: Node) => boolean), start?: number, count?: number): TOutArray;
5095
+ function visitNodes<T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
5098
5096
  /**
5099
5097
  * Starts a new lexical environment and visits a statement list, ending the lexical environment
5100
5098
  * and merging hoisted declarations upon completion.
5101
5099
  */
5102
- function visitLexicalEnvironment(statements: NodeArray<Statement>, visitor: Visitor<Node, Node | undefined>, context: TransformationContext, start?: number, ensureUseStrict?: boolean, nodesVisitor?: NodesVisitor): NodeArray<Statement>;
5100
+ function visitLexicalEnvironment(statements: NodeArray<Statement>, visitor: Visitor, context: TransformationContext, start?: number, ensureUseStrict?: boolean, nodesVisitor?: NodesVisitor): NodeArray<Statement>;
5103
5101
  /**
5104
5102
  * Starts a new lexical environment and visits a parameter list, suspending the lexical
5105
5103
  * environment upon completion.
5106
5104
  */
5107
- function visitParameterList(nodes: NodeArray<ParameterDeclaration>, visitor: Visitor<Node, Node | undefined>, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration>;
5108
- function visitParameterList(nodes: NodeArray<ParameterDeclaration> | undefined, visitor: Visitor<Node, Node | undefined>, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration> | undefined;
5105
+ function visitParameterList(nodes: NodeArray<ParameterDeclaration>, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration>;
5106
+ function visitParameterList(nodes: NodeArray<ParameterDeclaration> | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration> | undefined;
5109
5107
  /**
5110
5108
  * Resumes a suspended lexical environment and visits a function body, ending the lexical
5111
5109
  * environment and merging hoisted declarations upon completion.
5112
5110
  */
5113
- function visitFunctionBody(node: FunctionBody, visitor: Visitor<Node, Node | undefined>, context: TransformationContext): FunctionBody;
5111
+ function visitFunctionBody(node: FunctionBody, visitor: Visitor, context: TransformationContext): FunctionBody;
5114
5112
  /**
5115
5113
  * Resumes a suspended lexical environment and visits a function body, ending the lexical
5116
5114
  * environment and merging hoisted declarations upon completion.
5117
5115
  */
5118
- function visitFunctionBody(node: FunctionBody | undefined, visitor: Visitor<Node, Node | undefined>, context: TransformationContext): FunctionBody | undefined;
5116
+ function visitFunctionBody(node: FunctionBody | undefined, visitor: Visitor, context: TransformationContext): FunctionBody | undefined;
5119
5117
  /**
5120
5118
  * Resumes a suspended lexical environment and visits a concise body, ending the lexical
5121
5119
  * environment and merging hoisted declarations upon completion.
5122
5120
  */
5123
- function visitFunctionBody(node: ConciseBody, visitor: Visitor<Node, Node | undefined>, context: TransformationContext): ConciseBody;
5121
+ function visitFunctionBody(node: ConciseBody, visitor: Visitor, context: TransformationContext): ConciseBody;
5124
5122
  /**
5125
5123
  * Visits an iteration body, adding any block-scoped variables required by the transformation.
5126
5124
  */
5127
- function visitIterationBody(body: Statement, visitor: Visitor<Node, Node | undefined>, context: TransformationContext): Statement;
5125
+ function visitIterationBody(body: Statement, visitor: Visitor, context: TransformationContext): Statement;
5128
5126
  /**
5129
5127
  * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
5130
5128
  *
@@ -5132,7 +5130,7 @@ declare namespace ts {
5132
5130
  * @param visitor The callback used to visit each child.
5133
5131
  * @param context A lexical environment context for the visitor.
5134
5132
  */
5135
- function visitEachChild<T extends Node>(node: T, visitor: Visitor<Node, Node | undefined>, context: TransformationContext): T;
5133
+ function visitEachChild<T extends Node>(node: T, visitor: Visitor, context: TransformationContext): T;
5136
5134
  /**
5137
5135
  * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
5138
5136
  *
@@ -5140,7 +5138,7 @@ declare namespace ts {
5140
5138
  * @param visitor The callback used to visit each child.
5141
5139
  * @param context A lexical environment context for the visitor.
5142
5140
  */
5143
- function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor<Node, Node | undefined>, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
5141
+ function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
5144
5142
  }
5145
5143
  declare namespace ts {
5146
5144
  function getTsBuildInfoEmitOutputFilePath(options: CompilerOptions): string | undefined;
@@ -5445,6 +5443,8 @@ declare namespace ts {
5445
5443
  resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
5446
5444
  /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
5447
5445
  resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
5446
+ /** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */
5447
+ hasInvalidatedResolution?(filePath: Path): boolean;
5448
5448
  /**
5449
5449
  * Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it
5450
5450
  */