Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ declare module "ldclient-node" {
* @param callback
* Will be called after the upsert operation is complete.
*/
upsert: (key: string, flag: LDFlag, callback?: () => void) => void;
upsert: (key: string, flag: LDFlagValue, callback?: () => void) => void;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no definition for LDFlag, but there was for LDFlagValue.


/**
* Is the store initialized?
Expand All @@ -308,7 +308,7 @@ declare module "ldclient-node" {
* Truthy if the cache is already initialized.
*
*/
initialized: (callback?: (err) => void) => bool;
initialized: (callback?: (err) => void) => boolean;

/**
* Close the feature store.
Expand Down Expand Up @@ -349,7 +349,7 @@ declare module "ldclient-node" {
*/
variation: (key: string, user: LDUser, defaultValue: LDFlagValue, callback?: (err: any, res: LDFlagValue) => void) => void;

toggle: typeof variation;
toggle: (key: string, user: LDUser, defaultValue: LDFlagValue, callback?: (err: any, res: LDFlagValue) => void) => void;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know of a terse way to replicate a function type definition. If toggle is deprecated, maybe the solution is to just remove it from the type definitions altogether?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep it for legacy compatibility until we remove it.


/**
* Retrieves a flag's value.
Expand Down