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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Incorrect argument type, interface extension #261

Merged
merged 6 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion flagsmith-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ const Flagsmith = class {
return this.evaluationContext;
}

updateContext = (evaluationContext: EvaluationContext) => {
updateContext = (evaluationContext: ClientEvaluationContext) => {
return this.setContext({
...this.getContext(),
...evaluationContext,
Expand Down
2 changes: 1 addition & 1 deletion lib/flagsmith-es/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flagsmith-es",
"version": "7.0.1",
"version": "7.0.2",
"description": "Feature flagging to support continuous development. This is an esm equivalent of the standard flagsmith npm module.",
"main": "./index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion lib/flagsmith/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flagsmith",
"version": "7.0.1",
"version": "7.0.2",
"description": "Feature flagging to support continuous development",
"main": "./index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion lib/react-native-flagsmith/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-flagsmith",
"version": "7.0.1",
"version": "7.0.2",
"description": "Feature flagging to support continuous development",
"main": "./index.js",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export declare type ITraits<T extends string = string> = Record<T, IFlagsmithTra
export declare type Traits<T extends string = string> = Record<T, TraitEvaluationContext | null>;

export interface ClientIdentityEvaluationContext extends IdentityEvaluationContext {
traits?: ITraits;
traits?: null | ITraits;
}
export interface ClientEvaluationContext extends EvaluationContext {
export interface ClientEvaluationContext extends Omit<EvaluationContext, "identity"> {
identity?: null | ClientIdentityEvaluationContext;
}

Expand Down Expand Up @@ -153,7 +153,7 @@ export interface IFlagsmith<F extends string = string, T extends string = string
/**
* Merge current evaluation context with the provided one. Refresh the flags.
*/
updateContext: () => Promise<void>;
updateContext: (context: ClientEvaluationContext) => Promise<void>;
/**
/**
* Get current context.
Expand Down