source: trip-planner-front/node_modules/cosmiconfig/dist/index.d.ts@ b738035

Last change on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[6a3a178]1import { Config, CosmiconfigResult, Loaders, LoadersSync } from './types';
2declare type LoaderResult = Config | null;
3export declare type Loader = ((filepath: string, content: string) => Promise<LoaderResult>) | LoaderSync;
4export declare type LoaderSync = (filepath: string, content: string) => LoaderResult;
5export declare type Transform = ((CosmiconfigResult: CosmiconfigResult) => Promise<CosmiconfigResult>) | TransformSync;
6export declare type TransformSync = (CosmiconfigResult: CosmiconfigResult) => CosmiconfigResult;
7interface OptionsBase {
8 packageProp?: string | Array<string>;
9 searchPlaces?: Array<string>;
10 ignoreEmptySearchPlaces?: boolean;
11 stopDir?: string;
12 cache?: boolean;
13}
14export interface Options extends OptionsBase {
15 loaders?: Loaders;
16 transform?: Transform;
17}
18export interface OptionsSync extends OptionsBase {
19 loaders?: LoadersSync;
20 transform?: TransformSync;
21}
22declare function cosmiconfig(moduleName: string, options?: Options): {
23 readonly search: (searchFrom?: string) => Promise<CosmiconfigResult>;
24 readonly load: (filepath: string) => Promise<CosmiconfigResult>;
25 readonly clearLoadCache: () => void;
26 readonly clearSearchCache: () => void;
27 readonly clearCaches: () => void;
28};
29declare function cosmiconfigSync(moduleName: string, options?: OptionsSync): {
30 readonly search: (searchFrom?: string) => CosmiconfigResult;
31 readonly load: (filepath: string) => CosmiconfigResult;
32 readonly clearLoadCache: () => void;
33 readonly clearSearchCache: () => void;
34 readonly clearCaches: () => void;
35};
36declare const defaultLoaders: Readonly<{
37 readonly '.cjs': LoaderSync;
38 readonly '.js': LoaderSync;
39 readonly '.json': LoaderSync;
40 readonly '.yaml': LoaderSync;
41 readonly '.yml': LoaderSync;
42 readonly noExt: LoaderSync;
43}>;
44export { cosmiconfig, cosmiconfigSync, defaultLoaders };
45//# sourceMappingURL=index.d.ts.map
Note: See TracBrowser for help on using the repository browser.