@xstate/react
Advanced tools
Comparing version 4.0.1 to 4.0.2
import * as React from 'react'; | ||
import { ActorRefFrom, AnyStateMachine, SnapshotFrom, ActorOptions, AreAllImplementationsAssumedToBeProvided, MarkAllImplementationsAsProvided, StateMachine, AnyActorLogic } from 'xstate'; | ||
type ToMachinesWithProvidedImplementations<TMachine extends AnyStateMachine> = TMachine extends StateMachine<infer TContext, infer TEvent, infer TChildren, infer TActor, infer TAction, infer TGuard, infer TDelay, infer TStateValue, infer TTag, infer TInput, infer TOutput, infer TResolvedTypesMeta> ? StateMachine<TContext, TEvent, TChildren, TActor, TAction, TGuard, TDelay, TStateValue, TTag, TInput, TOutput, AreAllImplementationsAssumedToBeProvided<TResolvedTypesMeta> extends false ? MarkAllImplementationsAsProvided<TResolvedTypesMeta> : TResolvedTypesMeta> : never; | ||
import { ActorRefFrom, SnapshotFrom, ActorOptions, AnyActorLogic } from 'xstate'; | ||
export declare function createActorContext<TLogic extends AnyActorLogic>(actorLogic: TLogic, interpreterOptions?: ActorOptions<TLogic>): { | ||
@@ -14,10 +13,4 @@ useSelector: <T>(selector: (snapshot: SnapshotFrom<TLogic>) => T, compare?: (a: T, b: T) => boolean) => T; | ||
machine?: never; | ||
} & (TLogic extends AnyStateMachine ? AreAllImplementationsAssumedToBeProvided<TLogic['__TResolvedTypesMeta']> extends true ? { | ||
logic?: TLogic; | ||
} : { | ||
logic: ToMachinesWithProvidedImplementations<TLogic>; | ||
} : { | ||
logic?: TLogic; | ||
})) => React.ReactElement<any, any>; | ||
}) => React.ReactElement<any, any>; | ||
}; | ||
export {}; |
@@ -1,6 +0,6 @@ | ||
import { ActorRefFrom, AnyStateMachine, AreAllImplementationsAssumedToBeProvided, ActorOptions, MissingImplementationsError, StateFrom } from 'xstate'; | ||
import { ActorRefFrom, AnyStateMachine, ActorOptions, StateFrom } from 'xstate'; | ||
/** | ||
* @alias useActor | ||
*/ | ||
export declare function useMachine<TMachine extends AnyStateMachine>(machine: AreAllImplementationsAssumedToBeProvided<TMachine['__TResolvedTypesMeta']> extends true ? TMachine : MissingImplementationsError<TMachine['__TResolvedTypesMeta']>, options?: ActorOptions<TMachine>): [ | ||
export declare function useMachine<TMachine extends AnyStateMachine>(machine: TMachine, options?: ActorOptions<TMachine>): [ | ||
StateFrom<TMachine>, | ||
@@ -7,0 +7,0 @@ ActorRefFrom<TMachine>['send'], |
{ | ||
"name": "@xstate/react", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "XState tools for React", | ||
@@ -58,3 +58,3 @@ "keywords": [ | ||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0", | ||
"xstate": "^5.1.0" | ||
"xstate": "^5.4.1" | ||
}, | ||
@@ -80,4 +80,4 @@ "peerDependenciesMeta": { | ||
"react-dom": "^18.0.0", | ||
"xstate": "5.1.0" | ||
"xstate": "5.4.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35062
826