import { Effect, Schema } from 'effect'; import { type Transaction } from '@tanstack/react-db'; import { type HandlerName } from '../../domain/identity/index.js'; import type { SyncReporter } from '../../domain/sync-event/index.js'; import type { WriteError } from '../../domain/sync-error/index.js'; import type { EffectRunner } from '../../platform/effect-runner/index.js'; import type { SyncFlow } from '../../flow/sync-flow/index.js'; import { type OutboxEntry, type OutboxEntryFailed, type PendingEntry } from '../entries/index.js'; import type { Handler } from '../handlers/index.js'; export type OfflineActionOutbox = { readonly enqueue: (entries: ReadonlyArray) => Effect.Effect; readonly delivered: (id: string, transaction?: Transaction) => Effect.Effect; readonly registerHandler: (name: HandlerName, handler: Handler) => void; readonly list: () => Effect.Effect; }; export type OfflineActionTransaction = Transaction & { readonly delivered: Promise; }; export type OfflineActionConfig = { name: string; payload: Schema.Codec; onMutate: (payload: P) => void; mutationFn: (payload: P, context: { readonly entryId: string; }) => Effect.Effect | Promise; queue?: (payload: P) => string; }; export declare const makeOfflineActions: (args: { outbox: OfflineActionOutbox; runner: EffectRunner; report: SyncReporter; flow: SyncFlow; }) => { create:

(action: OfflineActionConfig) => (payload: P) => OfflineActionTransaction; replayAll: Effect.Effect; }; //# sourceMappingURL=offline-action.d.ts.map