/** * Which parts of a card are new since the last observation. * * The design brief is explicit: a first load or a reconnect shows the final * state directly, and only a newly committed event plays its animation once. * These helpers hold that rule as pure functions over seq sets, so the cards * carry no animation bookkeeping of their own and the rule is testable without * a DOM. * * @module dsh-context-snapshot-bar/client/motion */ /** What one observation saw, and what arrived since the previous one. */ export interface MotionDelta { /** Seqs present in this observation that the previous one did not have; empty on the first observation. */ readonly entering: ReadonlySet; /** The observation itself, to hand back as the next call's `previous`. */ readonly seen: ReadonlySet; } /** * Diff one observation against the previous one. * @param previous - seqs the previous observation saw, or null when this is the first. * @param seqs - the seqs of the current observation, in presentation order. * @returns the entering seqs and the set to remember. */ export declare function observeSeqs(previous: ReadonlySet | null, seqs: readonly number[]): MotionDelta; /** * The identity of one committed snapshot commit, as the arrival animation keys * on it. A different identity after the first observation means the producer * committed again, or the record's standing moved. * @param status - the record's standing. * @param seq - the committing event's seq, or null when nothing was committed. * @returns a stable identity string. */ export declare function commitIdentity(status: string, seq: number | null): string; /** * Whether two observations saw the same seqs. State updates use this to hand * back the identical reference, so remembering an unchanged observation does * not schedule another render. * @param left - one observation, or null for none. * @param right - the other observation. * @returns true when both hold the same seqs. */ export declare function sameSeqs(left: ReadonlySet | null, right: ReadonlySet): boolean; //# sourceMappingURL=motion.d.ts.map