import type { DeliverableChange } from './deliverable-guards.js'; import { KIND_CHANGED, KIND_REJECTED, type Notice } from './notice.js'; import type { DocumentStore } from './store.js'; import type { StoreEvent } from './store-types.js'; /** The consumer's reason is relayed verbatim up to this many characters, then cut with a marker. */ export declare const REASON_CAP = 600; /** The copy to the lead carries a shorter cut. */ export declare const COPY_REASON_CAP = 200; export type RelayType = ReturnType[number]; /** Who gets the short copy for a type produced by `section`: its lead, else the root; never the producer. */ export type CopyTo = (section: string, producer: string) => string | undefined; /** A reason, verbatim, or its first `cap` characters followed by a marker that says it was cut. */ export declare function capReason(reason: string, cap: number): string; /** Every rejection relay the committed log obliges, in order (producer first, then the copy). */ export declare function deriveRelays(types: readonly RelayType[], events: readonly StoreEvent[], copyTo?: CopyTo, /** `max_rework_rounds` per consuming section (P4.7). Without an entry the text is the one of P3.9. */ caps?: Readonly>): Notice[]; /** * The relays owed for an accept refused because the producer's deliverable files changed. The key names the * version and the problems, so a consumer that retries the accept while the files still differ is not relayed * again, and a different difference is. */ export declare function changedRelays(c: DeliverableChange, t: RelayType, seq: number, copyTo?: CopyTo): Notice[]; /** What lead-watch (P3.13) needs of one producer relay. */ export interface RelayFact { kind: typeof KIND_REJECTED | typeof KIND_CHANGED; doc: string; version: number; producer: string; key: string; state: 'pending' | 'delivered' | 'exhausted'; /** When the relay to the producer was delivered. */ delivered_at?: string; failures: number; /** The first version of the document published after the rejected one, and when (the producer's reaction). */ republished_version?: number; republished_at?: string; copies: { to: string; state: 'pending' | 'delivered' | 'exhausted'; delivered_at?: string; }[]; } /** One fact per relay to a producer, in order; `stateOf` and `deliveredAt` come from the delivery journal. */ export declare function relayFacts(notices: readonly Notice[], events: readonly StoreEvent[], stateOf: (n: Notice) => RelayFact['state'], info: (n: Notice) => { deliveredAt?: string; failures: number; }): RelayFact[]; //# sourceMappingURL=relay.d.ts.map