import { Driver } from "unstorage"; /** * Configuration options for Archives */ export interface ArchivesConfig { storage: { driver?: Driver; cache?: boolean; ttl?: number; prefix?: string; }; performance: { concurrency?: number; batchSize?: number; timeout?: number; retries?: number; }; $env?: Record; $development?: ArchivesConfig; $production?: ArchivesConfig; $test?: ArchivesConfig; } type ConfigLayer = Readonly<{ storage?: Readonly; performance?: Readonly; $env?: Readonly>; $development?: ConfigLayer; $production?: ConfigLayer; $test?: ConfigLayer; }>; export type ResolveConfigOptions = Readonly<{ cwd?: string; defaults?: ConfigLayer; overrides?: ConfigLayer; envName?: string | false; configFile?: string; rcFile?: string; }>; /** * Pins config discovery to `cwd` for every later call that passes none. * * A long-lived server is started by whoever spawns it, in whatever directory * that caller happens to be in. Leaving discovery on `process.cwd()` there means * the first request executes an `archives.config.ts` belonging to a checkout the * server never chose. Library consumers are unaffected: without this call the * default stays `process.cwd()`. * * @param cwd - Directory to resolve `archives.config.ts`, `.archives` and `package.json` from */ export declare function setConfigCwd(cwd: string): void; /** * Uses `config` instead of config files until `resetConfig()` or `setConfigCwd()`. * * @param config - Storage and performance settings over the defaults, without `$env` layers * @returns {ArchivesConfig} The config every later `getConfig()` returns */ export declare function setConfig(config?: Pick): ArchivesConfig; /** * Load Archives configuration from all available sources * * @param options - Options. * @returns {Promise} A promise resolving to the operation result. */ export declare function resolveConfig(options?: ResolveConfigOptions): Promise; /** * Reset the cached configuration */ export declare function resetConfig(): void; /** * Get the current configuration or resolve it if not already loaded * * @param options - Options. * @returns {Promise} A promise resolving to the operation result. */ export declare function getConfig(options?: ResolveConfigOptions): Promise;