/** Why a server refused a mutation. */ export type SyncMutationRejectionKind = 'conflict' | 'permanent' | 'retryable'; /** Serializable rejection metadata carried over the Sync protocol. */ export type SyncMutationRejection = { kind: SyncMutationRejectionKind; message: string; /** Stable application or adapter code suitable for programmatic handling. */ code?: string; /** Explicitly public, serializable conflict/remediation context. */ details?: unknown; /** Server hint for transient failures. Clients still enforce their own ceiling. */ retryAfterMs?: number; }; export type SyncMutationRejectionErrorOptions = { code?: string; details?: unknown; retryAfterMs?: number; cause?: unknown; }; /** * Throw from a mutation to deliberately classify its client-facing outcome. * Details are sent to the client, so callers must never put secrets in them. */ export declare class SyncMutationRejectionError extends Error { readonly code: string | undefined; readonly details: unknown; readonly kind: SyncMutationRejectionKind; readonly retryAfterMs: number | undefined; constructor(kind: SyncMutationRejectionKind, message: string, options?: SyncMutationRejectionErrorOptions); } /** Client-side error returned to the caller when an operation is rejected. */ export declare class SyncMutationRejectedError extends Error { readonly operationId: string | undefined; readonly rejection: SyncMutationRejection; constructor(rejection: SyncMutationRejection, operationId?: string); } /** Convert an arbitrary mutation failure into safe wire metadata. */ export declare const toSyncMutationRejection: (error: unknown) => SyncMutationRejection;