import { type Operation } from "effection"; import { PathManager, type PathManagerOptions } from "../db/core/path-manager.js"; /** Options for locating and opening one habitat configuration file. */ export interface ConfigerOptions extends PathManagerOptions { /** File extension for the config file */ fext?: string; } /** * Habitat config-file manager. * * KERIpy correspondence: * - mirrors the role of `keri.app.configing.Configer` as the habery-local * configuration store * * Current `keri-ts` differences: * - intentionally uses stateless file I/O plus atomic temp-file rename instead * of KERIpy's open-handle seek/truncate/write lifecycle * - currently supports JSON only */ export declare class Configer { readonly name: string; readonly base: string; readonly temp: boolean; readonly fext: string; readonly pathManager: PathManager; path: string | null; /** Create a config manager bound to a PathManager-backed directory. */ constructor(options?: ConfigerOptions); get opened(): boolean; /** Resolve and validate the config filename and extension. */ private resolvedFileName; private ensureOpenPath; /** Flush parent directory metadata when the platform supports it. */ private syncDirBestEffort; /** Rename temp file into place with a Windows compatibility fallback. */ private renameIntoPlace; /** * Atomically persist config content using temp-file + sync + rename. * * Why this shape: * - writing directly to the target can leave a truncated/partial file on crash * - rename gives us an atomic switch from old file to new file * - syncing the parent directory makes the rename metadata more durable * if a crash happens immediately after rename returns */ private writeAtomic; /** Open or create the config file in the resolved Configer directory. */ reopen(options?: Partial): Operation; /** Close the config manager and optionally remove files. */ close(clear?: boolean): Operation; /** Read and parse JSON config from disk. */ get = Record>(): T; /** Serialize and persist JSON config to disk. */ put(data: Record): boolean; } /** Open a `Configer` and fail fast if the backing config path cannot be prepared. */ export declare function createConfiger(options?: ConfigerOptions): Operation; //# sourceMappingURL=configing.d.ts.map