/** * @file Browser DevTools integration for @doeixd/machine * @description Connects state machines to browser extension for visualization and debugging */ import { runMachine, type AsyncEvent, type AsyncMachine } from './index'; /** * DevTools interface for browser extension communication */ export interface MachineDevTools { init(context: unknown): void; send(message: { type: string; payload: unknown; }): void; } /** * Augment Window interface to include DevTools extension */ declare global { interface Window { __MACHINE_DEVTOOLS__?: MachineDevTools; } } /** * Async runner that records the latest dispatched event for DevTools messages. * * @typeParam M - Async machine controlled by the runner. */ export type DevToolsRunner> = ReturnType> & { lastEvent?: AsyncEvent; }; /** * Connects a state machine to the browser DevTools extension * @template M - The async machine type * @param initialMachine - The initial machine instance * @returns A runner with DevTools integration * * @example * const runner = connectToDevTools(createAuthMachine()); * runner.dispatch({ type: 'login', args: ['user'] }); */ export declare function connectToDevTools>(initialMachine: M): DevToolsRunner; //# sourceMappingURL=devtools.d.ts.map