/** * MRSF Writer — serialize MrsfDocument back to YAML or JSON. * * Uses CST-level (Concrete Syntax Tree) round-trip editing via the `yaml` * library so that unchanged content is byte-identical to the original file. * - Preserves YAML comments (#) * - Preserves scalar styles (>, |, quotes) * - Preserves key ordering and whitespace * - Only modifies values that actually changed * * Auto-computes selected_text_hash when selected_text changes. */ import type { MrsfDocument, Comment } from "./types.js"; /** * Compute SHA-256 hex hash of a string (UTF-8). */ export declare function computeHash(text: string): string; /** * Ensure selected_text_hash is consistent for a comment. * If selected_text is present, computes/updates the hash. * If selected_text is absent, removes the hash. */ export declare function syncHash(comment: Comment): Comment; export { toYaml, toJson } from "./serialize.js"; /** * Write an MrsfDocument to disk. * * When a YAML file already exists on disk, performs a **CST-level** round-trip * merge that preserves YAML comments, scalar styles, key ordering, and * whitespace byte-for-byte for unchanged content. * * For new files or JSON, writes from scratch. * * Writes to the same file path are serialized (queued) to prevent race * conditions from concurrent calls. All writes are atomic (temp + rename). */ export declare function writeSidecar(filePath: string, doc: MrsfDocument): Promise; //# sourceMappingURL=writer.d.ts.map