import { type Graph, type MachineState, type State, type TuringMachine } from '@turing-machine-js/machine'; import type { Snippet } from './types'; export type RecordSnippetOptions = { machine: TuringMachine; initialState: State; graph: Graph; alphabets: string[][]; name?: string; /** * Maximum number of iteration steps to record. Defaults to 1000. * If the machine hasn't halted after `maxSteps` iters, recording stops * and the snippet contains `maxSteps + 1` frames (frame 0 plus one per iter). */ maxSteps?: number; /** * Optional per-frame log formatter. Called with the current and previous * `MachineState`; return a string to attach as `frame.log`, or `undefined` * to omit. Not called for frame 0 (initial state — no transition has fired). */ log?: (m: MachineState, prev: MachineState | null) => string | undefined; }; /** * Record a full machine run into a `Snippet` — a self-contained playback * artifact suitable for embeds, articles, or landing-page panels. * * The returned snippet contains one frame per iteration plus a frame-0 * initial-state snapshot. Recording stops when the machine halts or when * `maxSteps` iterations have been consumed (default 1000). * * Tape-timing note: `runStepByStep` yields BEFORE applying its command * (the command is applied after the yield resumes). The recorder uses a * one-step-delayed snapshot so each frame's `tape` reflects the * post-command state for that frame's iter. */ export declare function recordSnippet(opts: RecordSnippetOptions): Snippet;