typescript 4.8.0-dev.20220601 → 4.8.0-dev.20220604

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.
@@ -4724,6 +4724,7 @@ declare namespace ts {
4724
4724
  function isImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration;
4725
4725
  function isImportDeclaration(node: Node): node is ImportDeclaration;
4726
4726
  function isImportClause(node: Node): node is ImportClause;
4727
+ function isImportTypeAssertionContainer(node: Node): node is ImportTypeAssertionContainer;
4727
4728
  function isAssertClause(node: Node): node is AssertClause;
4728
4729
  function isAssertEntry(node: Node): node is AssertEntry;
4729
4730
  function isNamespaceImport(node: Node): node is NamespaceImport;
@@ -5102,6 +5103,31 @@ declare namespace ts {
5102
5103
  export function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string;
5103
5104
  export function formatDiagnosticsWithColorAndContext(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string;
5104
5105
  export function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string;
5106
+ /**
5107
+ * Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly
5108
+ * provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file.
5109
+ */
5110
+ export function getModeForFileReference(ref: FileReference | string, containingFileMode: SourceFile["impliedNodeFormat"]): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5111
+ /**
5112
+ * Calculates the final resolution mode for an import at some index within a file's imports list. This is generally the explicitly
5113
+ * 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).
5114
+ * If you have an actual import node, prefer using getModeForUsageLocation on the reference string node.
5115
+ * @param file File to fetch the resolution mode within
5116
+ * @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
5117
+ */
5118
+ export function getModeForResolutionAtIndex(file: SourceFile, index: number): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5119
+ /**
5120
+ * Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if
5121
+ * one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm).
5122
+ * Notably, this function always returns `undefined` if the containing file has an `undefined` `impliedNodeFormat` - this field is only set when
5123
+ * `moduleResolution` is `node16`+.
5124
+ * @param file The file the import or import-like reference is contained within
5125
+ * @param usage The module reference string
5126
+ * @returns The final resolution mode of the import
5127
+ */
5128
+ export function getModeForUsageLocation(file: {
5129
+ impliedNodeFormat?: SourceFile["impliedNodeFormat"];
5130
+ }, usage: StringLiteralLike): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5105
5131
  export function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
5106
5132
  /**
5107
5133
  * A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the