@xstate/react 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ActorRefFrom,
|
|
3
|
-
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;
|
|
2
|
+
import { ActorRefFrom, SnapshotFrom, ActorOptions, AnyActorLogic } from 'xstate';
|
|
4
3
|
export declare function createActorContext<TLogic extends AnyActorLogic>(actorLogic: TLogic, interpreterOptions?: ActorOptions<TLogic>): {
|
|
5
4
|
useSelector: <T>(selector: (snapshot: SnapshotFrom<TLogic>) => T, compare?: (a: T, b: T) => boolean) => T;
|
|
6
5
|
useActorRef: () => ActorRefFrom<TLogic>;
|
|
@@ -11,12 +10,6 @@ export declare function createActorContext<TLogic extends AnyActorLogic>(actorLo
|
|
|
11
10
|
* @deprecated Use `logic` instead.
|
|
12
11
|
*/
|
|
13
12
|
machine?: never;
|
|
14
|
-
} & (TLogic extends AnyStateMachine ? AreAllImplementationsAssumedToBeProvided<TLogic['__TResolvedTypesMeta']> extends true ? {
|
|
15
13
|
logic?: TLogic;
|
|
16
|
-
}
|
|
17
|
-
logic: ToMachinesWithProvidedImplementations<TLogic>;
|
|
18
|
-
} : {
|
|
19
|
-
logic?: TLogic;
|
|
20
|
-
})) => React.ReactElement<any, any>;
|
|
14
|
+
}) => React.ReactElement<any, any>;
|
|
21
15
|
};
|
|
22
|
-
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ActorRefFrom, AnyStateMachine,
|
|
1
|
+
import { ActorRefFrom, AnyStateMachine, ActorOptions, StateFrom } from 'xstate';
|
|
2
2
|
/**
|
|
3
3
|
* @alias useActor
|
|
4
4
|
*/
|
|
5
|
-
export declare function useMachine<TMachine extends AnyStateMachine>(machine:
|
|
5
|
+
export declare function useMachine<TMachine extends AnyStateMachine>(machine: TMachine, options?: ActorOptions<TMachine>): [
|
|
6
6
|
StateFrom<TMachine>,
|
|
7
7
|
ActorRefFrom<TMachine>['send'],
|
|
8
8
|
ActorRefFrom<TMachine>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xstate/react",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "XState tools for React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"state",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
58
|
-
"xstate": "^5.1
|
|
58
|
+
"xstate": "^5.4.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependenciesMeta": {
|
|
61
61
|
"xstate": {
|
|
@@ -76,6 +76,6 @@
|
|
|
76
76
|
"jsdom-global": "^3.0.2",
|
|
77
77
|
"react": "^18.0.0",
|
|
78
78
|
"react-dom": "^18.0.0",
|
|
79
|
-
"xstate": "5.1
|
|
79
|
+
"xstate": "5.4.1"
|
|
80
80
|
}
|
|
81
81
|
}
|