UNPKG

2.02 kBTypeScriptView Raw
1import type { StateNode } from "./StateNode.js";
2import type { AnyActorRef, AnyEventObject, AnyMachineSnapshot, AnyStateMachine, AnyTransitionConfig, ErrorActorEvent, EventObject, MachineContext, Mapper, NonReducibleUnknown, Observer, SingleOrArray, StateValue, TransitionConfigTarget } from "./types.js";
3export declare function matchesState(parentStateId: StateValue, childStateId: StateValue): boolean;
4export declare function toStatePath(stateId: string | string[]): string[];
5export declare function pathToStateValue(statePath: string[]): StateValue;
6export declare function mapValues<P, O extends Record<string, unknown>>(collection: O, iteratee: (item: O[keyof O], key: keyof O, collection: O, i: number) => P): {
7 [key in keyof O]: P;
8};
9export declare function toArray<T>(value: readonly T[] | T | undefined): readonly T[];
10export declare function resolveOutput<TContext extends MachineContext, TExpressionEvent extends EventObject>(mapper: Mapper<TContext, TExpressionEvent, unknown, EventObject> | NonReducibleUnknown, context: TContext, event: TExpressionEvent, self: AnyActorRef): unknown;
11export declare function isErrorActorEvent(event: AnyEventObject): event is ErrorActorEvent;
12export declare function toTransitionConfigArray(configLike: SingleOrArray<AnyTransitionConfig | TransitionConfigTarget>): Array<AnyTransitionConfig>;
13export declare function normalizeTarget<TContext extends MachineContext, TEvent extends EventObject>(target: SingleOrArray<string | StateNode<TContext, TEvent>> | undefined): ReadonlyArray<string | StateNode<TContext, TEvent>> | undefined;
14export declare function toObserver<T>(nextHandler?: Observer<T> | ((value: T) => void), errorHandler?: (error: any) => void, completionHandler?: () => void): Observer<T>;
15export declare function createInvokeId(stateNodeId: string, index: number): string;
16export declare function resolveReferencedActor(machine: AnyStateMachine, src: string): any;
17export declare function getAllOwnEventDescriptors(snapshot: AnyMachineSnapshot): any[];