xstate 4.33.5 → 4.33.6

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.
package/es/actions.d.ts CHANGED
@@ -52,7 +52,7 @@ declare type InferEvent<E extends EventObject> = {
52
52
  * @param options Send action options
53
53
  * @returns An XState send action object
54
54
  */
55
- export declare function sendTo<TContext, TEvent extends EventObject, TActor extends AnyActorRef>(actor: (ctx: TContext) => TActor, event: EventFrom<TActor> | SendExpr<TContext, TEvent, InferEvent<Cast<EventFrom<TActor>, EventObject>>>, options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, any>;
55
+ export declare function sendTo<TContext, TEvent extends EventObject, TActor extends AnyActorRef>(actor: string | TActor | ((ctx: TContext) => TActor), event: EventFrom<TActor> | SendExpr<TContext, TEvent, InferEvent<Cast<EventFrom<TActor>, EventObject>>>, options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, any>;
56
56
  /**
57
57
  * Sends an update event to this machine's parent.
58
58
  */
@@ -83,6 +83,9 @@ export declare class Interpreter<TContext, TStateSchema extends StateSchema = an
83
83
  */
84
84
  constructor(machine: StateMachine<TContext, TStateSchema, TEvent, TTypestate, any, any, TResolvedTypesMeta>, options?: InterpreterOptions);
85
85
  get initialState(): State<TContext, TEvent, TStateSchema, TTypestate, TResolvedTypesMeta>;
86
+ /**
87
+ * @deprecated Use `.getSnapshot()` instead.
88
+ */
86
89
  get state(): State<TContext, TEvent, TStateSchema, TTypestate, TResolvedTypesMeta>;
87
90
  static interpret: typeof interpret;
88
91
  /**
package/es/interpreter.js CHANGED
@@ -343,6 +343,9 @@ function () {
343
343
  configurable: true
344
344
  });
345
345
  Object.defineProperty(Interpreter.prototype, "state", {
346
+ /**
347
+ * @deprecated Use `.getSnapshot()` instead.
348
+ */
346
349
  get: function () {
347
350
  if (!IS_PRODUCTION) {
348
351
  warn(this.status !== InterpreterStatus.NotStarted, "Attempted to read state from uninitialized service '".concat(this.id, "'. Make sure the service is started first."));
package/es/types.d.ts CHANGED
@@ -730,7 +730,7 @@ export declare enum SpecialTargets {
730
730
  export interface SendActionOptions<TContext, TEvent extends EventObject> {
731
731
  id?: string | number;
732
732
  delay?: number | string | DelayExpr<TContext, TEvent>;
733
- to?: string | ExprWithMeta<TContext, TEvent, string | number | ActorRef<any>>;
733
+ to?: string | ActorRef<any> | ExprWithMeta<TContext, TEvent, string | ActorRef<any>>;
734
734
  }
735
735
  export interface CancelAction extends ActionObject<any, any> {
736
736
  sendId: string | number;
package/lib/actions.d.ts CHANGED
@@ -52,7 +52,7 @@ declare type InferEvent<E extends EventObject> = {
52
52
  * @param options Send action options
53
53
  * @returns An XState send action object
54
54
  */
55
- export declare function sendTo<TContext, TEvent extends EventObject, TActor extends AnyActorRef>(actor: (ctx: TContext) => TActor, event: EventFrom<TActor> | SendExpr<TContext, TEvent, InferEvent<Cast<EventFrom<TActor>, EventObject>>>, options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, any>;
55
+ export declare function sendTo<TContext, TEvent extends EventObject, TActor extends AnyActorRef>(actor: string | TActor | ((ctx: TContext) => TActor), event: EventFrom<TActor> | SendExpr<TContext, TEvent, InferEvent<Cast<EventFrom<TActor>, EventObject>>>, options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, any>;
56
56
  /**
57
57
  * Sends an update event to this machine's parent.
58
58
  */
@@ -83,6 +83,9 @@ export declare class Interpreter<TContext, TStateSchema extends StateSchema = an
83
83
  */
84
84
  constructor(machine: StateMachine<TContext, TStateSchema, TEvent, TTypestate, any, any, TResolvedTypesMeta>, options?: InterpreterOptions);
85
85
  get initialState(): State<TContext, TEvent, TStateSchema, TTypestate, TResolvedTypesMeta>;
86
+ /**
87
+ * @deprecated Use `.getSnapshot()` instead.
88
+ */
86
89
  get state(): State<TContext, TEvent, TStateSchema, TTypestate, TResolvedTypesMeta>;
87
90
  static interpret: typeof interpret;
88
91
  /**
@@ -347,6 +347,9 @@ function () {
347
347
  configurable: true
348
348
  });
349
349
  Object.defineProperty(Interpreter.prototype, "state", {
350
+ /**
351
+ * @deprecated Use `.getSnapshot()` instead.
352
+ */
350
353
  get: function () {
351
354
  if (!environment.IS_PRODUCTION) {
352
355
  utils.warn(this.status !== exports.InterpreterStatus.NotStarted, "Attempted to read state from uninitialized service '".concat(this.id, "'. Make sure the service is started first."));
package/lib/types.d.ts CHANGED
@@ -730,7 +730,7 @@ export declare enum SpecialTargets {
730
730
  export interface SendActionOptions<TContext, TEvent extends EventObject> {
731
731
  id?: string | number;
732
732
  delay?: number | string | DelayExpr<TContext, TEvent>;
733
- to?: string | ExprWithMeta<TContext, TEvent, string | number | ActorRef<any>>;
733
+ to?: string | ActorRef<any> | ExprWithMeta<TContext, TEvent, string | ActorRef<any>>;
734
734
  }
735
735
  export interface CancelAction extends ActionObject<any, any> {
736
736
  sendId: string | number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xstate",
3
- "version": "4.33.5",
3
+ "version": "4.33.6",
4
4
  "description": "Finite State Machines and Statecharts for the Modern Web.",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",