import { Context } from "../shared-context"; export type Subscriber = (data: Event) => Promise; export type SubscriberContext = { /** * The ID of the subscriber. Useful when retrying failed subscribers. */ subscriberId: string; }; export type SubscriberDescriptor = { id: string; subscriber: Subscriber; }; export type EventMetadata = Record & { /** * The ID of the event's group. Grouped events are useful when you have distributed transactions * where you need to explicitly group, release and clear events upon lifecycle events of a transaction. * * When set, you must release the grouped events using the Event Module's `releaseGroupedEvents` method to emit the events. */ eventGroupId?: string; }; export type Event = { /** * The event's name. * * @example * user.created */ name: string; /** * Additional meadata to pass with the event. */ metadata?: EventMetadata; /** * The data payload that subscribers receive. For example, the ID or IDs of the created user. (e.g. { id: "123" } or { ids: ["123", "456"] }) */ data: TData; }; /** * The details of an event to emit. */ export type Message = Event & { options?: Record; }; export type RawMessageFormat = { eventName: string; data: TData; source: string; object: string; action?: string; context?: Pick; options?: Record; }; //# sourceMappingURL=common.d.ts.map