|
9 | 9 | ModuleResolutionCache,
|
10 | 10 | MultiMap,
|
11 | 11 | NodeFactoryFlags,
|
| 12 | + optionDeclarations, |
12 | 13 | OptionsNameMap,
|
13 | 14 | PackageJsonInfo,
|
14 | 15 | PackageJsonInfoCache,
|
@@ -9912,6 +9913,48 @@ export interface PragmaMap extends Map<string, PragmaPseudoMap[keyof PragmaPseud
|
9912 | 9913 | forEach(action: <TKey extends keyof PragmaPseudoMap>(value: PragmaPseudoMap[TKey] | PragmaPseudoMap[TKey][], key: TKey, map: PragmaMap) => void): void;
|
9913 | 9914 | }
|
9914 | 9915 |
|
| 9916 | +type IntoCompilerOptionsValue<T extends CommandLineOption> = |
| 9917 | + T["type"] extends "string" |
| 9918 | + ? string |
| 9919 | + : T["type"] extends "number" |
| 9920 | + ? number |
| 9921 | + : T["type"] extends "boolean" |
| 9922 | + ? boolean |
| 9923 | + : T["type"] extends "object" |
| 9924 | + ? Record<string, any> |
| 9925 | + : T["type"] extends "list" |
| 9926 | + ? IntoCompilerOptionsValue<Extract<T, CommandLineOptionOfListType>["element"]>[] |
| 9927 | + : T["type"] extends "listOrElement" |
| 9928 | + ? IntoCompilerOptionsValue<Extract<T, CommandLineOptionOfListType>["element"]>[] | IntoCompilerOptionsValue<Extract<T, CommandLineOptionOfListType>["element"]> |
| 9929 | + : T["type"] extends Map<infer InputKeyTypes, infer _EnumType> |
| 9930 | + ? InputKeyTypes |
| 9931 | + : never; |
| 9932 | + |
| 9933 | +type IntoCompilerOptionsNameValuePair<T extends CommandLineOption> = { |
| 9934 | + [K in T["name"]]?: IntoCompilerOptionsValue<T>; |
| 9935 | +}; |
| 9936 | + |
| 9937 | +type IntoCompilerOptionsNameValuePairs<T extends CommandLineOption> = T extends T ? IntoCompilerOptionsNameValuePair<T> : never; |
| 9938 | + |
| 9939 | +type IntoCompilerOptionsDefinitionWorker<T extends CommandLineOption[]> = UnionToIntersection<IntoCompilerOptionsNameValuePairs<T[number]>>; |
| 9940 | + |
| 9941 | +type IntoCompilerOptionsDefinition<T extends CommandLineOption[]> = IntoCompilerOptionsDefinitionWorker<T> extends infer U ? {[K in keyof U]: U[K]} : never; |
| 9942 | + |
| 9943 | +export const _optionsType = [undefined! as IntoCompilerOptionsDefinition<typeof optionDeclarations> | undefined][0]; |
| 9944 | + |
| 9945 | +/** |
| 9946 | + * An unprocessed TSConfig object, suitable to read as JSON and transform into command line options |
| 9947 | + */ |
| 9948 | +export interface RawTSConfig { |
| 9949 | + extends?: string | string[]; |
| 9950 | + compilerOptions?: NonNullable<typeof _optionsType>; |
| 9951 | + references?: { path: string }[]; |
| 9952 | + files?: string[]; |
| 9953 | + include?: string[]; |
| 9954 | + exclude?: string[]; |
| 9955 | + compileOnSave?: boolean; |
| 9956 | +} |
| 9957 | + |
9915 | 9958 | /** @internal */
|
9916 | 9959 | export interface CommentDirectivesMap {
|
9917 | 9960 | getUnusedExpectations(): CommentDirective[];
|
|
0 commit comments