Skip to content

Commit 5bd85e0

Browse files
author
Matthew Phillips
committed
revert: fix state type syntax error from PR #238
Reverts the broken type definition that had a syntax error in the conditional type. The original change attempted to handle multiple transitions but introduced a parsing issue with missing space before '?' in the conditional type. This restores the working state function signature while we investigate a proper solution for multiple transition type inference.
1 parent 0cf6366 commit 5bd85e0

File tree

2 files changed

+16
-39
lines changed

2 files changed

+16
-39
lines changed

package-lock.json

Lines changed: 13 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ declare module 'robot3' {
5858
*
5959
* @param args - Any argument needs to be of type Transition or Immediate.
6060
*/
61-
export function state<T extends (Transition<any> | Immediate<any>)[]>(
62-
...args: T
63-
): MachineState<T[number] extends (Transition<infer F>)? F : string>;
61+
export function state<T extends Transition<any> | Immediate<any>>(
62+
...args: T[]
63+
): MachineState<T extends Transition<infer F> ? F : string>;
6464

6565
/**
6666
* A `transition` function is used to move from one state to another.

0 commit comments

Comments
 (0)