I'd like to be able to define my machine options in separate files so I can swap out real/mock service implementations like the following:
interface HomePageProviderProps {
machineOptions: any; // <-- How do I type this?
children: React.ReactNode;
}
const HomePageProvider = ({ machineOptions, children }: HomePageProviderProps) => {
const [state, send] = useMachine(homePageMachine, machineOptions)
return <HomePageStateContext.Provider value={state}>
<HomePageDispatchContext.Provider value={{}}>
{children}
</HomePageDispatchContext.Provider>
</HomePageStateContext.Provider>
}
Is there an easy way to get the generated types for my machine options so I can replace this any?