import { type CardOutcomeFact } from "./CardOutcomeFact.js"; import type { CardOutcomeLedger } from "./CardOutcomeLedger.js"; /** How many facts may wait to be written; beyond it a fact is dropped and counted. */ export declare const CARD_OUTCOME_QUEUE_CAPACITY = 10000; export interface CardOutcomeRecorderOptions { readonly ledger: CardOutcomeLedger; /** Told when facts could not be kept: how many, and the code that says why. */ readonly onDropped?: (count: number, code: string) => void; readonly capacity?: number; } /** * The cards family's outcome facts, kept after the fact. `note` is what the request path * calls, once its answer is decided: it queues the fact and returns, never awaits anything and * never throws, so recording can neither slow, fail nor change an authorization. The facts are * checked and written after the current turn of the event loop, in order, one append per batch. * * What is lost is counted, never retried into the request path: a full queue, a fact that does * not fit its schema, and a ledger that refuses a write each drop their facts and report how * many. The evidence such a purchase leads to is then incomplete, and stays at what the facts * that were kept establish. */ export declare class CardOutcomeRecorder { private readonly options; private readonly queue; private readonly capacity; private writing; constructor(options: CardOutcomeRecorderOptions); /** Queues one fact. Returns at once; nothing here can reach the caller. */ note(fact: CardOutcomeFact): void; /** Resolves once every fact queued so far has been written or dropped. */ flush(): Promise; private drain; private dropped; } //# sourceMappingURL=CardOutcomeRecorder.d.ts.map