UNPKG

histoire

Version:

A fast story book powered by Vite

37 lines • 1.63 kB
import type { AffectedChange } from '../affected/types.js'; /** Work taken out of the pending set for one admission attempt. */ export interface PendingClaim { /** Classified edits, in event order. */ changes: AffectedChange[]; /** Story IDs of an interrupted batch that never produced a result. */ carried: string[]; /** The whole selected scope still has to run (initial run or interrupted scope run). */ whole: boolean; } /** * The next run's inputs: classified edits plus targets an interrupted run left * unvalidated. Admission claims the whole set in one synchronous step and puts * it back when admission is refused, so an edit can never be lost between * being noticed and being run, and nothing runs twice. */ export declare function createPendingSet(): { /** Records one classified edit. */ add(change: AffectedChange): void; /** Keeps story IDs of an interrupted batch for the successor. */ carry(ids: Iterable<string>): void; /** Marks the whole selected scope as still owed. */ carryWhole(): void; /** Takes everything and leaves the set empty. */ claim(): PendingClaim; /** Puts a refused claim back in front of edits that arrived meanwhile. */ restore(claim: PendingClaim): void; /** Forgets everything (scope change, disable). */ clear(): void; /** Nothing is owed. */ readonly empty: boolean; /** Distinct story IDs waiting (the whole-scope token counts as none). */ readonly size: number; }; /** Pending set type. */ export type PendingSet = ReturnType<typeof createPendingSet>; //# sourceMappingURL=pending.d.ts.map