UNPKG

1.08 kBTypeScriptView Raw
1import { Lazy } from "lazy-val";
2export interface ReadConfigResult<T> {
3 readonly result: T;
4 readonly configFile: string | null;
5}
6export declare function findAndReadConfig<T>(request: ReadConfigRequest): Promise<ReadConfigResult<T> | null>;
7export declare function orNullIfFileNotExist<T>(promise: Promise<T>): Promise<T | null>;
8export declare function orIfFileNotExist<T>(promise: Promise<T>, fallbackValue: T): Promise<T>;
9export interface ReadConfigRequest {
10 packageKey: string;
11 configFilename: string;
12 projectDir: string;
13 packageMetadata: Lazy<{
14 [key: string]: any;
15 } | null> | null;
16}
17export declare function loadConfig<T>(request: ReadConfigRequest): Promise<ReadConfigResult<T> | null>;
18export declare function getConfig<T>(request: ReadConfigRequest, configPath?: string | null): Promise<ReadConfigResult<T> | null>;
19export declare function loadParentConfig<T>(request: ReadConfigRequest, spec: string): Promise<ReadConfigResult<T>>;
20export declare function loadEnv(envFile: string): Promise<import("dotenv").DotenvParseOutput | null>;