Skip to content

Commit e5050bb

Browse files
Bump version to 4.7.3 and LKG
1 parent 4c4c803 commit e5050bb

11 files changed

+656
-216
lines changed

Diff for: lib/tsc.js

+78-31
Large diffs are not rendered by default.

Diff for: lib/tsserver.js

+100-37
Large diffs are not rendered by default.

Diff for: lib/tsserverlibrary.d.ts

+26
Original file line numberDiff line numberDiff line change
@@ -4720,6 +4720,7 @@ declare namespace ts {
47204720
function isImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration;
47214721
function isImportDeclaration(node: Node): node is ImportDeclaration;
47224722
function isImportClause(node: Node): node is ImportClause;
4723+
function isImportTypeAssertionContainer(node: Node): node is ImportTypeAssertionContainer;
47234724
function isAssertClause(node: Node): node is AssertClause;
47244725
function isAssertEntry(node: Node): node is AssertEntry;
47254726
function isNamespaceImport(node: Node): node is NamespaceImport;
@@ -5098,6 +5099,31 @@ declare namespace ts {
50985099
export function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string;
50995100
export function formatDiagnosticsWithColorAndContext(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string;
51005101
export function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string;
5102+
/**
5103+
* Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly
5104+
* provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file.
5105+
*/
5106+
export function getModeForFileReference(ref: FileReference | string, containingFileMode: SourceFile["impliedNodeFormat"]): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5107+
/**
5108+
* Calculates the final resolution mode for an import at some index within a file's imports list. This is generally the explicitly
5109+
* defined mode of the import if provided, or, if not, the mode of the containing file (with some exceptions: import=require is always commonjs, dynamic import is always esm).
5110+
* If you have an actual import node, prefer using getModeForUsageLocation on the reference string node.
5111+
* @param file File to fetch the resolution mode within
5112+
* @param index Index into the file's complete resolution list to get the resolution of - this is a concatenation of the file's imports and module augmentations
5113+
*/
5114+
export function getModeForResolutionAtIndex(file: SourceFile, index: number): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5115+
/**
5116+
* Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if
5117+
* one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm).
5118+
* Notably, this function always returns `undefined` if the containing file has an `undefined` `impliedNodeFormat` - this field is only set when
5119+
* `moduleResolution` is `node16`+.
5120+
* @param file The file the import or import-like reference is contained within
5121+
* @param usage The module reference string
5122+
* @returns The final resolution mode of the import
5123+
*/
5124+
export function getModeForUsageLocation(file: {
5125+
impliedNodeFormat?: SourceFile["impliedNodeFormat"];
5126+
}, usage: StringLiteralLike): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
51015127
export function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
51025128
/**
51035129
* A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the

Diff for: lib/tsserverlibrary.js

+100-37
Large diffs are not rendered by default.

Diff for: lib/typescript.d.ts

+26
Original file line numberDiff line numberDiff line change
@@ -4720,6 +4720,7 @@ declare namespace ts {
47204720
function isImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration;
47214721
function isImportDeclaration(node: Node): node is ImportDeclaration;
47224722
function isImportClause(node: Node): node is ImportClause;
4723+
function isImportTypeAssertionContainer(node: Node): node is ImportTypeAssertionContainer;
47234724
function isAssertClause(node: Node): node is AssertClause;
47244725
function isAssertEntry(node: Node): node is AssertEntry;
47254726
function isNamespaceImport(node: Node): node is NamespaceImport;
@@ -5098,6 +5099,31 @@ declare namespace ts {
50985099
export function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string;
50995100
export function formatDiagnosticsWithColorAndContext(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string;
51005101
export function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string;
5102+
/**
5103+
* Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly
5104+
* provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file.
5105+
*/
5106+
export function getModeForFileReference(ref: FileReference | string, containingFileMode: SourceFile["impliedNodeFormat"]): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5107+
/**
5108+
* Calculates the final resolution mode for an import at some index within a file's imports list. This is generally the explicitly
5109+
* defined mode of the import if provided, or, if not, the mode of the containing file (with some exceptions: import=require is always commonjs, dynamic import is always esm).
5110+
* If you have an actual import node, prefer using getModeForUsageLocation on the reference string node.
5111+
* @param file File to fetch the resolution mode within
5112+
* @param index Index into the file's complete resolution list to get the resolution of - this is a concatenation of the file's imports and module augmentations
5113+
*/
5114+
export function getModeForResolutionAtIndex(file: SourceFile, index: number): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5115+
/**
5116+
* Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if
5117+
* one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm).
5118+
* Notably, this function always returns `undefined` if the containing file has an `undefined` `impliedNodeFormat` - this field is only set when
5119+
* `moduleResolution` is `node16`+.
5120+
* @param file The file the import or import-like reference is contained within
5121+
* @param usage The module reference string
5122+
* @returns The final resolution mode of the import
5123+
*/
5124+
export function getModeForUsageLocation(file: {
5125+
impliedNodeFormat?: SourceFile["impliedNodeFormat"];
5126+
}, usage: StringLiteralLike): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
51015127
export function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
51025128
/**
51035129
* A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the

0 commit comments

Comments
 (0)