You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Calculates the final resolution mode for an import at some index within a file's imports list. This is generally the explicitly
560
+
* 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).
561
+
* If you have an actual import node, prefer using getModeForUsageLocation on the reference string node.
562
+
* @param file File to fetch the resolution mode within
563
+
* @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
// we ensure all elements of file.imports and file.moduleAugmentations have the relevant parent pointers set during program setup,
@@ -567,7 +580,15 @@ namespace ts {
567
580
returnfalse;
568
581
}
569
582
570
-
/* @internal */
583
+
/**
584
+
* Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if
585
+
* one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm).
586
+
* Notably, this function always returns `undefined` if the containing file has an `undefined` `impliedNodeFormat` - this field is only set when
587
+
* `moduleResolution` is `node16`+.
588
+
* @param file The file the import or import-like reference is contained within
589
+
* @param usage The module reference string
590
+
* @returns The final resolution mode of the import
* Calculates the final resolution mode for an import at some index within a file's imports list. This is generally the explicitly
5120
+
* 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).
5121
+
* If you have an actual import node, prefer using getModeForUsageLocation on the reference string node.
5122
+
* @param file File to fetch the resolution mode within
5123
+
* @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
* Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if
5128
+
* one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm).
5129
+
* Notably, this function always returns `undefined` if the containing file has an `undefined` `impliedNodeFormat` - this field is only set when
5130
+
* `moduleResolution` is `node16`+.
5131
+
* @param file The file the import or import-like reference is contained within
5132
+
* @param usage The module reference string
5133
+
* @returns The final resolution mode of the import
* Calculates the final resolution mode for an import at some index within a file's imports list. This is generally the explicitly
5120
+
* 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).
5121
+
* If you have an actual import node, prefer using getModeForUsageLocation on the reference string node.
5122
+
* @param file File to fetch the resolution mode within
5123
+
* @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
* Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if
5128
+
* one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm).
5129
+
* Notably, this function always returns `undefined` if the containing file has an `undefined` `impliedNodeFormat` - this field is only set when
5130
+
* `moduleResolution` is `node16`+.
5131
+
* @param file The file the import or import-like reference is contained within
5132
+
* @param usage The module reference string
5133
+
* @returns The final resolution mode of the import
0 commit comments