import { EventEmitter } from "node:events"; import { Channel } from "@myunisoft/redis"; import { ValidateFunction } from "ajv"; import type { Logger } from "pino"; import { Transaction, TransactionStore } from "./store/transaction.class.js"; import type { DispatcherApprovementMessage, GenericEvent, IncomerChannelMessages, IncomerRegistrationMessage, RetryMessage, TransactionMetadata } from "../types/index.js"; import { NestedValidationFunctions, type StandardLog } from "../utils/index.js"; export declare const APPROVEMENT_SYM: unique symbol; export declare const CLOSE_SYM: unique symbol; export declare const RETRY_SYM: unique symbol; export declare const CUSTOM_EVENT_SYM: unique symbol; type AnyIncomerChannelMessage = (IncomerChannelMessages["DispatcherMessages"] | (IncomerChannelMessages["IncomerMessages"] | RetryMessage)); type AnyEventChannelMessage = IncomerRegistrationMessage | AnyIncomerChannelMessage; type DispatchedEvent = (Omit["DispatcherMessages"] | DispatcherApprovementMessage, "redisMetadata">) & { redisMetadata: Omit, "transactionId" | "iteration">; }; export interface DispatchEventOptions { channel: Channel["DispatcherMessages"] | DispatcherApprovementMessage>; event: DispatchedEvent; redisMetadata: { mainTransaction: boolean; resolved: boolean; relatedTransaction?: null | string; eventTransactionId?: null | string; iteration?: number; }; store: TransactionStore<"incomer"> | TransactionStore<"dispatcher">; dispatcherTransactionUUID?: string; } export type customValidationCbFn = (event: T) => void; export type eventsValidationFn = Map | NestedValidationFunctions>; export interface EventsHandlerOptions { privateUUID: string; dispatcherChannelName: string; eventsValidation?: { eventsValidationFn?: eventsValidationFn; customValidationCbFn?: customValidationCbFn; }; standardLog?: StandardLog; parentLogger: Logger; } export declare class EventsHandler extends EventEmitter { #private; readonly privateUUID: string; readonly dispatcherChannelName: string; constructor(options: EventsHandlerOptions); dispatch(options: DispatchEventOptions): Promise | Transaction<"incomer">>; handleEvents(channel: string, event: AnyEventChannelMessage): Promise; private redisMetadataValidation; private dispatcherChannelMessagesSchemaValidation; private incomerChannelMessagesSchemaValidation; } export {}; //# sourceMappingURL=events.class.d.ts.map