This repository was archived by the owner on Aug 20, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ declare module 'sendgrid-rest' {
2+ /**
3+ * request holds the request to an API Call
4+ * @field `test` use this to allow for http calls
5+ * @field `port` set the port for http calls
6+ */
7+ export interface Request {
8+ host : string ,
9+ method : string ,
10+ path : string ,
11+ headers : { [ key : string ] : any } ,
12+ body : object | string ,
13+ queryParams : { [ key : string ] : any } ,
14+ test : boolean ,
15+ port : string ,
16+ }
17+
18+ /**
19+ * response holds the response from an API call, use this as an initializer
20+ * like so: JSON.parse(JSON.stringify(response))
21+ */
22+ export interface Response {
23+ statusCode : string ,
24+ body : object | string ,
25+ headers : { [ key : string ] : any } ,
26+ }
27+
28+ /**
29+ * Client allows for quick and easy access any REST or REST-like API.
30+ */
31+ export class Client {
32+ constructor ( globalRequest : Request )
33+ /**
34+ * utility function to create an empty request object
35+ */
36+ public emptyRequest ( ) : Request
37+ /**
38+ * API is the main interface to the API.
39+ */
40+ public API ( endpointRequest : Request , callback : ( response : Response ) => void ) : void
41+ }
42+
43+ export var emptyRequest : Request
44+ export var request : Request
45+ }
You can’t perform that action at this time.
0 commit comments