1 | import type { EmitterWebhookEvent, EmitterWebhookEventName, HandlerFunction, Options, WebhookError, WebhookEventHandlerError } from "../types.js";
|
2 | export interface EventHandler<TTransformed> {
|
3 | on<E extends EmitterWebhookEventName>(event: E | E[], callback: HandlerFunction<E, TTransformed>): void;
|
4 | onAny(handler: (event: TTransformed extends unknown ? EmitterWebhookEvent : EmitterWebhookEvent & TTransformed) => any): void;
|
5 | onError(handler: (event: WebhookEventHandlerError<TTransformed>) => any): void;
|
6 | removeListener<E extends EmitterWebhookEventName>(event: E | E[], callback: HandlerFunction<E, TTransformed>): void;
|
7 | receive(event: EmitterWebhookEvent | WebhookError): Promise<void>;
|
8 | }
|
9 | export declare function createEventHandler<TTransformed>(options: Options<TTransformed>): EventHandler<TTransformed>;
|