import type { BrandProfile } from '../types.js'; /** The minimal fs surface discovery needs, injectable for tests. */ export interface ProfileFs { readFile(path: string): Promise; writeFile(path: string, data: string): Promise; mkdir(path: string): Promise; } /** Thrown when an existing profile file is present but not valid JSON. */ export declare class ProfileParseError extends Error { readonly path: string; readonly cause: unknown; constructor(path: string, cause: unknown); } /** The canonical profile path inside a state directory. */ export declare function profilePath(stateDir: string): string; /** Node fs.promises adapter for production use. */ export declare function nodeProfileFs(): ProfileFs; /** * Load a persisted profile, or `null` if none exists yet. A present-but-corrupt * file throws {@link ProfileParseError} rather than silently clobbering it. */ export declare function loadProfile(stateDir: string, fs: ProfileFs): Promise; /** Persist a profile as pretty JSON, ensuring the state directory exists. */ export declare function saveProfile(profile: BrandProfile, stateDir: string, fs: ProfileFs): Promise;