declare module 'bullet-train-nodejs' { /** * Initialise the sdk against a particular environment */ export function init(config: { environmentID: string onError?: Function defaultFlags?: string[] api?: string }): void /** * Get the whether a flag is enabled e.g. bulletTrain.hasFeature("powerUserFeature") */ export function hasFeature(key: string): Promise /** * Get the value of a whether a flag is enabled for a user e.g. bulletTrain.hasFeature("powerUserFeature", 1234) */ export function hasFeature(key: string, userId: string): Promise /** * Get the value of a particular remote config e.g. bulletTrain.getValue("font_size") */ export function getValue(key: string): Promise /** * Get the value of a particular remote config for a specified user e.g. bulletTrain.getValue("font_size", 1234) */ export function getValue(key: string, userId: string): Promise /** * Trigger a manual fetch of the environment features */ export function getFlags(): Promise /** * Trigger a manual fetch of the environment features for a given user id */ export function getFlagsForUser(userId: string): Promise /** * Trigger a manual fetch of both the environment features and users' traits for a given user id */ export function getUserIdentity(userId: string): Promise /** * Trigger a manual fetch of a specific trait for a given user id */ export function getTrait(userId: string, key: string): Promise /** * Set a specific trait for a given user id */ export function setTrait( userId: string, key: string, value: string|number|boolean ): IUserIdentity interface IBulletTrainFeature { enabled: boolean value?: string|number|boolean } interface IFlags { [key: string]: IBulletTrainFeature } interface ITraits { [key: string]: string } interface IUserIdentity { flags: IBulletTrainFeature traits: ITraits } }