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
559
+
* 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).
560
+
* If you have an actual import node, prefer using getModeForUsageLocation on the reference string node.
561
+
* @param file File to fetch the resolution mode within
562
+
* @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,
552
571
// so it's safe to use them even pre-bind
@@ -564,7 +583,15 @@ namespace ts {
564
583
returnfalse;
565
584
}
566
585
567
-
/* @internal */
586
+
/**
587
+
* Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if
588
+
* one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm).
589
+
* Notably, this function always returns `undefined` if the containing file has an `undefined` `impliedNodeFormat` - this field is only set when
590
+
* `moduleResolution` is `node16`+.
591
+
* @param file The file the import or import-like reference is contained within
592
+
* @param usage The module reference string
593
+
* @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
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
* 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
* 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
* 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
0 commit comments