-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.d.ts
42 lines (38 loc) · 1.06 KB
/
index.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
/**
* This module contains types and interfaces
* to allow for customizations of SDK features.
*/
declare module 'statsig-node/interfaces' {
export type AdapterResponse = {
result?: string;
time?: number;
error?: Error;
};
/**
* An adapter for implementing custom storage of config specs.
* Useful for backing up data in memory.
* Can also be used to bootstrap Statsig server.
*/
export interface IDataAdapter {
/**
* Returns the data stored for a specific key
* @param key - Key of stored item to fetch
*/
get(key: string): Promise<AdapterResponse>;
/**
* Updates data stored for each key
* @param key - Key of stored item to update
* @param value - New value to store
* @param time - Time of update
*/
set(key: string, value: string, time?: number): Promise<void>;
/**
* Startup tasks to run before any fetch/update calls can be made
*/
initialize(): Promise<void>;
/**
* Cleanup tasks to run when statsig is shutdown
*/
shutdown(): Promise<void>;
}
}