import type { Command } from 'commander'; import { extractDatabaseURL, extractServiceURL } from './util/index.js'; import { configOptions } from './config-options.js'; export type ConfigMap = Record; export interface AnyConfigOption { doc: string; valueType: typeof String | typeof Number | typeof Boolean; valueTypeName?: string; shortForm?: string; inferVal?: (options: ConfigMap) => string | number | boolean | undefined; defaultVal?: string | number | boolean | ((options: ConfigMap) => string | number | boolean); constructedDefault?: string; secret?: true; groups?: Readonly; } export type ConfigOptions = typeof configOptions; export type ConfigOptionName = keyof ConfigOptions; type ConfigOption = ConfigOptions[T]; type ConfigOptionValue = ConfigOption extends { inferVal: undefined; defaultVal: undefined; } ? ReturnType['valueType']> | undefined : ReturnType['valueType']>; export declare function inferDbUrlPart>(part: K, options?: any, defaultValue?: ReturnType[K]): ReturnType[K] | undefined; export declare function inferProxyUrlPart>(part: K, options?: any, defaultValue?: ReturnType[K]): ReturnType[K] | undefined; export declare function inferServiceUrlPart>(part: K, options?: any, defaultValue?: ReturnType[K]): ReturnType[K] | undefined; export declare function getConfigValue(name: K, options?: any): ConfigOptionValue; export type Config = { [K in ConfigOptionName]: ConfigOptionValue; }; type ConfigCamelCase = { [K in ConfigOptionName as `${Camelize>}`]: ConfigOptionValue; }; type GetConfigOptions = Partial; export type Group = ConfigOptions[ConfigOptionName]['groups'][number]; export type ConfigForGroup = { [K in ConfigOptionName as G extends ConfigOptions[K]['groups'][number] ? K : never]: ConfigOptionValue; }; export type GetConfigOptionsForGroup = Partial & { [K in ConfigOptionName as G extends ConfigOptions[K]['groups'][number] ? `${Camelize>}` : never]: ConfigOptionValue; }>; /** * Get the current configuration for Electric from environment variables and * any passed options. * @param options Object containing options to override the environment variables * @returns The current configuration */ export declare function getConfig(options?: GetConfigOptions): Config; export declare function envFromConfig(config: Config): { [k: string]: any; }; /** * Redacts sensitive information like secrets and passwords from the * config and returns a separate, redacted version. * * Redaction is done based on the `secret` property of the * configuration option. */ export declare function redactConfigSecrets(config: Config): Config; /** * Prints the provided `config` taking care to redact any * sensitive values */ export declare function printConfig(config: Config): void; export declare function addOptionToCommand(command: Command, optionName: ConfigOptionName): void; export declare function addOptionGroupToCommand(command: Command, groupName: string): void; type Camelize = T extends `${infer A}_${infer B}` ? `${A}${Camelize>}` : T; export {};