Skip to content

Commit

Permalink
fix: Incorrect argument type, interface extension (#261)
Browse files Browse the repository at this point in the history
* fix: Incorrect argument type, interface extension

---------

Co-authored-by: Kyle Johnson <[email protected]>
  • Loading branch information
khvn26 and kyle-ssg authored Oct 21, 2024
1 parent a755ff4 commit 46f74a7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
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

0 comments on commit 46f74a7

Please sign in to comment.