import type { AdjacencyMap, StatePath, Step, TraversalOptions, PathGenerator, TestModelOptions, TestParam, TestPath, TestPathResult } from "./types.js"; import { EventObject, ActorLogic, Snapshot, AnyStateMachine, EventFromLogic, SnapshotFrom, InputFrom } from "../index.js"; type GetPathOptions, TEvent extends EventObject, TInput> = Partial> & { /** * Whether to allow deduplicate paths so that paths that are contained by * longer paths are included. * * @default false */ allowDuplicatePaths?: boolean; }; /** * Creates a test model that represents an abstract model of a system under test * (SUT). * * The test model is used to generate test paths, which are used to verify that * states in the model are reachable in the SUT. */ export declare class TestModel, TEvent extends EventObject, TInput> { testLogic: ActorLogic; options: TestModelOptions; defaultTraversalOptions?: TraversalOptions; getDefaultOptions(): TestModelOptions; constructor(testLogic: ActorLogic, options?: Partial>); getPaths(pathGenerator: PathGenerator, options?: GetPathOptions): Array>; getShortestPaths(options?: GetPathOptions): Array>; getShortestPathsFrom(paths: Array>, options?: GetPathOptions): Array>; getSimplePaths(options?: GetPathOptions): Array>; getSimplePathsFrom(paths: Array>, options?: GetPathOptions): Array>; private _toTestPath; getPathsFromEvents(events: TEvent[], options?: GetPathOptions): Array>; /** * An array of adjacencies, which are objects that represent each `state` with * the `nextState` given the `event`. */ getAdjacencyMap(): AdjacencyMap; testPath(path: StatePath, params: TestParam, options?: Partial>): Promise; testState(params: TestParam, state: TSnapshot, options?: Partial>): Promise; private _getStateTestKeys; private _getEventExec; testTransition(params: TestParam, step: Step): Promise; private _resolveOptions; } /** * Creates a test model that represents an abstract model of a system under test * (SUT). * * The test model is used to generate test paths, which are used to verify that * states in the `machine` are reachable in the SUT. * * @example * * ```js * const toggleModel = createModel(toggleMachine).withEvents({ * TOGGLE: { * exec: async (page) => { * await page.click('input'); * } * } * }); * ``` * * @param machine The state machine used to represent the abstract model. * @param options Options for the created test model: * * - `events`: an object mapping string event types (e.g., `SUBMIT`) to an event * test config (e.g., `{exec: () => {...}, cases: [...]}`) */ export declare function createTestModel(machine: TMachine, options?: Partial, EventFromLogic, InputFrom>>): TestModel, EventFromLogic, unknown>; export {};