import { type CardOutcomeFact } from "./CardOutcomeFact.js"; import { type CardOutcomeLedger } from "./CardOutcomeLedger.js"; /** The longest line a read takes for a fact; a longer one is skipped, never parsed. */ export declare const MAX_FACT_BYTES: number; export interface FileCardOutcomeLedgerOptions { /** This replica's name in its files; the host's name when absent. */ readonly replica?: string; } /** * The outcome facts as append-only JSONL, one file per UTC day and per replica: * `card-outcomes-..jsonl`. Replicas that share the directory (a volume every * replica mounts) each write their own file, so no two processes append to one; the producer * reads every replica's files and orders the facts by time, so a purchase held on one replica * and claimed on another reads as one purchase. * * The directory is created private to this process, a path that is not a regular file is * refused, and a line that is not a fact, or is longer than the bound, is skipped when read * rather than trusted. Nothing here is deleted: older days are left for the operator's * retention, and only the days a read asks for are opened. */ export declare class FileCardOutcomeLedger implements CardOutcomeLedger { private readonly directory; private readonly replica; constructor(directory: string, options?: FileCardOutcomeLedgerOptions); /** * A replica's name as a file may carry it: lowercase letters, digits and dashes, at most 63, * so a pod name is kept as it reads and anything else becomes a dash. Linear, with no pattern * a hostile name could make backtrack. */ static replicaName(value: string): string; append(facts: readonly CardOutcomeFact[]): Promise; since(from: Date): Promise; /** One day's lines, appended in one write to a file that is a regular file and nothing else. */ private write; } //# sourceMappingURL=FileCardOutcomeLedger.d.ts.map