import type { EventPayload } from '@authup/core-realtime-kit'; export type DomainEventChannelName = string | ((id?: string | number) => string); export type DomainEventDestination = { namespace?: string; channel: DomainEventChannelName; }; export type DomainEventDestinations = DomainEventDestination[]; export type DomainEventPublishContext = { content: T; destinations: DomainEventDestinations; /** * Pre-mutation snapshot of the entity for `updated` events. Lives on the * publish CONTEXT (never inside `content`): `content` is the shared * realtime wire payload and must never carry previous state to * redis/socket consumers — only in-process handlers (e.g. the audit * entity-event bridge) may read it. */ dataPrevious?: Record; /** * The transaction the publishing write rides, as an opaque handle (this * package knows no persistence): an in-process handler that persists * joins it instead of taking a second connection (#3539). Wire handlers * ignore it. */ transaction?: unknown; }; export interface IDomainEventHandler { handle(ctx: DomainEventPublishContext): Promise; dispose?(): Promise; } export interface IDomainEventPublisher { publish(ctx: DomainEventPublishContext): Promise; safePublish(ctx: DomainEventPublishContext): Promise; } //# sourceMappingURL=types.d.ts.map