-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
adicionar suporte ao typescript:
declare module 'node-webhooks' {
import type { EventEmitter2 } from 'eventemitter2';
interface WebHookOptions {
db: string | Record<string, string[]>;
httpSuccessCodes?: number[];
}
type WebHookCallback = (
shortname: string,
jsonData: any,
headersData?: Record<string, string>
) => void;
class WebHooks {
constructor(options: WebHookOptions);
trigger(shortname: string, jsonData: any, headersData?: Record<string, string>): void;
add(shortname: string, url: string): Promise<boolean>;
remove(shortname: string, url?: string): Promise<boolean>;
getDB(): Promise<Record<string, string[]>>;
getWebHook(shortname: string): Promise<string[]>;
getListeners(): Record<string, WebHookCallback>;
getEmitter(): EventEmitter2;
}
export = WebHooks;
}
Metadata
Metadata
Assignees
Labels
No labels