1 | import { createEventHandler } from "./event-handler/index";
|
2 | import { EmitterWebhookEvent, EmitterWebhookEventName, HandlerFunction, Options, WebhookError, WebhookEventHandlerError, EmitterWebhookEventWithStringPayloadAndSignature, EmitterWebhookEventWithSignature } from "./types";
|
3 | export { createNodeMiddleware } from "./middleware/node/index";
|
4 | export { emitterEventNames } from "./generated/webhook-names";
|
5 | declare class Webhooks<TTransformed = unknown> {
|
6 | sign: (payload: string | object) => Promise<string>;
|
7 | verify: (eventPayload: string | object, signature: string) => Promise<boolean>;
|
8 | on: <E extends EmitterWebhookEventName>(event: E | E[], callback: HandlerFunction<E, TTransformed>) => void;
|
9 | onAny: (callback: (event: EmitterWebhookEvent) => any) => void;
|
10 | onError: (callback: (event: WebhookEventHandlerError) => any) => void;
|
11 | removeListener: <E extends EmitterWebhookEventName>(event: E | E[], callback: HandlerFunction<E, TTransformed>) => void;
|
12 | receive: (event: EmitterWebhookEvent) => Promise<void>;
|
13 | verifyAndReceive: (options: EmitterWebhookEventWithStringPayloadAndSignature | EmitterWebhookEventWithSignature) => Promise<void>;
|
14 | constructor(options: Options<TTransformed> & {
|
15 | secret: string;
|
16 | });
|
17 | }
|
18 | export { createEventHandler, Webhooks, EmitterWebhookEvent, EmitterWebhookEventName, WebhookError, };
|