xstate-vue2
xstate-vue2 copied to clipboard
xstate-vue2 and typegen
I'm having trouble getting these two to play together.
See here: https://codesandbox.io/p/sandbox/gallant-fire-w4nv51
const machine: StateMachine<{
value: string;
}, any, {
type: "FOO";
value: string;
} | {
type: "BAR";
}, {
value: any;
context: {
value: string;
};
}, BaseActionObject, ServiceMap, ResolveTypegenMeta<Typegen0, {
type: "FOO";
value: string;
} | {
type: "BAR";
}, BaseActionObject, ServiceMap>>
Argument of type 'StateMachine<{ value: string; }, any, { type: "FOO"; value: string; } | { type: "BAR"; }, { value: any; context: { value: string; }; }, BaseActionObject, ServiceMap, ResolveTypegenMeta<Typegen0, { ...; } | { ...; }, BaseActionObject, ServiceMap>>' is not assignable to parameter of type 'MaybeLazy<StateMachine<{ value: string; }, any, { type: "FOO"; value: string; } | { type: "BAR"; }, { value: any; context: { value: string; }; }, BaseActionObject, ServiceMap, ResolveTypegenMeta<...>>>'.
Type 'StateMachine<{ value: string; }, any, { type: "FOO"; value: string; } | { type: "BAR"; }, { value: any; context: { value: string; }; }, BaseActionObject, ServiceMap, ResolveTypegenMeta<Typegen0, { ...; } | { ...; }, BaseActionObject, ServiceMap>>' is not assignable to type 'StateMachine<{ value: string; }, any, { type: "FOO"; value: string; } | { type: "BAR"; }, { value: any; context: { value: string; }; }, BaseActionObject, ServiceMap, ResolveTypegenMeta<TypegenDisabled, { ...; } | { ...; }, BaseActionObject, ServiceMap>>'.
The types of 'withConfig(...).__TResolvedTypesMeta' are incompatible between these types.
Type 'MarkAllImplementationsAsProvided<ResolveTypegenMeta<Typegen0, { type: "FOO"; value: string; } | { type: "BAR"; }, BaseActionObject, ServiceMap>>' is not assignable to type 'ResolveTypegenMeta<TypegenDisabled, { type: "FOO"; value: string; } | { type: "BAR"; }, BaseActionObject, ServiceMap>'.typescript(2345)```
Hi! This package has not been updated to work with typegen yet as that was a pretty significant breaking change to xstate's types and no one has requested it for this package before. I'm more than happy to review a PR if you want to contribute. It would probably take a week or two to add otherwise...