UNPKG

897 BTypeScriptView Raw
1export declare type ExtensionName = ".cjs" | ".js" | ".json" | ".yaml" | ".yml";
2export declare type RequiredOption = "packageJSON" | "defaultExtension" | "cwd";
3export declare type Loader = <R extends {}>(fileName: string, supperes: boolean) => R;
4export declare type ExtensionLoaderMap = Record<ExtensionName, Loader>;
5export declare type PossibleUndefined<T> = T | undefined;
6export interface rcConfigResult<R extends Record<string, unknown>> {
7 config: R;
8 filePath: string;
9}
10export interface rcConfigLoaderOption {
11 /** does look for `package.json` */
12 packageJSON?: boolean | {
13 fieldName: string;
14 };
15 /** if config file name is not same with packageName, set the name */
16 configFileName?: string;
17 /** treat default(no ext file) as some extension */
18 defaultExtension?: ExtensionName | ExtensionName[];
19 /** where start to load */
20 cwd?: string;
21}