diff --git a/src/types.ts b/src/types.ts index 0276f0b..320ddf4 100644 --- a/src/types.ts +++ b/src/types.ts @@ -121,7 +121,12 @@ export type XstateTreeMachine< /** * @public */ -export type AnyXstateTreeMachine = XstateTreeMachine; +export type AnyXstateTreeMachine = XstateTreeMachine< + AnyStateMachine, + any, + any, + any[] +>; /** * @internal */ diff --git a/src/xstateTree.spec.tsx b/src/xstateTree.spec.tsx index 7ab85c8..f8a3dda 100644 --- a/src/xstateTree.spec.tsx +++ b/src/xstateTree.spec.tsx @@ -69,6 +69,13 @@ describe("xstate-tree", () => { }); const XstateTreeMachine = createXStateTreeMachine(machine, { + // Had a type error when adding in actions to this machine which has now been resolved + // keeping it for sanity check + actions() { + return { + foo() {}, + }; + }, View: ({ selectors }) => { return

{selectors.foo}

; }, diff --git a/xstate-tree.api.md b/xstate-tree.api.md index 6be27dd..6de2ab7 100644 --- a/xstate-tree.api.md +++ b/xstate-tree.api.md @@ -46,7 +46,7 @@ export type AnyRoute = { }; // @public (undocumented) -export type AnyXstateTreeMachine = XstateTreeMachine; +export type AnyXstateTreeMachine = XstateTreeMachine; // @public (undocumented) export type ArgumentsForRoute = T extends Route ? RouteArguments : never; @@ -400,8 +400,8 @@ export type XstateTreeMachineStateSchemaV2