import { z } from 'zod'; import type { EffectReceipt } from './effectModel.ts'; import type { PreparedEffectRecord } from './effectPreparation.ts'; import type { EffectReceiptIssue } from './effectValidation.ts'; export declare const EffectReceiptJournalDurabilityZod: z.ZodEnum<{ "crash-durable": "crash-durable"; "test-memory": "test-memory"; }>; export type EffectReceiptJournalDurability = z.infer; export declare const EffectReceiptJournalIssueCodes: readonly ["effect-journal.conflict", "effect-journal.corrupt", "effect-journal.invalid-append", "effect-journal.invalid-preparation", "effect-journal.invalid-receipt", "effect-journal.preparation-not-compactable", "effect-journal.preparation-required", "effect-journal.stage-count-invalid", "effect-journal.unavailable"]; export declare const EffectReceiptJournalIssueCodeZod: z.ZodEnum<{ "effect-journal.conflict": "effect-journal.conflict"; "effect-journal.corrupt": "effect-journal.corrupt"; "effect-journal.invalid-append": "effect-journal.invalid-append"; "effect-journal.invalid-preparation": "effect-journal.invalid-preparation"; "effect-journal.invalid-receipt": "effect-journal.invalid-receipt"; "effect-journal.preparation-not-compactable": "effect-journal.preparation-not-compactable"; "effect-journal.preparation-required": "effect-journal.preparation-required"; "effect-journal.stage-count-invalid": "effect-journal.stage-count-invalid"; "effect-journal.unavailable": "effect-journal.unavailable"; }>; export type EffectReceiptJournalIssueCode = z.infer; export interface EffectReceiptJournalIssue { readonly code: EffectReceiptJournalIssueCode; readonly message: string; readonly receiptIssues: readonly EffectReceiptIssue[]; } export interface EffectReceiptJournalAppendSuccess { readonly changed: boolean; readonly receipt: EffectReceipt; readonly success: true; } export interface EffectReceiptJournalAppendFailure { readonly issue: EffectReceiptJournalIssue; readonly success: false; } export type EffectReceiptJournalAppendResult = EffectReceiptJournalAppendFailure | EffectReceiptJournalAppendSuccess; export interface EffectReceiptJournal { readonly durability: EffectReceiptJournalDurability; append(expected: EffectReceipt | undefined, next: EffectReceipt): Promise; list(): Promise; read(effectId: string): Promise; } export interface EffectPreparationJournalWriteSuccess { readonly changed: boolean; readonly record: PreparedEffectRecord; readonly success: true; } export interface EffectPreparationJournalCompactionSuccess { readonly changed: boolean; readonly receipt: EffectReceipt; readonly success: true; } /** Privileged sidecar operations; ordinary receipt/status surfaces use EffectReceiptJournal. */ export interface EffectPreparationJournal extends EffectReceiptJournal { compactPreparation(expected: EffectReceipt): Promise; prepare(record: PreparedEffectRecord): Promise; readPreparation(effectId: string): Promise; } export declare class EffectReceiptJournalError extends Error { readonly code: EffectReceiptJournalIssueCode; readonly issue: EffectReceiptJournalIssue; constructor(issue: EffectReceiptJournalIssue, options?: ErrorOptions); } export declare function validateEffectPreparationJournalWrite(persistedValue: unknown, nextValue: unknown): EffectPreparationJournalWriteSuccess | EffectReceiptJournalAppendFailure; export declare function assertEffectPreparationJournalWrite(persistedValue: unknown, nextValue: unknown): EffectPreparationJournalWriteSuccess; export declare function isEffectPreparationCompactable(receiptValue: unknown): boolean; export declare function validateEffectReceiptJournalAppend(persistedValue: unknown, expectedValue: EffectReceipt | undefined, nextValue: unknown): EffectReceiptJournalAppendResult; export declare function assertEffectReceiptJournalAppend(persistedValue: unknown, expectedValue: EffectReceipt | undefined, nextValue: unknown): EffectReceiptJournalAppendSuccess; //# sourceMappingURL=effectJournal.d.ts.map