const ArkAction1 = type({ type: type.unit("ACTION_1"), value: type.number })
const ArkAction2 = type({ type: type.unit("ACTION_2"), name: type.string })
const ArkAction = type.enumerated(ArkAction1, ArkAction2)
type ArkAction = type.infer<typeof ArkAction>
function CreateArkAction1(): Extract<ArkAction, { type: 'ACTION_1'}> {
return { type: 'ACTION_1', value: 3 } // type not assignable to never
}
const ArkAction1 = type({ type: type.unit("ACTION_1"), value: type.number })
const ArkAction2 = type({ type: type.unit("ACTION_2"), name: type.string })
const ArkAction = type.enumerated(ArkAction1, ArkAction2)
type ArkAction = type.infer<typeof ArkAction>
function CreateArkAction1(): Extract<ArkAction, { type: 'ACTION_1'}> {
return { type: 'ACTION_1', value: 3 } // type not assignable to never
}