Skip to content

xstate-vue2 and typegen #9

Open
@blocka

Description

@blocka

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)```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions