import type { MemoryEntry, MemoryEntryFrontmatter } from "./types.js"; /** A parsed entry file: frontmatter (may be absent — CC allows bare files; harvest mints them) + body. */ export interface ParsedEntryFile { /** The hidden immutable id (`id:` frontmatter line), when present. */ id?: string; frontmatter: MemoryEntryFrontmatter; body: string; /** True when the file had a well-formed `---` frontmatter block at all. */ hadFrontmatter: boolean; } /** The id-shape contract, shared with the WRITE path (KNOWN-ISSUES 幽灵行加固): the File backend's * applyPatches refuses any patch whose id this rejects — such an entry would be applied + ledgered, * yet THIS parser drops the id on read (a fresh one gets minted), leaving the file on disk but the * id permanently invisible. Read gate and write gate must stay one predicate. */ export declare function isValidEntryId(value: string): boolean; /** Parse one memory file's text into frontmatter + body. Never throws — an unfenced file is all-body. */ export declare function parseEntryFile(text: string): ParsedEntryFile; /** Serialize an entry to its canonical file projection (id FIRST — the hidden immutable field). */ export declare function serializeEntryFile(entry: Pick): string; /** * Content-hash rev (the CAS baseline). Computed over the SEMANTIC content — id, structured * frontmatter fields, preserved extra lines, and body — via a canonical JSON tuple, NOT raw file * bytes: engine (parsing disk files) and backend (storing entries) must agree on the rev regardless * of incidental serialization formatting, or every materialize would see a phantom diff. */ export declare function computeEntryRev(entry: Pick): string; /** Parse a file's text directly into a full MemoryEntry (id must already be present/decided). */ export declare function entryFromFile(text: string, id: string, slug: string, scope: string): MemoryEntry; //# sourceMappingURL=frontmatter.d.ts.map