From 1f907ae6409aa1de8f9b06b9a587559cb24f3138 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 3 Jun 2022 00:25:31 +0000 Subject: [PATCH] Make `SourceFileImportsList` internal again. --- src/compiler/program.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 19db30ac715..a8b1066a9a2 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -540,6 +540,8 @@ namespace ts { * Subset of a SourceFile used to calculate index-based resolutions * This includes some internal fields, so unless you have very good reason, * (and are willing to use some less stable internals) you should probably just pass a SourceFile. + * + * @internal */ export interface SourceFileImportsList { /* @internal */ imports: SourceFile["imports"]; @@ -562,7 +564,10 @@ namespace ts { * @param file File to fetch the resolution mode within * @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 */ - export function getModeForResolutionAtIndex(file: SourceFileImportsList, index: number) { + export function getModeForResolutionAtIndex(file: SourceFile, index: number): ModuleKind.CommonJS | ModuleKind.ESNext | undefined; + /** @internal */ + export function getModeForResolutionAtIndex(file: SourceFileImportsList, index: number): ModuleKind.CommonJS | ModuleKind.ESNext | undefined; + export function getModeForResolutionAtIndex(file: SourceFileImportsList, index: number): ModuleKind.CommonJS | ModuleKind.ESNext | undefined { if (file.impliedNodeFormat === undefined) return undefined; // we ensure all elements of file.imports and file.moduleAugmentations have the relevant parent pointers set during program setup, // so it's safe to use them even pre-bind