typescript 4.6.0-dev.20220211 → 4.7.0-dev.20220217

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.
@@ -14,7 +14,7 @@ and limitations under the License.
14
14
  ***************************************************************************** */
15
15
 
16
16
  declare namespace ts {
17
- const versionMajorMinor = "4.6";
17
+ const versionMajorMinor = "4.7";
18
18
  /** The version of the TypeScript compiler release */
19
19
  const version: string;
20
20
  /**
@@ -572,7 +572,7 @@ declare namespace ts {
572
572
  }
573
573
  export interface JSDocContainer {
574
574
  }
575
- export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | EndOfFileToken;
575
+ export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | CaseClause | EndOfFileToken;
576
576
  export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
577
577
  export type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
578
578
  export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
@@ -901,7 +901,7 @@ declare namespace ts {
901
901
  readonly parameterName: Identifier | ThisTypeNode;
902
902
  readonly type?: TypeNode;
903
903
  }
904
- export interface TypeQueryNode extends TypeNode {
904
+ export interface TypeQueryNode extends NodeWithTypeArguments {
905
905
  readonly kind: SyntaxKind.TypeQuery;
906
906
  readonly exprName: EntityName;
907
907
  }
@@ -1285,9 +1285,8 @@ declare namespace ts {
1285
1285
  export interface ImportCall extends CallExpression {
1286
1286
  readonly expression: ImportExpression;
1287
1287
  }
1288
- export interface ExpressionWithTypeArguments extends NodeWithTypeArguments {
1288
+ export interface ExpressionWithTypeArguments extends MemberExpression, NodeWithTypeArguments {
1289
1289
  readonly kind: SyntaxKind.ExpressionWithTypeArguments;
1290
- readonly parent: HeritageClause | JSDocAugmentsTag | JSDocImplementsTag;
1291
1290
  readonly expression: LeftHandSideExpression;
1292
1291
  }
1293
1292
  export interface NewExpression extends PrimaryExpression, Declaration {
@@ -1498,7 +1497,7 @@ declare namespace ts {
1498
1497
  readonly parent: SwitchStatement;
1499
1498
  readonly clauses: NodeArray<CaseOrDefaultClause>;
1500
1499
  }
1501
- export interface CaseClause extends Node {
1500
+ export interface CaseClause extends Node, JSDocContainer {
1502
1501
  readonly kind: SyntaxKind.CaseClause;
1503
1502
  readonly parent: CaseBlock;
1504
1503
  readonly expression: Expression;
@@ -1749,6 +1748,7 @@ declare namespace ts {
1749
1748
  }
1750
1749
  export interface FileReference extends TextRange {
1751
1750
  fileName: string;
1751
+ resolutionMode?: SourceFile["impliedNodeFormat"];
1752
1752
  }
1753
1753
  export interface CheckJsDirective extends TextRange {
1754
1754
  enabled: boolean;
@@ -2074,7 +2074,7 @@ declare namespace ts {
2074
2074
  readonly prologues: readonly UnparsedPrologue[];
2075
2075
  helpers: readonly UnscopedEmitHelper[] | undefined;
2076
2076
  referencedFiles: readonly FileReference[];
2077
- typeReferenceDirectives: readonly string[] | undefined;
2077
+ typeReferenceDirectives: readonly FileReference[] | undefined;
2078
2078
  libReferenceDirectives: readonly FileReference[];
2079
2079
  hasNoDefaultLib?: boolean;
2080
2080
  sourceMapPath?: string;
@@ -2661,6 +2661,7 @@ declare namespace ts {
2661
2661
  ClassOrInterface = 3,
2662
2662
  ContainsSpread = 4194304,
2663
2663
  ObjectRestType = 8388608,
2664
+ InstantiationExpressionType = 16777216,
2664
2665
  }
2665
2666
  export interface ObjectType extends Type {
2666
2667
  objectFlags: ObjectFlags;
@@ -3223,7 +3224,7 @@ declare namespace ts {
3223
3224
  /**
3224
3225
  * This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files
3225
3226
  */
3226
- resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
3227
+ resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
3227
3228
  getEnvironmentVariable?(name: string): string | undefined;
3228
3229
  createHash?(data: string): string;
3229
3230
  getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
@@ -3396,8 +3397,8 @@ declare namespace ts {
3396
3397
  updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly Modifier[] | undefined, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): ConstructorTypeNode;
3397
3398
  /** @deprecated */
3398
3399
  updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): ConstructorTypeNode;
3399
- createTypeQueryNode(exprName: EntityName): TypeQueryNode;
3400
- updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName): TypeQueryNode;
3400
+ createTypeQueryNode(exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
3401
+ updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
3401
3402
  createTypeLiteralNode(members: readonly TypeElement[] | undefined): TypeLiteralNode;
3402
3403
  updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray<TypeElement>): TypeLiteralNode;
3403
3404
  createArrayTypeNode(elementType: TypeNode): ArrayTypeNode;
@@ -4057,6 +4058,13 @@ declare namespace ts {
4057
4058
  readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
4058
4059
  readonly provideRefactorNotApplicableReason?: boolean;
4059
4060
  readonly jsxAttributeCompletionStyle?: "auto" | "braces" | "none";
4061
+ readonly includeInlayParameterNameHints?: "none" | "literals" | "all";
4062
+ readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
4063
+ readonly includeInlayFunctionParameterTypeHints?: boolean;
4064
+ readonly includeInlayVariableTypeHints?: boolean;
4065
+ readonly includeInlayPropertyDeclarationTypeHints?: boolean;
4066
+ readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
4067
+ readonly includeInlayEnumMemberValueHints?: boolean;
4060
4068
  }
4061
4069
  /** Represents a bigint literal value without requiring bigint support */
4062
4070
  export interface PseudoBigInt {
@@ -4855,7 +4863,7 @@ declare namespace ts {
4855
4863
  * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
4856
4864
  * is assumed to be the same as root directory of the project.
4857
4865
  */
4858
- export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
4866
+ export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache, resolutionMode?: SourceFile["impliedNodeFormat"]): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
4859
4867
  /**
4860
4868
  * Given a set of options, returns the set of type directive names
4861
4869
  * that should be included for this program automatically.
@@ -5276,7 +5284,7 @@ declare namespace ts {
5276
5284
  /** If provided, used to resolve the module names, otherwise typescript's default module resolution */
5277
5285
  resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
5278
5286
  /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
5279
- resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
5287
+ resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
5280
5288
  }
5281
5289
  interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost {
5282
5290
  /** Instead of using output d.ts file from project reference, use its source file */
@@ -5672,7 +5680,7 @@ declare namespace ts {
5672
5680
  getTypeRootsVersion?(): number;
5673
5681
  resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
5674
5682
  getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string, resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations | undefined;
5675
- resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
5683
+ resolveTypeReferenceDirectives?(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
5676
5684
  getDirectories?(directoryName: string): string[];
5677
5685
  /**
5678
5686
  * Gets a set of custom transformers to use during emit.
@@ -5881,15 +5889,6 @@ declare namespace ts {
5881
5889
  /** @deprecated Use includeCompletionsWithInsertText */
5882
5890
  includeInsertTextCompletions?: boolean;
5883
5891
  }
5884
- interface InlayHintsOptions extends UserPreferences {
5885
- readonly includeInlayParameterNameHints?: "none" | "literals" | "all";
5886
- readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
5887
- readonly includeInlayFunctionParameterTypeHints?: boolean;
5888
- readonly includeInlayVariableTypeHints?: boolean;
5889
- readonly includeInlayPropertyDeclarationTypeHints?: boolean;
5890
- readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
5891
- readonly includeInlayEnumMemberValueHints?: boolean;
5892
- }
5893
5892
  type SignatureHelpTriggerCharacter = "," | "(" | "<";
5894
5893
  type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
5895
5894
  interface SignatureHelpItemsOptions {
@@ -6693,7 +6692,7 @@ declare namespace ts {
6693
6692
  cancellationToken: CancellationToken;
6694
6693
  host: LanguageServiceHost;
6695
6694
  span: TextSpan;
6696
- preferences: InlayHintsOptions;
6695
+ preferences: UserPreferences;
6697
6696
  }
6698
6697
  }
6699
6698
  declare namespace ts {
@@ -6938,9 +6937,9 @@ declare namespace ts {
6938
6937
  /** @deprecated Use `factory.updateConstructorTypeNode` or the factory supplied by your transformation context instead. */
6939
6938
  const updateConstructorTypeNode: (node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode) => ConstructorTypeNode;
6940
6939
  /** @deprecated Use `factory.createTypeQueryNode` or the factory supplied by your transformation context instead. */
6941
- const createTypeQueryNode: (exprName: EntityName) => TypeQueryNode;
6940
+ const createTypeQueryNode: (exprName: EntityName, typeArguments?: readonly TypeNode[] | undefined) => TypeQueryNode;
6942
6941
  /** @deprecated Use `factory.updateTypeQueryNode` or the factory supplied by your transformation context instead. */
6943
- const updateTypeQueryNode: (node: TypeQueryNode, exprName: EntityName) => TypeQueryNode;
6942
+ const updateTypeQueryNode: (node: TypeQueryNode, exprName: EntityName, typeArguments?: readonly TypeNode[] | undefined) => TypeQueryNode;
6944
6943
  /** @deprecated Use `factory.createTypeLiteralNode` or the factory supplied by your transformation context instead. */
6945
6944
  const createTypeLiteralNode: (members: readonly TypeElement[] | undefined) => TypeLiteralNode;
6946
6945
  /** @deprecated Use `factory.updateTypeLiteralNode` or the factory supplied by your transformation context instead. */