import { JITI } from 'jiti'; import { JITIOptions } from 'jiti/dist/types'; interface DotenvOptions { /** * The project root directory (either absolute or relative to the current working directory). */ cwd: string; /** * What file to look in for environment variables (either absolute or relative * to the current working directory). For example, `.env`. */ fileName?: string; /** * Whether to interpolate variables within .env. * * @example * ```env * BASE_DIR="/test" * # resolves to "/test/further" * ANOTHER_DIR="${BASE_DIR}/further" * ``` */ interpolate?: boolean; /** * An object describing environment variables (key, value pairs). */ env?: NodeJS.ProcessEnv; } type Env = typeof process.env; /** * Load and interpolate environment variables into `process.env`. * If you need more control (or access to the values), consider using `loadDotenv` instead * */ declare function setupDotenv(options: DotenvOptions): Promise; /** Load environment variables into an object. */ declare function loadDotenv(options: DotenvOptions): Promise; type UserInputConfig = Record; interface ConfigLayerMeta { name?: string; [key: string]: any; } interface C12InputConfig { $test?: UserInputConfig; $development?: UserInputConfig; $production?: UserInputConfig; $env?: Record; $meta?: ConfigLayerMeta; } interface InputConfig extends C12InputConfig, UserInputConfig { } interface SourceOptions { meta?: ConfigLayerMeta; overrides?: UserInputConfig; [key: string]: any; } interface ConfigLayer { config: T | null; source?: string; sourceOptions?: SourceOptions; meta?: ConfigLayerMeta; cwd?: string; configFile?: string; } interface ResolvedConfig extends ConfigLayer { layers?: ConfigLayer[]; cwd?: string; } interface ResolveConfigOptions { cwd: string; } interface LoadConfigOptions { name?: string; cwd?: string; configFile?: string; rcFile?: false | string; globalRc?: boolean; dotenv?: boolean | DotenvOptions; envName?: string | false; packageJson?: boolean | string | string[]; defaults?: T; defaultConfig?: T; overrides?: T; resolve?: (id: string, options: LoadConfigOptions) => null | ResolvedConfig | Promise; jiti?: JITI; jitiOptions?: JITIOptions; extend?: false | { extendKey?: string | string[]; }; } declare function loadConfig(options: LoadConfigOptions): Promise>; export { C12InputConfig, ConfigLayer, ConfigLayerMeta, DotenvOptions, Env, InputConfig, LoadConfigOptions, ResolveConfigOptions, ResolvedConfig, SourceOptions, UserInputConfig, loadConfig, loadDotenv, setupDotenv };