import type { MachineDefinition } from "../MachineDefinition.js"; import type { EventObject, MachineContext } from "../types/index.js"; export interface ToXStateSourceOptions { /** Name of the exported const. @default the machine id turned into an identifier (`"trafficLight"`); `"machine"` when empty */ exportName?: string; /** Prepend the xstate import line (`createMachine` plus the builtins actually used). @default true */ includeImport?: boolean; /** Render the implementation table as the second argument (functions as identifiers). @default false */ includeImplementations?: boolean; /** Spaces per indentation level. @default 4 */ indent?: number; } /** * Renders `definition.config` as a JS object literal: functions become their * `name` as an identifier (`anonymous` when nameless), builtin action / * guard objects become their XState call form (`assign(...)`, `raise(...)`, * `and([...])`, ...; `mutate(...)` imported from this package), `types` and * `source` are dropped, `undefined` values are skipped. * * The output is deterministic: keys keep config order, 4-space indentation by * default, trailing commas, short scalar arrays on one line. */ export declare function toXStateSource(definition: MachineDefinition, options?: ToXStateSourceOptions): string;