import type { Author, NoteKind, NoteStatus, StatusTransition } from './note-types.js'; /** * On-disk note-format schema version. Stamped into export bundles and * checked on dev import so a producer and consumer never silently disagree. * v2 = the current "body under a `body:` frontmatter key" format (v1 was the * legacy trailing-```json fence, still readable by `parseNote`). */ export declare const NOTE_SCHEMA_VERSION = 2; export declare function deriveSlug(prose: string): string; export declare function deriveFilename(id: string, author: Author, kind: NoteKind, slug: string): string; /** 3-digit zero-padded session-local sequence id (001, 002, … then 1000+). */ export declare function padId(n: number): string; export declare const NOTE_FILENAME_RE: RegExp; export interface ParsedFilename { id: string; idNum: number; author: Author; kind: NoteKind; slug: string; } /** * A canonically-SHAPED note filename whose kind segment is not a * {@link NoteKind} (e.g. `lasso`, a kind the format dropped). It is a note this * format cannot type — not a stray non-note file — so it is reported rather * than skipped silently or typed as a kind it is not. */ export declare class UnknownNoteKindError extends Error { readonly filename: string; readonly kind: string; constructor(filename: string, kind: string); } /** * Parse a note filename. Returns `null` for a name that is not * canonically shaped (`status.jsonl`, a stray `README.md`), and THROWS * {@link UnknownNoteKindError} for a canonical name whose kind is not a * {@link NoteKind}. A caller that only needs the id (allocation) uses * {@link filenameIdNum}, which does not judge the kind. */ export declare function parseFilename(filename: string): ParsedFilename | null; /** * The numeric id of any canonically-shaped note filename, or `null`. Id * allocation must count EVERY note file — including one of an unknown kind, * which still occupies its id — or the next note would reuse it. */ export declare function filenameIdNum(filename: string): number | null; /** The next id given the ids already present (handles gaps): padId(max+1). */ export declare function nextId(existingIds: readonly number[]): string; /** Default UTC session folder name: `session-YYYY-MM-DD-HHMM`. */ export declare function defaultSessionName(d: Date): string; /** One-line preview of prose for note summaries. */ export declare function preview(prose: string, max?: number): string; /** Current status for a note: last `to`, or null when it has no transitions. */ export declare function currentStatusFromHistory(history: readonly StatusTransition[]): NoteStatus | null; export interface QueueEntry { noteId: string; status: NoteStatus; transitions: StatusTransition[]; } /** * Materialize per-note current status from a flat transition log, newest * touched first. One entry per note id that has ever transitioned; * optionally filtered by status. */ export declare function buildQueue(transitions: readonly StatusTransition[], filter?: { status?: NoteStatus | NoteStatus[]; }): QueueEntry[]; //# sourceMappingURL=note-format.d.ts.map