export interface YamlStoreOptions<T> {
    /** Subdirectory name under configDir (e.g. "roles", "workflows") */
    subdir: string;
    /** Extract the unique key from an item */
    keyFn: (item: T) => string;
    /** Parse raw YAML data into a typed item, or return null to skip */
    parseItem: (data: Record<string, unknown>) => T | null;
    /** Serialize a typed item to a plain object for YAML output */
    serializeItem: (item: T) => Record<string, unknown>;
    /** Log prefix for error messages (e.g. "[role-store]") */
    logPrefix: string;
    /** Optional filter applied to getAll/getAllLocal results */
    filter?: (item: T) => boolean;
}
export declare class YamlStore<T extends object> {
    private _local;
    private _builtins;
    protected readonly dir: string;
    private readonly opts;
    constructor(configDir: string, opts: YamlStoreOptions<T>);
    /** Set builtin items (in-memory only, never persisted to disk). */
    setBuiltins(items: T[]): void;
    /** Get an item by key. Local overrides take priority over builtins. */
    get(key: string): T | undefined;
    /** Get an item only if it exists locally on disk (ignores builtins). */
    getLocal(key: string): T | undefined;
    /** Get all items — builtins merged with local overrides (local wins). */
    getAll(): T[];
    /** Get only locally overridden items (ignores builtins). */
    getAllLocal(): T[];
    /** Add or replace an item, persisting to disk. */
    put(item: T): void;
    /** Remove a local override. Does not affect builtins. */
    remove(key: string): void;
    /**
     * Partial update of an existing item. Copy-on-write: if the item only
     * exists in builtins, it is cloned to the local layer before updating.
     * Returns false if not found in either layer.
     */
    update(key: string, updates: Record<string, unknown>): boolean;
    /** Re-read all YAML files from disk, picking up external changes. */
    reload(): void;
    protected itemPath(key: string): string;
    private loadAll;
    private saveOne;
}
//# sourceMappingURL=yaml-store.d.ts.map