xstate 6.0.0-alpha.52 → 6.0.0-alpha.53

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.
@@ -352,8 +352,8 @@ export interface AnyStateMachine extends AnyActorLogic {
352
352
  events: Array<EventDescriptor<any>>;
353
353
  sources: Sources;
354
354
  config: any;
355
- version?: string;
356
- schemas?: import("./types.v6.js").AnyMachineSchemas;
355
+ version?: string | undefined;
356
+ schemas?: import("./types.v6.js").AnyMachineSchemas | undefined;
357
357
  snapshotSchema: import("./machineVersion.types.js").MachineSnapshotSchema;
358
358
  eventSchema: import("./machineVersion.types.js").MachineEventSchema;
359
359
  provide(sources: any): AnyStateMachine;
@@ -898,7 +898,7 @@ in TInput = NonReducibleUnknown, TSystem extends AnyActorSystem = AnyActorSystem
898
898
  /** The initial setup/configuration used to create the actor logic. */
899
899
  config?: unknown;
900
900
  /** Optional runtime validator for pure calculation boundaries. */
901
- validator?: import("./validation.types.js").ActorLogicValidator;
901
+ validator?: import("./validation.types.js").ActorLogicValidator | undefined;
902
902
  /**
903
903
  * Transition function that processes the current state and an incoming event
904
904
  * to produce a new state and effects.
@@ -963,7 +963,7 @@ in TInput = NonReducibleUnknown, TSystem extends AnyActorSystem = AnyActorSystem
963
963
  }
964
964
  export interface AnyActorLogic {
965
965
  config?: unknown;
966
- validator?: import("./validation.types.js").ActorLogicValidator;
966
+ validator?: import("./validation.types.js").ActorLogicValidator | undefined;
967
967
  transition(snapshot: any, event: any, actorScope: any): ActorLogicTransitionResult<any>;
968
968
  initialTransition(input: any, actorScope: any): ActorLogicTransitionResult<any>;
969
969
  getInitialSnapshot(actorScope: any, input: any): any;
@@ -510,18 +510,11 @@ export interface Sources {
510
510
  actors: Record<string, AnyActorLogic>;
511
511
  }
512
512
  /**
513
- * Contextually types the entries of a `guards: { ... }` source map. Guard
514
- * sources receive the transition args object first and optional caller-supplied
515
- * params after it.
513
+ * Contextually types the entries of a `guards: { ... }` source map. Guards
514
+ * are plain predicates: they receive only caller-supplied params (no injected
515
+ * transition args) and are called the same way they are declared.
516
516
  */
517
- export type GuardSourceMap<TContext extends MachineContext, TEvent extends EventObject, _TCtx = [TContext] extends [never] ? any : TContext> = Record<string, (args: {
518
- context: _TCtx;
519
- event: TEvent;
520
- self: AnyActorRef;
521
- parent: AnyActorRef | undefined;
522
- value: StateValue;
523
- children: Record<string, AnyActorRef | undefined>;
524
- }, ...params: any[]) => boolean>;
517
+ export type GuardSourceMap<_TContext extends MachineContext, _TEvent extends EventObject> = Record<string, (...params: any[]) => boolean>;
525
518
  /**
526
519
  * Contextually types the entries of a `delays: { ... }` source map. Delay
527
520
  * functions receive `{ context, event, stateNode }` at runtime.