Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adicionar arquivo de tipagem do typescript #28

Open
jhownpaixao opened this issue Oct 16, 2023 · 0 comments
Open

Adicionar arquivo de tipagem do typescript #28

jhownpaixao opened this issue Oct 16, 2023 · 0 comments

Comments

@jhownpaixao
Copy link

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;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant