-
Notifications
You must be signed in to change notification settings - Fork 778
/
client.d.ts
45 lines (36 loc) · 1.06 KB
/
client.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import {ResponseError} from "@sendgrid/helpers/classes";
import {ClientRequest} from "@sendgrid/client/src/request";
import {ClientResponse} from "@sendgrid/client/src/response";
declare class Client {
constructor();
/**
* Set the SendGrid API key.
*/
setApiKey(apiKey: string): void;
/**
* Set the Twilio Email credentials.
*/
setTwilioEmailAuth(username: string, password: string): void;
/**
* Set default header
*/
setDefaultHeader(key: string, value: string): this;
/**
* Set default request
*/
setDefaultRequest<K extends keyof ClientRequest>(key: K, value: ClientRequest[K]): this;
/**
* Create headers for request
*/
createHeaders(data: { [key: string]: string }): { [key: string]: string };
/**
* Create request
*/
createRequest(data: ClientRequest): ClientRequest;
/**
* Do a request
*/
request(data: ClientRequest, cb?: (err: ResponseError, response: [ClientResponse, any]) => void): Promise<[ClientResponse, any]>;
}
declare const client: Client & { Client: typeof Client };
export = client