-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtypes.d.ts
74 lines (70 loc) · 2.01 KB
/
types.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
* Returns a Promise that resolves with a new LibNameCoreAPI object.
*
* @param {string} tenantId the tenant id
* @param {string} apiKey the API key for your integration
* @param {string} accessToken the access token for your integration
* @returns {Promise<LibNameCoreAPI>} a Promise with a LibNameCoreAPI object
*/
declare function init(tenantId: string, apiKey: string, accessToken: string): Promise<LibNameCoreAPI>;
/**
* This class provides methods to call your {{LIB_NAME}} APIs.
* Before calling any method initialize the instance by calling the `init` method on it
* with valid values for tenantId, apiKey and accessToken
*/
declare class LibNameCoreAPI {
/**
* Initializes a LibNameCoreAPI object and returns it.
*
* @param {string} tenantId the tenant id
* @param {string} apiKey the API key for your integration
* @param {string} accessToken the access token for your integration
* @returns {Promise<LibNameCoreAPI>} a LibNameCoreAPI object
*/
init(tenantId: string, apiKey: string, accessToken: string): Promise<LibNameCoreAPI>;
/**
* The tenant id
*
* @type {string}
*/
tenantId: string;
/**
* The api key from your integration
*
* @type {string}
*/
apiKey: string;
/**
* The access token from your integration
*
* @type {string}
*/
accessToken: string;
/**
* Get something.
*
* @param {MyParameters} [parameters={}] parameters to pass
* @returns {Promise<Response>} the response
*/
getSomething(parameters?: MyParameters): Promise<Response>;
}
/**
* An example of a typed object.
*
* @typedef {object} MyParameters
* @property {string} optionA - some option
* @property {string} optionB - another option
*/
declare type MyParameters = {
optionA: string;
optionB: string;
};
/**
* Another typed object.
*
* @typedef {object} AnotherThing
* @property {boolean} mayBeSomething - an option
*/
declare type AnotherThing = {
mayBeSomething: boolean;
};