Skip to content

Commit

Permalink
Fix #2239
Browse files Browse the repository at this point in the history
  • Loading branch information
VanTanev committed May 25, 2021
1 parent 3d13dfd commit fd0290b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/StateNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ class StateNode<
*/
public withContext(
context: TContext
): StateNode<TContext, TStateSchema, TEvent> {
): StateNode<TContext, TStateSchema, TEvent, TTypestate> {
return new StateNode(this.config, this.options, context);
}

Expand Down
9 changes: 9 additions & 0 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,15 @@ export interface StateMachine<
> extends StateNode<TContext, TStateSchema, TEvent, TTypestate> {
id: string;
states: StateNode<TContext, TStateSchema, TEvent>['states'];

withConfig(
options: Partial<MachineOptions<TContext, TEvent>>,
context?: TContext
): StateMachine<TContext, TStateSchema, TEvent, TTypestate>;

withContext(
context: TContext
): StateMachine<TContext, TStateSchema, TEvent, TTypestate>;
}

export type StateFrom<
Expand Down

0 comments on commit fd0290b

Please sign in to comment.