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