diff --git a/index.d.ts b/index.d.ts index e1130c9..224424c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -6,7 +6,7 @@ * Documentation: http://docs.launchdarkly.com/docs/node-sdk-reference */ -declare module 'ldclient-node' { +declare module "ldclient-node" { /** * The LaunchDarkly static global. */ @@ -26,7 +26,6 @@ declare module 'ldclient-node' { [key: string]: LDFlagValue, }; - /** /** * LaunchDarkly initialization options. */ @@ -67,7 +66,7 @@ declare module 'ldclient-node' { /** * Configures a logger for warnings and errors generated by the SDK. - * + * * This can be a custom logger or an instance of winston.Logger */ logger?: LDLogger | object; @@ -75,7 +74,7 @@ declare module 'ldclient-node' { /** * Feature store used by the LaunchDarkly client, defaults to in memory storage. - * + * * The SDK provides an in memory feature store as well as a redis feature store. */ feature_store?: LDFeatureStore; @@ -192,132 +191,132 @@ declare module 'ldclient-node' { /** * The LaunchDarkly client logger interface. - * + * * The client will output informational debugging messages to the logger. * Internally, this logger defaults to an instance of winston.Logger, which takes * logs a variadic sequence of variables. * See: https://github.com/winstonjs/winston - * + * */ export interface LDLogger { /** * The error logger. - * + * * @param args * A sequence of any javascript variables */ - error: (...args: any[]) => void + error: (...args: any[]) => void; /** * The warning logger. - * + * * @param args * A sequence of any javascript variables */ - warn: (...args: any[]) => void + warn: (...args: any[]) => void; /** * The info logger. - * + * * @param args * A sequence of any javascript variables */ - info: (...args: any[]) => void + info: (...args: any[]) => void; /** * The debug logger. - * + * * @param args * A sequence of any javascript variables */ - debug: (...args: any[]) => void + debug: (...args: any[]) => void; } /** * The LaunchDarkly client feature store. - * + * * The client uses this internally to store flag updates it * receives from LaunchDarkly. */ export interface LDFeatureStore { /** * Get a flag's value. - * + * * @param key * The flag key - * + * * @param callback * Will be called with the resulting flag. */ - get: (key: string, callback: (res: LDFlagValue) => void) => void + get: (key: string, callback: (res: LDFlagValue) => void) => void; /** * Get all flags. - * + * * @param callback * Will be called with the resulting flag set. */ - all: (callback: (err: any, res: LDFlagSet) => void) => void + all: (callback: (err: any, res: LDFlagSet) => void) => void; /** * Initialize the store. - * + * * @param flags * Populate the store with an initial flag set. - * + * * @param callback * Will be called when the store has been initialized. */ - init: (flags: LDFlagSet, callback?: () => void) => void + init: (flags: LDFlagSet, callback?: () => void) => void; /** * Delete a key from the store. - * + * * @param key * The flag key. - * + * * @param version * The next version to increment the flag. The store should not update * a newer version with an older version. - * + * * @param callback * Will be called when the delete operation is complete. */ - delete: (key: string, version: string, callback?: () => void) => void + delete: (key: string, version: string, callback?: () => void) => void; /** * Upsert a flag to the store. - * + * * @param key * The flag key. - * + * * @param flag * The feature flag for the corresponding key. - * + * * @param callback * Will be called after the upsert operation is complete. */ - upsert: (key: string, flag: LDFlag, callback?: () => void) => void + upsert: (key: string, flag: LDFlag, callback?: () => void) => void; /** * Is the store initialized? - * + * * @param callback * Will be called when the store is initialized. - * + * * @returns * Truthy if the cache is already initialized. - * + * */ - initialized: (callback?: (err) => void) => bool + initialized: (callback?: (err) => void) => bool; /** * Close the feature store. - * + * * @returns * The store instance. */ - close: () => LDFeatureStore + close: () => LDFeatureStore; } /** @@ -366,7 +365,7 @@ declare module 'ldclient-node' { /** * * The secure_mode_hash method computes an HMAC signature of a user signed with the client's SDK key. - * + * * If you're using our JavaScript SDK for client-side flags, this * method generates the signature you need for secure mode. * @@ -383,7 +382,7 @@ declare module 'ldclient-node' { /** - * + * * @returns Whether the client is configured in offline mode. */ is_offline: () => boolean; @@ -419,14 +418,11 @@ declare module 'ldclient-node' { /** * Flush the queue - * + * * Internally, the LaunchDarkly SDK keeps an event queue for track and identify calls. * These are flushed periodically (see configuration option: flush_interval) * and when the queue size limit (see configuration option: capacity) is reached. */ - flush: (callback:(err: any, res: boolean) => void) => void; + flush: (callback: (err: any, res: boolean) => void) => void; } - - } -