Skip to content

Commit d24bc06

Browse files
authored
fix: Fix typings for @sendgrid/eventwebhook (#1180)
1 parent ff40974 commit d24bc06

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

packages/eventwebhook/index.d.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import {EventWebhook, EventWebhookHeader} = require('./src/eventwebhook');
1+
import EventWebhook = require('./src/eventwebhook');
22

3-
export {
4-
EventWebhook,
5-
EventWebhookHeader
6-
};
3+
export = EventWebhook;

packages/eventwebhook/src/eventwebhook.d.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,16 @@ declare class EventWebhook {
1919
verifySignature(publicKey: PublicKey, payload: string|Buffer, signature: string, timestamp: string): boolean;
2020
}
2121

22-
export = EventWebhook;
22+
/*
23+
* This class lists headers that get posted to the webhook. Read the docs for
24+
* more details: https://sendgrid.com/docs/for-developers/tracking-events/event
25+
*/
26+
declare class EventWebhookHeader {
27+
static SIGNATURE(): string;
28+
static TIMESTAMP(): string
29+
}
30+
31+
export {
32+
EventWebhook,
33+
EventWebhookHeader,
34+
};

test/typescript/eventwebhook.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import EventWebhook = require('@sendgrid/eventwebhook');
1+
import { EventWebhook } from '@sendgrid/eventwebhook';
22

33
var ew = new EventWebhook();
44
const PUBLIC_KEY = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEDr2LjtURuePQzplybdC+u4CwrqDqBaWjcMMsTbhdbcwHBcepxo7yAQGhHPTnlvFYPAZFceEu/1FwCM/QmGUhA==";

0 commit comments

Comments
 (0)