Skip to content

Adicionar arquivo de tipagem do typescript #28

@jhownpaixao

Description

@jhownpaixao

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions