@mettascript/grapher 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ import { MeTTa, Atom } from '@mettascript/hyperon';
2
+
3
+ /** How to render the GIF. */
4
+ interface GifOptions {
5
+ /** Output width in pixels (height follows the aspect ratio). Default 720. */
6
+ width?: number;
7
+ /** Morph frames per reduction step. Default `morphMs / stepMs`, reduced to keep under `maxFrames`. */
8
+ framesPerStep?: number;
9
+ /** Cap on the total number of frames. Default 180. */
10
+ maxFrames?: number;
11
+ /** Milliseconds to hold each settled state. Default 260. */
12
+ holdMs?: number;
13
+ /** Milliseconds per morph frame. Default 40. */
14
+ stepMs?: number;
15
+ /** Milliseconds one step's morph spans, the live view's trace duration. Sets the default frame count
16
+ * per step so the export glides exactly like the screen; an explicit `framesPerStep` wins. The editor
17
+ * export methods fill this in with their current trace duration. Default 550 (`DEFAULT_TRACE_MS`). */
18
+ morphMs?: number;
19
+ /** Canvas background color. Used by the graph GIF, which has no block palette to take it from. */
20
+ background?: string;
21
+ }
22
+
23
+ type NodeGifView = "blocks" | "graph" | "side-by-side";
24
+ type ReductionGifInput = string | Atom | readonly Atom[];
25
+ /** Options for a headless Node reduction GIF. */
26
+ interface NodeGifOptions extends GifOptions {
27
+ /** Picture to render. Default `blocks`. */
28
+ view?: NodeGifView;
29
+ /** Existing engine whose space supplies rules, grounded operations, and facts. */
30
+ metta?: MeTTa;
31
+ /** Maximum evaluator steps while building the reduction trace. Default 300. */
32
+ maxSteps?: number;
33
+ }
34
+ /** Render a MeTTa reduction to animated GIF bytes in plain Node.js. */
35
+ declare function renderReductionGif(input: ReductionGifInput, opts?: NodeGifOptions): Promise<Uint8Array>;
36
+
37
+ export { type NodeGifOptions, type NodeGifView, type ReductionGifInput, renderReductionGif };