@@ -51,23 +51,26 @@ export namespace Webhooks {
5151 host?: string
5252 url?: string
5353 }
54- export class Webhooks {
55- constructor (options: Options)
54+ }
5655
57- public on (event: 'error', callback: (event: Error) => void): void
58- public on (event: '*' | string | string[], callback: (event: Webhooks.WebhookEvent<any>) => void): void
59- public on (event: '*' | string | string[], callback: (event: Webhooks.WebhookEvent<any>) => Promise<void>): void
60- ${ signatures . join ( '\n' ) }
56+ export class Webhooks {
57+ constructor (options: Options)
6158
62- public sign (data: any): string
63- public verify (eventPayload: any, signature: string): boolean
64- public verifyAndReceive (options: { id: string, name: string, payload: any, signature: string }): Promise<void>
65- public receive (options: { id: string, name: string, payload: any }): Promise<void>
66- public removeListener (event: string | string[], callback: (event: Webhooks.WebhookEvent<any>) => void): void
67- public removeListener (event: string | string[], callback: (event: Webhooks.WebhookEvent<any>) => Promise<void>): void
68- public middleware (request: http.ClientRequest, response: http.ServerResponse, next: (err?: any) => void): (request: http.IncomingMessage, response: http.ServerResponse) => void
69- }
59+ public on (event: 'error', callback: (event: Error) => void): void
60+ public on (event: '*' | string | string[], callback: (event: Webhooks.WebhookEvent<any>) => void): void
61+ public on (event: '*' | string | string[], callback: (event: Webhooks.WebhookEvent<any>) => Promise<void>): void
62+ ${ signatures . join ( '\n' ) }
63+
64+ public sign (data: any): string
65+ public verify (eventPayload: any, signature: string): boolean
66+ public verifyAndReceive (options: { id: string, name: string, payload: any, signature: string }): Promise<void>
67+ public receive (options: { id: string, name: string, payload: any }): Promise<void>
68+ public removeListener (event: string | string[], callback: (event: Webhooks.WebhookEvent<any>) => void): void
69+ public removeListener (event: string | string[], callback: (event: Webhooks.WebhookEvent<any>) => Promise<void>): void
70+ public middleware (request: http.ClientRequest, response: http.ServerResponse, next: (err?: any) => void): (request: http.IncomingMessage, response: http.ServerResponse) => void
7071}
72+
73+ export = Webhooks
7174`
7275
7376const filepath = 'index.d.ts'
0 commit comments