@flopflip/types
Advanced tools
Comparing version 4.1.2 to 4.1.3
# @flopflip/types | ||
## 4.1.3 | ||
### Patch Changes | ||
- [`498f3bc`](https://github.com/tdeekens/flopflip/commit/498f3bcdc605f60bd8e72924cdef08c4a079d4f1) [#1380](https://github.com/tdeekens/flopflip/pull/1380) Thanks [@tdeekens](https://github.com/tdeekens)! - refactor: to type TUser to be generic | ||
* [`92ebba8`](https://github.com/tdeekens/flopflip/commit/92ebba83bdf1fb876ad830db124c306de6f5c86d) [#1382](https://github.com/tdeekens/flopflip/pull/1382) Thanks [@tdeekens](https://github.com/tdeekens)! - chore: add manypkg for validation for workspaces | ||
## 4.1.2 | ||
@@ -4,0 +12,0 @@ |
/// <reference types="react" /> | ||
import type { LDClient as TLDClient } from 'launchdarkly-js-client-sdk'; | ||
import type { LDClient as TLDClient, LDOptions as TLDOptions } from 'launchdarkly-js-client-sdk'; | ||
import type { LDUser as TLDUser } from 'launchdarkly-js-sdk-common'; | ||
export declare type TFlagName = string; | ||
@@ -7,5 +8,5 @@ export declare type TFlagVariation = boolean | string | number | Record<string, unknown> | unknown[]; | ||
export declare type TFlags = Record<string, TFlagVariation>; | ||
export declare type TUser = { | ||
export declare type TUser<TAdditionalUserProperties = Record<string, unknown>> = { | ||
key?: string; | ||
}; | ||
} & TAdditionalUserProperties; | ||
export declare enum AdapterSubscriptionStatus { | ||
@@ -43,11 +44,9 @@ Subscribed = 0, | ||
}; | ||
export declare type TBaseAdapterArgs = { | ||
user: TUser; | ||
export declare type TBaseAdapterArgs<TAdditionalUserProperties = Record<string, unknown>> = { | ||
user: TUser<TAdditionalUserProperties>; | ||
}; | ||
export declare type TLaunchDarklyAdapterArgs = TBaseAdapterArgs & { | ||
export declare type TLaunchDarklyAdapterArgs = TBaseAdapterArgs<TLDUser> & { | ||
sdk: { | ||
clientSideId: string; | ||
clientOptions?: { | ||
fetchGoals?: boolean; | ||
}; | ||
clientOptions?: TLDOptions; | ||
}; | ||
@@ -132,3 +131,3 @@ flags: TFlags; | ||
getFlag: (flagName: TFlagName) => TFlagVariation | undefined; | ||
updateUserContext: (updatedUserProps: TUser) => Promise<unknown>; | ||
updateUserContext: (updatedUserProps: TLaunchDarklyAdapterArgs['user']) => Promise<unknown>; | ||
unsubscribe: () => void; | ||
@@ -135,0 +134,0 @@ subscribe: () => void; |
{ | ||
"name": "@flopflip/types", | ||
"version": "4.1.2", | ||
"version": "4.1.3", | ||
"description": "Type definitions for flipflop", | ||
@@ -30,3 +30,5 @@ "main": "dist/flopflip-types.cjs.js", | ||
], | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"typescript": "4.1.3" | ||
}, | ||
"peerDependencies": { | ||
@@ -33,0 +35,0 @@ "typescript": "4.x" |
31094
1
348