//#region src/eventa.d.ts declare function nanoid(): string; interface InvokeEventConstraint<_Req, _Res> {} type EventTag = string & InvokeEventConstraint; declare enum EventaType { Event = "event", MatchExpression = "matchExpression" } declare enum EventaFlowDirection { Inbound = "inbound", Outbound = "outbound" } interface DirectionalEventa extends Eventa

{ _flowDirection: EventaFlowDirection | T; } interface InboundEventa extends DirectionalEventa { _flowDirection: EventaFlowDirection.Inbound; } interface OutboundEventa extends DirectionalEventa { _flowDirection: EventaFlowDirection.Outbound; } declare function defineInboundEventa(id?: string): InboundEventa; declare function defineOutboundEventa(id?: string): OutboundEventa; interface EventaLike<_P = undefined, T extends EventaType = EventaType> { id: string; type?: T; } interface Eventa

extends EventaLike { body?: P; /** * Optional runtime metadata that can be attached to the eventa. * * NOTICE: for defineInvoke, and defineInvokeHandler, the metadata will be omitted * for smaller chunk size, this means for metadata, the data contains will not be available in the defineInvokeHandler. * * This can be used for various purposes such as logging, debugging, or providing additional context about the eventa. * Allowing the event handler to be able to access this metadata can enable more flexible and powerful event handling logic. */ metadata?: M; /** * Optional runtime metadata that can be attached to the eventa when invoking it. * * Unlike the `metadata` field, the `invokeMetadata` is specifically designed to be used when invoking the eventa, and it * will be available in the defineInvokeHandler. * * This allows for a clear separation between the metadata that describes the eventa itself and the metadata that is relevant * to the invocation of the eventa, providing more flexibility in how metadata is used and accessed within the event * handling system. */ invokeMetadata?: IM; } type InferEventaPayload = E extends Eventa ? P : never; declare function defineEventa

(id?: string, options?: { /** * Optionally inherit many properties from another parent eventa. */ inheritFrom?: Eventa; /** * Optional runtime metadata that can be attached to the eventa. * * NOTICE: for defineInvoke, and defineInvokeHandler, the metadata will be omitted * for smaller chunk size, this means for metadata, the data contains will not be available in the defineInvokeHandler. * * This can be used for various purposes such as logging, debugging, or providing additional context about the eventa. * Allowing the event handler to be able to access this metadata can enable more flexible and powerful event handling logic. */ metadata?: M; /** * Optional runtime metadata that can be attached to the eventa when invoking it. * * Unlike the `metadata` field, the `invokeMetadata` is specifically designed to be used when invoking the eventa, and it * will be available in the defineInvokeHandler. * * This allows for a clear separation between the metadata that describes the eventa itself and the metadata that is relevant * to the invocation of the eventa, providing more flexibility in how metadata is used and accessed within the event * handling system. */ invokeMetadata?: IM; }): Eventa; interface EventaMatchExpression

extends EventaLike { matcher?: (event: Eventa

) => boolean | Promise; } declare function and

(...matchExpression: Array>): EventaMatchExpression

; declare function or

(...matchExpression: Array>): EventaMatchExpression

; /** * Match by is powerful utility function that allows you to create a match expression based on various criteria * when working with eventa (event system). * * Semantics like glob matching, RegExp, or even custom matcher function can be used to create complex match * expressions that can be used to filter and handle events in a flexible way. */ declare function matchBy

(glob: string, inverted?: boolean): EventaMatchExpression

; declare function matchBy

(options: { ids: string[]; }, inverted?: boolean): EventaMatchExpression

; declare function matchBy

(options: { eventa: Eventa

[]; }, inverted?: boolean): EventaMatchExpression

; declare function matchBy

(options: { types: EventaType[]; }, inverted?: boolean): EventaMatchExpression

; declare function matchBy

(regExp: RegExp, inverted?: boolean): EventaMatchExpression

; declare function matchBy

= Eventa

>(matcher: (event: E) => boolean | Promise): EventaMatchExpression

; //#endregion export { nanoid as _, EventaLike as a, InboundEventa as c, OutboundEventa as d, and as f, matchBy as g, defineOutboundEventa as h, EventaFlowDirection as i, InferEventaPayload as l, defineInboundEventa as m, EventTag as n, EventaMatchExpression as o, defineEventa as p, Eventa as r, EventaType as s, DirectionalEventa as t, InvokeEventConstraint as u, or as v }; //# sourceMappingURL=eventa-CCPqecvv.d.mts.map