UNPKG

1.06 kBTypeScriptView Raw
1/**
2 * Typing for the parts of tsconfig that we care about
3 */
4export interface Tsconfig {
5 extends?: string | string[];
6 compilerOptions?: {
7 baseUrl?: string;
8 paths?: {
9 [key: string]: Array<string>;
10 };
11 strict?: boolean;
12 };
13}
14export interface TsConfigLoaderResult {
15 tsConfigPath: string | undefined;
16 baseUrl: string | undefined;
17 paths: {
18 [key: string]: Array<string>;
19 } | undefined;
20}
21export interface TsConfigLoaderParams {
22 getEnv: (key: string) => string | undefined;
23 cwd: string;
24 loadSync?(cwd: string, filename?: string, baseUrl?: string): TsConfigLoaderResult;
25}
26export declare function tsConfigLoader({ getEnv, cwd, loadSync, }: TsConfigLoaderParams): TsConfigLoaderResult;
27export declare function walkForTsConfig(directory: string, readdirSync?: (path: string) => string[]): string | undefined;
28export declare function loadTsconfig(configFilePath: string, existsSync?: (path: string) => boolean, readFileSync?: (filename: string) => string): Tsconfig | undefined;