UNPKG

1.15 kBTypeScriptView Raw
1import * as TsConfigLoader2 from "./tsconfig-loader";
2export interface ExplicitParams {
3 baseUrl: string;
4 paths: {
5 [key: string]: Array<string>;
6 };
7 mainFields?: (string | string[])[];
8 addMatchAll?: boolean;
9}
10export declare type TsConfigLoader = (params: TsConfigLoader2.TsConfigLoaderParams) => TsConfigLoader2.TsConfigLoaderResult;
11export interface ConfigLoaderParams {
12 cwd: string;
13 explicitParams?: ExplicitParams;
14 tsConfigLoader?: TsConfigLoader;
15}
16export interface ConfigLoaderSuccessResult {
17 resultType: "success";
18 configFileAbsolutePath: string;
19 baseUrl?: string;
20 absoluteBaseUrl: string;
21 paths: {
22 [key: string]: Array<string>;
23 };
24 mainFields?: (string | string[])[];
25 addMatchAll?: boolean;
26}
27export interface ConfigLoaderFailResult {
28 resultType: "failed";
29 message: string;
30}
31export declare type ConfigLoaderResult = ConfigLoaderSuccessResult | ConfigLoaderFailResult;
32export declare function loadConfig(cwd?: string): ConfigLoaderResult;
33export declare function configLoader({ cwd, explicitParams, tsConfigLoader, }: ConfigLoaderParams): ConfigLoaderResult;