import { type Logger } from 'log4js'; export declare const seeConfigDocs: string; export type Profile = Record; export type ProfilesByName = Record; export type CLIConfigDescription = { /** * The name of the user-editable configuration file. */ configFilename: string; /** * The name of the configuration file managed by the CLI. */ managedConfigFilename: string; /** * The name of the currently selected profile. */ profileName: string; }; export type CLIConfig = CLIConfigDescription & { profiles: ProfilesByName; managedProfiles: ProfilesByName; mergedProfiles: ProfilesByName; /** * A convenience reference to the selected profile (same as `mergedConfig[profileName]`). */ profile: Profile; /** * If the configured `keyName` value exists and is a string, return it. Otherwise, return * the default value. This method logs a warning (and returns the default value) if the * configured keyName exists but is not a string. (The default `defaultValue` is `undefined`.) */ stringConfigValue(keyName: string): string | undefined; stringConfigValue(keyName: string, defaultValue: string): string; stringConfigValue(keyName: string, defaultValue?: string): string | undefined; /** * If the configured `keyName` exists and is a string or a string array, return it. (A simple * string will be returned as a single-element array.) Otherwise, return the default value. * This method logs a warning (and returns the default value) if the configured keyName exists * but is not a string or array of strings. (The default `defaultValue` is an empty array.) */ stringArrayConfigValue(keyName: string, defaultValue?: string[]): string[]; /** * If the configured `keyName` value exists and is a boolean, return it. Otherwise, return * the default value. This method logs a warning if the configured keyName * exists but is not a boolean. */ booleanConfigValue(keyName: string, defaultValue?: boolean): boolean; }; export declare const loadConfigFile: (filename: string) => Promise; /** * Merge profiles from `preferred` and `secondary`, favoring any config entries from `preferred` * over those in `secondary`. */ export declare const mergeProfiles: (preferred: ProfilesByName, secondary: ProfilesByName) => ProfilesByName; export declare const loadConfig: (description: CLIConfigDescription, logger: Logger) => Promise; /** * Generate managed config file contents. If there are no profiles to save, we skip calling * `yaml.dump` which returns `{}` in that case. */ export declare const buildManagedConfigFileContents: (config: CLIConfig) => string; /** * Save the specified configuration key into managed config so it will be picked up * in the future but not override user settings. */ export declare const setConfigKey: (config: CLIConfig, key: string, value: unknown) => Promise; /** * Reset the specified managed config key for for all profiles. The `predicate` is called for each * value found and the key will only be reset if it returns true. * * This can be used to wipe out default values when something is deleted. */ export declare const resetManagedConfigKey: (config: CLIConfig, key: string, predicate?: (value: unknown) => boolean) => Promise; /** * Reset all managed config options for the specified profile. */ export declare const resetManagedConfig: (config: CLIConfig, profileName: string) => Promise; //# sourceMappingURL=cli-config.d.ts.map