UNPKG

1.08 kBTypeScriptView Raw
1import { StateNode, ActionObject, Guard, InvokeDefinition } from './';
2interface JSONFunction {
3 $function: string;
4}
5export declare function stringifyFunction(fn: Function): JSONFunction;
6interface TransitionConfig {
7 target: string[];
8 source: string;
9 actions: Array<ActionObject<any, any>>;
10 cond: Guard<any, any> | undefined;
11 eventType: string;
12}
13interface StateNodeConfig {
14 type: StateNode['type'];
15 id: string;
16 key: string;
17 initial?: string;
18 entry: Array<ActionObject<any, any>>;
19 exit: Array<ActionObject<any, any>>;
20 on: {
21 [key: string]: TransitionConfig[];
22 };
23 invoke: Array<InvokeDefinition<any, any>>;
24 states: Record<string, StateNodeConfig>;
25}
26export declare function machineToJSON(stateNode: StateNode): StateNodeConfig;
27export declare function stringify(machine: StateNode): string;
28export declare function parse(machineString: string): StateNodeConfig;
29export declare function jsonify<T extends Record<string, any>>(value: T): T;
30export {};
31//# sourceMappingURL=json.d.ts.map
\No newline at end of file