UNPKG

520 BTypeScriptView Raw
1import { Actor, ActorOptions, AnyStateMachine, StateFrom, type ConditionalRequired, type IsNotNever, type RequiredActorOptionsKeys } from 'xstate';
2/** @alias useActor */
3export declare function useMachine<TMachine extends AnyStateMachine>(machine: TMachine, ...[options]: ConditionalRequired<[
4 options?: ActorOptions<TMachine> & {
5 [K in RequiredActorOptionsKeys<TMachine>]: unknown;
6 }
7], IsNotNever<RequiredActorOptionsKeys<TMachine>>>): [StateFrom<TMachine>, Actor<TMachine>['send'], Actor<TMachine>];