From d192d8e19b198c22de2316159036aec1f09e068b Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Tue, 17 May 2022 14:33:24 -0400 Subject: [PATCH] tricky types --- src/ts-compiler-types.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ts-compiler-types.ts b/src/ts-compiler-types.ts index 3b23e1c88..5e19e79cc 100644 --- a/src/ts-compiler-types.ts +++ b/src/ts-compiler-types.ts @@ -19,7 +19,7 @@ export interface TSCommon { getPreEmitDiagnostics: typeof _ts.getPreEmitDiagnostics; flattenDiagnosticMessageText: typeof _ts.flattenDiagnosticMessageText; transpileModule: typeof _ts.transpileModule; - ModuleKind: typeof _ts.ModuleKind; + ModuleKind: TSCommon.ModuleKindEnum; ScriptTarget: typeof _ts.ScriptTarget; findConfigFile: typeof _ts.findConfigFile; readConfigFile: typeof _ts.readConfigFile; @@ -73,12 +73,12 @@ export namespace TSCommon { _ts.ResolvedModuleWithFailedLookupLocations; export type FileReference = _ts.FileReference; export type SourceFile = _ts.SourceFile; - export namespace ModuleKind { - // Hack until we start building against TS >= 4.7.0 - export declare const Node16: 100 | undefined; + // Hack until we start building against TS >= 4.7.0 + export type ModuleKindEnum = typeof _ts.ModuleKind & { + Node16: typeof _ts.ModuleKind extends {Node16: any} ? typeof _ts.ModuleKind['Node16'] : 100; } } - +type a = Omit<{}, 'a'> /** * Compiler APIs we use that are marked internal and not included in TypeScript's public API declarations * @internal