export type RemediationConfig = { * 'group-by'?: 'dependency' | 'bundle'; exclude?: string[]; labels?: string[]; * 'branch-prefix'?: string; [key: string]: unknown; }; export type FailOnConfig = { critical?: number; high?: number; 'license-conflicts'?: number; [key: string]: unknown; }; export type CheckConfig = { 'fail-on'?: FailOnConfig; [key: string]: unknown; }; export type SbomConfig = { format?: string; targets?: string[]; [key: string]: unknown; }; export type FileConfig = { * 'backend-url'?: string; providers?: string[] | string; sources?: string[] | string; remediation?: RemediationConfig; check?: CheckConfig; sbom?: SbomConfig; [key: string]: unknown; }; export type ResolvedConfig = { backendUrl: string | null; backendUrlSource: 'cli' | 'environment' | 'file' | 'default'; providers: string[]; sources: string[]; groupBy: string; remediation: object; check: object; sbom: object; }; /** * @typedef {{ * 'group-by'?: 'dependency' | 'bundle', * exclude?: string[], * labels?: string[], * 'branch-prefix'?: string, * [key: string]: unknown * }} RemediationConfig */ /** @typedef {{ critical?: number, high?: number, 'license-conflicts'?: number, [key: string]: unknown }} FailOnConfig */ /** @typedef {{ 'fail-on'?: FailOnConfig, [key: string]: unknown }} CheckConfig */ /** @typedef {{ format?: string, targets?: string[], [key: string]: unknown }} SbomConfig */ /** * @typedef {{ * 'backend-url'?: string, * providers?: string[] | string, * sources?: string[] | string, * remediation?: RemediationConfig, * check?: CheckConfig, * sbom?: SbomConfig, * [key: string]: unknown * }} FileConfig */ /** * @typedef {{ * backendUrl: string | null, * backendUrlSource: 'cli' | 'environment' | 'file' | 'default', * providers: string[], * sources: string[], * groupBy: string, * remediation: object, * check: object, * sbom: object * }} ResolvedConfig */ /** Config file names discovered by walking up the directory tree, in precedence order. */ export declare const CONFIG_FILENAMES: string[]; /** * Discovers and parses `.trustify-da.yml` by walking up from `startPath`. * A missing config file is not an error — an empty object is returned so callers * can fall back to defaults. * @param {string} [startPath] - manifest file or directory to start the search from * @returns {FileConfig} the parsed config object, or `{}` when no file is found * @throws {Error} when the config file exists but contains malformed YAML */ export declare function loadConfig(startPath?: string): FileConfig; /** * Merges config sources with precedence: CLI flag > environment variable * (`TRUSTIFY_DA_*`) > config file > hardcoded default. Providers and sources are * normalized to arrays regardless of whether the source used a YAML array or a * comma-separated string. * @param {FileConfig} [fileConfig={}] - values parsed from `.trustify-da.yml` * @param {{ providers?: string, sources?: string, groupBy?: string, backendUrl?: string }} [cliFlags={}] * @param {{ [key: string]: string | undefined }} [envVars={}] - typically `process.env` * @returns {ResolvedConfig} the resolved, typed config object */ export declare function mergeConfig(fileConfig?: FileConfig, cliFlags?: { providers?: string; sources?: string; groupBy?: string; backendUrl?: string; }, envVars?: { [key: string]: string | undefined; }): ResolvedConfig; /** * Loads and merges the project configuration for a target path. * @param {string} [startPath] - manifest file or directory to start discovery from * @param {{ providers?: string, sources?: string, groupBy?: string, backendUrl?: string }} [cliFlags={}] - explicit options * @param {{ [key: string]: string | undefined }} [envVars={}] - typically `process.env` * @returns {ResolvedConfig} the resolved, typed config object */ export declare function resolveConfig(startPath?: string, cliFlags?: { providers?: string; sources?: string; groupBy?: string; backendUrl?: string; }, envVars?: { [key: string]: string | undefined; }): ResolvedConfig;