Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LaunchDarkly JavaScript client typings #11916

Merged
merged 2 commits into from Oct 12, 2016
Merged

Add LaunchDarkly JavaScript client typings #11916

merged 2 commits into from Oct 12, 2016

Conversation

IceCreamYou
Copy link
Contributor

case 1. Add a new type definition.

  • checked compilation succeeds with --target es6 and --noImplicitAny options.
  • has correct naming convention
  • has a test file with the suffix of -tests.ts or -tests.tsx.

I tried to follow the contribution guide 馃榾 The npm package is named the same as the folder, ldclient-js.

@dt-bot
Copy link
Member

dt-bot commented Oct 11, 2016

ldclient-js/ldclient-js.d.ts

Checklist

/**
* The types of values a feature flag can have.
*/
export type LDFlagValue = boolean | string;
Copy link

@jkodumal jkodumal Oct 11, 2016

Choose a reason for hiding this comment

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

LDFlagValue could also be an arbitrary JSON object, array, or number. So maybe just any?

* @returns
* The flag's value.
*/
variation: (key: string, defaultValue?: boolean) => LDFlagValue;

Choose a reason for hiding this comment

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

The defaultValue should be of type LDFlagValue

@IceCreamYou
Copy link
Contributor Author

Thanks @jkodumal - I made the changes you suggested.

@vvakame vvakame merged commit 7ab26a7 into DefinitelyTyped:master Oct 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants