import type { QueryPack } from '../types.js'; /** The minimal fs surface query persistence needs, injectable for tests. */ export interface QueryFs { readFile(path: string): Promise; writeFile(path: string, data: string): Promise; mkdir(path: string): Promise; } /** Thrown when a queries file is present but not a valid {@link QueryPack}. */ export declare class QueryPackError extends Error { readonly detail: string; readonly source?: string | undefined; constructor(detail: string, source?: string | undefined); } /** The canonical queries path inside a state directory. */ export declare function queriesPath(stateDir: string): string; /** Serialize a pack to YAML (also the shareable `export` format). */ export declare function toYaml(pack: QueryPack): string; /** Parse + validate a YAML query pack, throwing {@link QueryPackError} on any defect. */ export declare function parseQueryPack(text: string, source?: string): QueryPack; /** Node fs.promises adapter for production use. */ export declare function nodeQueryFs(): QueryFs; /** Load + validate the state-dir queries pack, or `null` if none exists. */ export declare function loadQueryPack(stateDir: string, fs: QueryFs): Promise; /** Load + validate an explicit `--queries ` pack (must exist). */ export declare function loadQueryPackFromFile(path: string, fs: QueryFs): Promise; /** Persist a pack as YAML, ensuring the state directory exists. */ export declare function saveQueryPack(pack: QueryPack, stateDir: string, fs: QueryFs): Promise;