forked from launchdarkly/node-server-sdk-dynamodb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
63 lines (54 loc) · 1.97 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Type definitions for ldclient-node-dynamodb-store
/**
* Interface for the DynamoDB feature store component to be used with the LaunchDarkly SDK.
*
* See: https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store
*/
declare module 'ldclient-node-dynamodb-store' {
import { LDFeatureStore, LDLogger } from 'ldclient-node';
import { DynamoDB } from 'aws-sdk';
/**
* Create a feature flag store backed by DynamoDB.
*/
export function DynamoDBFeatureStore(
/**
* The table name in DynamoDB. This table must already exist (see readme).
*/
tableName: string,
/**
* Options for configuring the feature store.
*/
options?: LDDynamoDBOptions
): LDFeatureStore;
/**
* Options for configuring a DynamoDBFeatureStore.
*/
export interface LDDynamoDBOptions {
/**
* Options to be passed to the DynamoDB client constructor, as defined by the AWS SDK.
*/
clientOptions?: DynamoDB.DocumentClient.DocumentClientOptions & DynamoDB.Types.ClientConfiguration;
/**
* Specifies an existing, already-configured DynamoDB client instance that the feature store
* should use rather than creating one of its own. If you specify an existing client, then the
* clientOptions property is ignored.
*/
dynamoDBClient?: DynamoDB.DocumentClient;
/**
* An optional namespace prefix for all keys stored in DynamoDB. Use this if you are sharing
* the same database table between multiple clients that are for different LaunchDarkly
* environments, to avoid key collisions.
*/
prefix?: string;
/**
* The expiration time for local caching, in seconds. To disable local caching, set this to zero.
* If not specified, the default is 15 seconds.
*/
cacheTTL?: number;
/**
* A logger to be used for warnings and errors generated by the feature store. If not specified,
* the default is an instance of winston.Logger.
*/
logger?: LDLogger;
}
}