/** * @file Read a layered config — a base config that higher layers may override * or extend. Generic over the layer directories, the base name, and the file * extension: `readConfigLayers('vitest', { dirs: ['.config/base', * '.config/local'] })` reads each `/vitest.json` in precedence order and * returns the layers that exist. Callers apply their own merge, because merge * policy varies (a denylist unions all layers; an allowlist takes the highest * layer that declares one; an array key concatenates). `mergeConfigArray` * covers the concat case across any number of layers. No Socket-specific * knowledge lives here — the Socket-convention `.config/fleet` + * `.config/repo` wrapper is `config/repo`'s `resolveRepoConfig`, a thin * layer over this reader. */ export interface ReadConfigLayersOptions { dirs: readonly string[]; rootDir?: string | undefined; cwd?: string | undefined; ext?: string | undefined; } /** * Concatenate one array-valued key across all layers — the common merge for a * list that higher layers EXTEND rather than replace (e.g. extra exclude * globs). Layers contribute in precedence order; a non-array value for the key * (or a missing key, or an `undefined` layer) contributes nothing. * * @param layers - The layers from `readConfigLayers`, or any object array. * @param key - The array-valued property to concatenate. * * @returns Each layer's entries in order; `[]` when no layer has the array. */ export declare function mergeConfigArray, K extends keyof T>(layers: ReadonlyArray, key: K): Array ? E : never>; /** * Read a named config from an ordered list of layer directories. * * For each dir in `dirs`, reads `//`; layers that are * absent or unparseable are skipped (never throws — config reads are * best-effort). The returned array preserves `dirs` order (lowest precedence * first), so the last element is the highest-precedence layer present. * * @example * ;```typescript * const layers = readConfigLayers('vitest', { * dirs: ['.config/base', '.config/team', '.config/local'], * }) * // layers === every one of those that existed, in that order * ``` * * @param name - Base name of the config file: no directory, no extension. * @param options - Layer dirs + resolution options. * * @returns Parsed layers in precedence order; empty when none exist. */ export declare function readConfigLayers(name: string, options: ReadConfigLayersOptions): T[];