import { z } from 'zod'; export declare const DappEventSubscriptionStateSchema: "network.xyo.dapp.event.subscription.state" & { readonly __schema: true; }; export declare const DappEventConsumerOutcomeSchema: "network.xyo.dapp.event.consumer.outcome" & { readonly __schema: true; }; export declare const DappEventFenceEpochZod: z.ZodNumber; export declare const DappEventLeaseTimeZod: z.ZodNumber; export declare const DappEventLeaseDurationZod: z.ZodNumber; export declare const DappEventRetryLimitZod: z.ZodNumber; export declare const DappEventRetryCountZod: z.ZodNumber; export declare const DappEventSubscriptionDefinitionZod: z.ZodObject<{ subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; retryLimit: z.ZodNumber; }, z.core.$strict>; export type DappEventSubscriptionDefinition = z.infer; export declare const DappEventSubscriptionIdleStateZod: z.ZodObject<{ status: z.ZodLiteral<"idle">; cursor: z.ZodNumber; fenceEpoch: z.ZodNumber; retryCount: z.ZodNumber; subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; retryLimit: z.ZodNumber; schema: z.ZodLiteral<"network.xyo.dapp.event.subscription.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>; export declare const DappEventSubscriptionScheduledStateZod: z.ZodObject<{ status: z.ZodLiteral<"scheduled">; cursor: z.ZodNumber; fenceEpoch: z.ZodNumber; retryCount: z.ZodNumber; subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; retryLimit: z.ZodNumber; schema: z.ZodLiteral<"network.xyo.dapp.event.subscription.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>; export declare const DappEventSubscriptionRunningStateZod: z.ZodObject<{ status: z.ZodLiteral<"running">; leaseExpiresAt: z.ZodNumber; cursor: z.ZodNumber; fenceEpoch: z.ZodNumber; retryCount: z.ZodNumber; subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; retryLimit: z.ZodNumber; schema: z.ZodLiteral<"network.xyo.dapp.event.subscription.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>; export declare const DappEventBlockedRecordZod: z.ZodObject<{ sequence: z.ZodNumber; eventId: z.ZodString; eventFingerprint: z.ZodString; reasonCode: z.ZodString; }, z.core.$strict>; export declare const DappEventSubscriptionBlockedStateZod: z.ZodObject<{ status: z.ZodLiteral<"blocked">; blockedRecord: z.ZodObject<{ sequence: z.ZodNumber; eventId: z.ZodString; eventFingerprint: z.ZodString; reasonCode: z.ZodString; }, z.core.$strict>; cursor: z.ZodNumber; fenceEpoch: z.ZodNumber; retryCount: z.ZodNumber; subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; retryLimit: z.ZodNumber; schema: z.ZodLiteral<"network.xyo.dapp.event.subscription.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>; export declare const DappEventSubscriptionStateZod: z.ZodDiscriminatedUnion<[z.ZodObject<{ status: z.ZodLiteral<"idle">; cursor: z.ZodNumber; fenceEpoch: z.ZodNumber; retryCount: z.ZodNumber; subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; retryLimit: z.ZodNumber; schema: z.ZodLiteral<"network.xyo.dapp.event.subscription.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>, z.ZodObject<{ status: z.ZodLiteral<"scheduled">; cursor: z.ZodNumber; fenceEpoch: z.ZodNumber; retryCount: z.ZodNumber; subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; retryLimit: z.ZodNumber; schema: z.ZodLiteral<"network.xyo.dapp.event.subscription.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>, z.ZodObject<{ status: z.ZodLiteral<"running">; leaseExpiresAt: z.ZodNumber; cursor: z.ZodNumber; fenceEpoch: z.ZodNumber; retryCount: z.ZodNumber; subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; retryLimit: z.ZodNumber; schema: z.ZodLiteral<"network.xyo.dapp.event.subscription.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>, z.ZodObject<{ status: z.ZodLiteral<"blocked">; blockedRecord: z.ZodObject<{ sequence: z.ZodNumber; eventId: z.ZodString; eventFingerprint: z.ZodString; reasonCode: z.ZodString; }, z.core.$strict>; cursor: z.ZodNumber; fenceEpoch: z.ZodNumber; retryCount: z.ZodNumber; subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; retryLimit: z.ZodNumber; schema: z.ZodLiteral<"network.xyo.dapp.event.subscription.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>], "status">; export type DappEventSubscriptionState = z.infer; export type DappEventSubscriptionIdleState = z.infer; export type DappEventSubscriptionScheduledState = z.infer; export type DappEventSubscriptionRunningState = z.infer; export type DappEventSubscriptionBlockedState = z.infer; export declare const DappEventConsumerOutcomeZod: z.ZodObject<{ schema: z.ZodLiteral<"network.xyo.dapp.event.consumer.outcome" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; sequence: z.ZodNumber; eventId: z.ZodString; eventFingerprint: z.ZodString; outcomeId: z.ZodString; disposition: z.ZodEnum<{ committed: "committed"; "already-committed": "already-committed"; }>; }, z.core.$strict>; export type DappEventConsumerOutcome = z.infer; export declare const DappEventSubscriptionTransitionIssueCodes: readonly ["event-subscription.blocked", "event-subscription.cursor-mismatch", "event-subscription.fence-exhausted", "event-subscription.fence-stale", "event-subscription.lease-active", "event-subscription.lease-expired", "event-subscription.not-scheduled", "event-subscription.not-running", "event-subscription.outcome-mismatch", "event-subscription.scope-mismatch", "event-subscription.sequence-exhausted", "event-subscription.tail-behind-cursor"]; export declare const DappEventSubscriptionTransitionIssueCodeZod: z.ZodEnum<{ "event-subscription.blocked": "event-subscription.blocked"; "event-subscription.cursor-mismatch": "event-subscription.cursor-mismatch"; "event-subscription.fence-exhausted": "event-subscription.fence-exhausted"; "event-subscription.fence-stale": "event-subscription.fence-stale"; "event-subscription.lease-active": "event-subscription.lease-active"; "event-subscription.lease-expired": "event-subscription.lease-expired"; "event-subscription.not-scheduled": "event-subscription.not-scheduled"; "event-subscription.not-running": "event-subscription.not-running"; "event-subscription.outcome-mismatch": "event-subscription.outcome-mismatch"; "event-subscription.scope-mismatch": "event-subscription.scope-mismatch"; "event-subscription.sequence-exhausted": "event-subscription.sequence-exhausted"; "event-subscription.tail-behind-cursor": "event-subscription.tail-behind-cursor"; }>; export type DappEventSubscriptionTransitionIssueCode = z.infer; export declare class DappEventSubscriptionTransitionError extends Error { readonly code: DappEventSubscriptionTransitionIssueCode; constructor(code: DappEventSubscriptionTransitionIssueCode, message: string); } export declare function createDappEventSubscriptionState(definitionValue: unknown, cursorValue?: unknown): DappEventSubscriptionIdleState; /** Make an idle subscription schedulable exactly when its stream has unread work. */ export declare function scheduleDappEventSubscription(stateValue: unknown, tailValue: unknown): DappEventSubscriptionState; /** Claim scheduled work, or reclaim an expired lease, under a fresh fence. */ export declare function claimDappEventSubscription(input: { readonly leaseDuration: unknown; readonly now: unknown; readonly state: unknown; }): DappEventSubscriptionRunningState; /** Advance one cursor only after an exact durable consumer outcome is available. */ export declare function advanceDappEventSubscription(input: { readonly fenceEpoch: unknown; readonly now: unknown; readonly outcome: unknown; readonly record: unknown; readonly state: unknown; }): DappEventSubscriptionRunningState; /** Retain a poison event at the cursor and block once the retry bound is exhausted. */ export declare function failDappEventSubscription(input: { readonly fenceEpoch: unknown; readonly now: unknown; readonly reasonCode: unknown; readonly record: unknown; readonly state: unknown; }): DappEventSubscriptionBlockedState | DappEventSubscriptionScheduledState; /** Release a runner by comparing its fenced cursor against a current stream tail. */ export declare function releaseDappEventSubscription(input: { readonly fenceEpoch: unknown; readonly state: unknown; readonly tail: unknown; }): DappEventSubscriptionIdleState | DappEventSubscriptionScheduledState; //# sourceMappingURL=eventSubscription.d.ts.map