@nodish/core 0.1.3 → 0.2.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.
Files changed (61) hide show
  1. package/dist/index.d.ts +519 -0
  2. package/dist/{vue.js → index.js} +76 -174
  3. package/package.json +9 -12
  4. package/dist/pack.d.ts +0 -326
  5. package/dist/pack.js +0 -43
  6. package/dist/src/components/AddNodePanel.vue.d.ts +0 -20
  7. package/dist/src/components/GraphInterfacePanel.vue.d.ts +0 -13
  8. package/dist/src/components/GraphNode.vue.d.ts +0 -26
  9. package/dist/src/components/GroupPanel.vue.d.ts +0 -13
  10. package/dist/src/components/InspectorPanel.vue.d.ts +0 -43
  11. package/dist/src/components/NodePanel.vue.d.ts +0 -18
  12. package/dist/src/components/NodePort.vue.d.ts +0 -21
  13. package/dist/src/components/NodeViewer.vue.d.ts +0 -14
  14. package/dist/src/components/WireLayer.vue.d.ts +0 -8
  15. package/dist/src/components/inspector/InspectorCheckboxField.vue.d.ts +0 -10
  16. package/dist/src/components/inspector/InspectorColorField.vue.d.ts +0 -12
  17. package/dist/src/components/inspector/InspectorError.vue.d.ts +0 -5
  18. package/dist/src/components/inspector/InspectorPositionField.vue.d.ts +0 -12
  19. package/dist/src/components/inspector/InspectorSection.vue.d.ts +0 -24
  20. package/dist/src/components/inspector/InspectorWidthField.vue.d.ts +0 -12
  21. package/dist/src/components/layout.d.ts +0 -26
  22. package/dist/src/components/types/NumberWidget.vue.d.ts +0 -15
  23. package/dist/src/components/types/PortValueWidget.vue.d.ts +0 -17
  24. package/dist/src/components/types/ReadonlyWidget.vue.d.ts +0 -9
  25. package/dist/src/components/types/TextWidget.vue.d.ts +0 -15
  26. package/dist/src/components/types/registerDefaultTypeWidgets.d.ts +0 -6
  27. package/dist/src/components/types/registry.d.ts +0 -13
  28. package/dist/src/pack/index.d.ts +0 -5
  29. package/dist/src/store/composite/editContext.d.ts +0 -14
  30. package/dist/src/store/composite/guards.d.ts +0 -7
  31. package/dist/src/store/composite/index.d.ts +0 -12
  32. package/dist/src/store/graph/connect.d.ts +0 -8
  33. package/dist/src/store/graph/createNodeMap.d.ts +0 -22
  34. package/dist/src/store/graph/document.d.ts +0 -25
  35. package/dist/src/store/graph/dynamicPorts.d.ts +0 -9
  36. package/dist/src/store/graph/evaluate.d.ts +0 -18
  37. package/dist/src/store/graph/expandIO.d.ts +0 -2
  38. package/dist/src/store/graph/instance.d.ts +0 -7
  39. package/dist/src/store/graph/pruneConnections.d.ts +0 -2
  40. package/dist/src/store/graph/removeNode.d.ts +0 -3
  41. package/dist/src/store/graph/stacking.d.ts +0 -5
  42. package/dist/src/store/graph/validateGraphTypes.d.ts +0 -2
  43. package/dist/src/store/interface/editor.d.ts +0 -5
  44. package/dist/src/store/interface/graphInterface.d.ts +0 -20
  45. package/dist/src/store/model.d.ts +0 -241
  46. package/dist/src/store/nodes/index.d.ts +0 -2
  47. package/dist/src/store/nodes/io.d.ts +0 -46
  48. package/dist/src/store/nodes/math.d.ts +0 -4
  49. package/dist/src/store/packs/core.d.ts +0 -3
  50. package/dist/src/store/packs/installPack.d.ts +0 -4
  51. package/dist/src/store/registry/defineNode.d.ts +0 -50
  52. package/dist/src/store/registry/defineType.d.ts +0 -31
  53. package/dist/src/store/registry/groups.d.ts +0 -9
  54. package/dist/src/store/registry/index.d.ts +0 -39
  55. package/dist/src/store/types/effectiveWidget.d.ts +0 -4
  56. package/dist/src/store/types/index.d.ts +0 -4
  57. package/dist/src/store/utils/clonePlain.d.ts +0 -1
  58. package/dist/src/vue/attachLoadPack.d.ts +0 -2
  59. package/dist/src/vue/createNodeMap.d.ts +0 -11
  60. package/dist/src/vue/index.d.ts +0 -10
  61. /package/dist/{vue.css → index.css} +0 -0
@@ -0,0 +1,519 @@
1
+ import { Component } from 'vue';
2
+ import { ComponentOptionsMixin } from 'vue';
3
+ import { ComponentProvideOptions } from 'vue';
4
+ import { DefineComponent } from 'vue';
5
+ import { PublicProps } from 'vue';
6
+
7
+ declare type __VLS_Props = {
8
+ map: NodeMap;
9
+ ioWidgets?: boolean;
10
+ };
11
+
12
+ /**
13
+ * Replace the map's graph and interface from a document.
14
+ * @returns Errors from extension checks before apply, then validation errors after apply.
15
+ */
16
+ export declare function applyDocument(map: NodeMap, doc: GraphDocument): string[];
17
+
18
+ /**
19
+ * Return the single Input and Output nodes on the graph.
20
+ * @throws When the graph does not contain exactly one of each.
21
+ */
22
+ export declare function boundaryNodes(map: NodeMap): {
23
+ input: DefiniteNode;
24
+ output: DefiniteNode;
25
+ };
26
+
27
+ /** Serializable nested graph owned by a composite instance. */
28
+ declare interface CompositeState {
29
+ graph: NodeGraph;
30
+ interface: GraphInterface;
31
+ }
32
+
33
+ /**
34
+ * Directed wire from an output port to an input port. Stored centrally on the
35
+ * graph so either endpoint can be looked up uniformly.
36
+ */
37
+ export declare interface Connection {
38
+ id: ConnectionId;
39
+ /** Must reference an output port. */
40
+ from: PortRef;
41
+ /** Must reference an input port. */
42
+ to: PortRef;
43
+ }
44
+
45
+ export declare type ConnectionId = string;
46
+
47
+ /**
48
+ * Create an in-memory graph workspace with registries, boundary nodes, and
49
+ * {@link NodeMap.loadPack} wired for widget setup.
50
+ *
51
+ * Registers built-in `number`/`string` widgets on first call (for packs that
52
+ * use those conventional type ids).
53
+ */
54
+ export declare function createNodeMap(init?: CreateNodeMapInit): NodeMap;
55
+
56
+ /** Options for the vue entry `createNodeMap()`. */
57
+ export declare interface CreateNodeMapInit {
58
+ /** Initial graph contents. Defaults to empty nodes and connections. */
59
+ graph?: NodeGraph;
60
+ /** Pre-loaded pack ids (usually leave empty and use {@link NodeMap.loadPack}). */
61
+ extensions?: string[];
62
+ /** Graph boundary ports; defaults to no inputs and no outputs. */
63
+ graphInterface?: GraphInterface;
64
+ /** Extra types to merge into the registry at creation time. */
65
+ types?: TypeRegistry;
66
+ /** Extra node types to merge into the registry at creation time (authoring form). */
67
+ nodeTypes?: NodeSpecRegistry;
68
+ /** Packs to load immediately after creation (via {@link NodeMap.loadPack}). */
69
+ packs?: NodePack[];
70
+ }
71
+
72
+ /**
73
+ * Turn a {@link TypeSpec} into a complete {@link PortTypeDefinition}.
74
+ */
75
+ export declare function defineType(spec: TypeSpec): PortTypeDefinition;
76
+
77
+ /**
78
+ * A node placed on the workspace. Serializable data only — behaviour lives on
79
+ * the {@link IndefiniteNode} referenced by {@link DefiniteNode.typeId}.
80
+ */
81
+ export declare interface DefiniteNode {
82
+ id: NodeId;
83
+ /** {@link IndefiniteNode} this instance was created from. */
84
+ typeId: NodeTypeId;
85
+ location: NodeLocation;
86
+ inputs: NodeIO;
87
+ outputs: NodeIO;
88
+ label?: string;
89
+ color?: string;
90
+ /** Node width in px. Falls back to layout default when undefined. */
91
+ width?: number;
92
+ /**
93
+ * Stacking order — higher paints on top. Stored for save/load. Undefined until
94
+ * first assigned.
95
+ */
96
+ z?: number;
97
+ /** Nested graph for composite/group instances. Serializable with the node. */
98
+ composite?: CompositeState;
99
+ }
100
+
101
+ /**
102
+ * Authoring form of {@link IndefiniteNode.resolvePorts}. Returns ports in
103
+ * {@link IOSpec} shape; normalized when registered via {@link registerNodeTypes}.
104
+ */
105
+ export declare type DynamicPortsSpec = (params: Record<string, unknown>) => {
106
+ inputs?: IOSpec;
107
+ outputs?: IOSpec;
108
+ };
109
+
110
+ /** Serialize the current workspace to a {@link GraphDocument}. */
111
+ export declare function exportGraph(map: NodeMap): GraphDocument;
112
+
113
+ /**
114
+ * Serializable graph snapshot. Contains no `execute()` implementations or type
115
+ * definitions — custom nodes are resolved at runtime from loaded {@link NodePack}s.
116
+ */
117
+ export declare interface GraphDocument {
118
+ graph: NodeGraph;
119
+ interface: GraphInterface;
120
+ /** Pack ids required to interpret this document. See {@link NodeMap.extensions}. */
121
+ extensions?: string[];
122
+ }
123
+
124
+ /**
125
+ * External signature of a graph. Parameters become the Input node's output ports;
126
+ * returns become the Output node's input ports.
127
+ */
128
+ export declare interface GraphInterface {
129
+ /** Graph inputs (function parameters). Key = port name. */
130
+ parameters?: Record<string, GraphPortSpec>;
131
+ /** Graph outputs (return values). Key = port name. */
132
+ returns?: Record<string, GraphPortSpec>;
133
+ }
134
+
135
+ /** Serializable port template for boundary definitions (object key = port name). */
136
+ export declare type GraphPortSpec = Omit<PortDefinition, "name">;
137
+
138
+ export declare interface GraphRunResult {
139
+ /** Output port values from the graph's Output node, keyed by port name. */
140
+ values: Values;
141
+ /** First error per node encountered during evaluation. */
142
+ errors: NodeErrors;
143
+ }
144
+
145
+ /** Replace the map's graph from a document. Alias of {@link applyDocument}. */
146
+ export declare function importGraph(map: NodeMap, doc: GraphDocument): string[];
147
+
148
+ /**
149
+ * Node type template that {@link DefiniteNode} instances are created from. Lives
150
+ * in the runtime registry only (never in a saved graph). Authors ship types via
151
+ * {@link NodePack}.
152
+ *
153
+ * - **Primitive:** implements {@link IndefiniteNode.execute}.
154
+ * - **Composite:** supplies a nested {@link IndefiniteNode.graph} instead of `execute`.
155
+ */
156
+ export declare interface IndefiniteNode {
157
+ /** Unique node type id (e.g. `"my-pack/add"`). */
158
+ typeId: NodeTypeId;
159
+ displayName: string;
160
+ color: string;
161
+ description: string;
162
+ /**
163
+ * Hierarchical menu category, broadest first, e.g. `["Math", "Basic Operations"]`.
164
+ * Empty or omitted places the node at the menu root.
165
+ */
166
+ group?: string[];
167
+ inputs: NodeIODefinition;
168
+ outputs: NodeIODefinition;
169
+ /**
170
+ * Runtime evaluation, keyed by port name (not id). Omit for composite types.
171
+ * @returns Output values keyed by port name.
172
+ */
173
+ execute?: (inputs: Record<string, unknown>) => Record<string, unknown>;
174
+ /** Nested subgraph for composite types (registry-only, not evaluated standalone). */
175
+ graph?: NodeGraph;
176
+ /**
177
+ * Dynamic port count driven by user-only inputs. When present, static
178
+ * `inputs`/`outputs` are initial defaults; reconciliation re-materializes
179
+ * ports by name so existing ids and connections survive a recount.
180
+ */
181
+ resolvePorts?: (params: Record<string, unknown>) => {
182
+ inputs: NodeIODefinition;
183
+ outputs: NodeIODefinition;
184
+ };
185
+ }
186
+
187
+ /** {@link IndefiniteNode.typeId} for the graph Input (Group Input) boundary node. */
188
+ export declare const INPUT_TYPE = "io/input";
189
+
190
+ /**
191
+ * Create a placed {@link DefiniteNode} from a node type, generating fresh port ids.
192
+ * For dynamic nodes, the initial port set comes from {@link IndefiniteNode.resolvePorts}
193
+ * seeded with the definition's default parameter values.
194
+ */
195
+ export declare function instantiate(def: IndefiniteNode, location: NodeLocation): DefiniteNode;
196
+
197
+ /** Input or output port templates keyed by port name. */
198
+ export declare type IOSpec = Record<string, PortSpec>;
199
+
200
+ /** Evaluation errors keyed by {@link NodeId}. */
201
+ declare type NodeErrors = Record<NodeId, string>;
202
+
203
+ /**
204
+ * Placed nodes and connections. Every graph must contain exactly one Input node
205
+ * and one Output node.
206
+ */
207
+ export declare interface NodeGraph {
208
+ nodes: DefiniteNode[];
209
+ connections: Connection[];
210
+ }
211
+
212
+ export declare type NodeId = string;
213
+
214
+ /** Materialized ports on an instance, keyed by id (connection/DOM-friendly). */
215
+ declare type NodeIO = Record<PortId, Port>;
216
+
217
+ /** Port templates on a definition, keyed by name (authoring-friendly). */
218
+ declare type NodeIODefinition = Record<string, PortDefinition>;
219
+
220
+ export declare type NodeLocation = {
221
+ x: number;
222
+ y: number;
223
+ };
224
+
225
+ /** In-memory workspace: serializable graph plus runtime type and node registries. */
226
+ export declare interface NodeMap {
227
+ graph: NodeGraph;
228
+ types: TypeRegistry;
229
+ nodeTypes: NodeRegistry;
230
+ /** Ids of packs loaded via {@link NodeMap.loadPack}. */
231
+ extensions: string[];
232
+ graphInterface: GraphInterface;
233
+ /**
234
+ * Register types, nodes, and optional widget setup from a pack.
235
+ * @returns Registration errors (empty array on success).
236
+ */
237
+ loadPack(pack: NodePack): string[];
238
+ }
239
+
240
+ /**
241
+ * A publishable bundle of custom types and/or node types (npm package contents).
242
+ * Load onto a {@link NodeMap} with {@link NodeMap.loadPack}.
243
+ */
244
+ export declare interface NodePack {
245
+ /** Unique pack id (e.g. `"@my-org/my-pack"`). Recorded in {@link GraphDocument.extensions}. */
246
+ id: string;
247
+ /** Custom {@link PortTypeDefinition}s to register. */
248
+ types?: TypeRegistry;
249
+ /** Custom node definitions to register (authoring form). */
250
+ nodeTypes?: NodeSpecRegistry;
251
+ /**
252
+ * Optional hook to register Vue widgets after types and nodes are merged.
253
+ * Runs once per pack load.
254
+ */
255
+ setup?: (ctx: PackSetupContext) => void;
256
+ }
257
+
258
+ /** Library of available node types, keyed by {@link NodeTypeId}. */
259
+ export declare type NodeRegistry = Record<NodeTypeId, IndefiniteNode>;
260
+
261
+ /**
262
+ * Authoring format for a node type. Normalized into a full {@link IndefiniteNode}
263
+ * when registered on a {@link NodeMap} (via {@link NodePack} or
264
+ * {@link registerNodeTypes}).
265
+ */
266
+ export declare interface NodeSpec {
267
+ /** Unique node type id (e.g. `"my-pack/add"`). */
268
+ typeId: NodeTypeId;
269
+ displayName: string;
270
+ color?: string;
271
+ description?: string;
272
+ /**
273
+ * Hierarchical menu category, broadest first. See {@link IndefiniteNode.group}.
274
+ */
275
+ group?: string[];
276
+ inputs?: IOSpec;
277
+ outputs?: IOSpec;
278
+ /**
279
+ * Runtime evaluation, keyed by port name. Omit for composite node packs.
280
+ * @returns Output values keyed by port name.
281
+ */
282
+ execute?: (inputs: Record<string, unknown>) => Record<string, unknown>;
283
+ /** Nested subgraph for composite types in a published pack. Not evaluated yet. */
284
+ graph?: NodeGraph;
285
+ /**
286
+ * Dynamic port count driven by user-only inputs. Static `inputs`/`outputs`
287
+ * act as initial defaults when present.
288
+ */
289
+ resolvePorts?: DynamicPortsSpec;
290
+ }
291
+
292
+ /** Node types in authoring form, keyed by {@link NodeTypeId}. */
293
+ export declare type NodeSpecRegistry = Record<NodeTypeId, NodeSpec>;
294
+
295
+ declare type NodeTypeId = string;
296
+
297
+ export declare const NodeViewer: DefineComponent<__VLS_Props, {
298
+ resetView: typeof resetView;
299
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
300
+ ioWidgets: boolean;
301
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
302
+ viewerEl: HTMLDivElement;
303
+ }, HTMLDivElement>;
304
+
305
+ /** {@link IndefiniteNode.typeId} for the graph Output (Group Output) boundary node. */
306
+ export declare const OUTPUT_TYPE = "io/output";
307
+
308
+ /** Context passed to {@link NodePack.setup} for widget registration. */
309
+ export declare interface PackSetupContext {
310
+ /**
311
+ * Bind a Vue component to all editable ports of a type id.
312
+ * Overrides the generic widget for that type.
313
+ */
314
+ registerTypeWidget: (typeId: string, component: Component) => void;
315
+ /**
316
+ * Bind a Vue component to a custom widget id
317
+ * ({@link TypeWidgetSpec} `kind: "custom"`).
318
+ */
319
+ registerComponentWidget: (componentId: string, component: Component) => void;
320
+ }
321
+
322
+ /**
323
+ * Parse a JSON string into a {@link GraphDocument}.
324
+ * @throws When JSON is invalid or required fields are missing.
325
+ */
326
+ export declare function parseGraphDocument(json: string): GraphDocument;
327
+
328
+ /**
329
+ * Materialized port on a placed node ({@link DefiniteNode}). Has a unique id so
330
+ * connections and the DOM can reference it directly.
331
+ */
332
+ export declare type Port = {
333
+ id: PortId;
334
+ /** Matches the {@link PortDefinition.name} it came from. */
335
+ name: string;
336
+ type: PortType;
337
+ direction: PortDirection;
338
+ /** Input: value when disconnected. Output: optional cache of last computed value. */
339
+ value?: unknown;
340
+ userOnly?: boolean;
341
+ multi?: boolean;
342
+ customProps?: Record<string, unknown>;
343
+ };
344
+
345
+ /**
346
+ * Port template declared by a node type ({@link IndefiniteNode}). Has no id and
347
+ * no live value — only describes ports that instances will receive.
348
+ */
349
+ export declare type PortDefinition = {
350
+ /** Stable, human-authored key; referenced inside `execute()`. */
351
+ name: string;
352
+ type: PortType;
353
+ /** Used by an input when nothing is connected to it. */
354
+ defaultValue?: unknown;
355
+ description?: string;
356
+ /**
357
+ * Input-only. Never accepts a connection — no socket, always shows its widget.
358
+ * Also feeds parameters into {@link IndefiniteNode.resolvePorts}.
359
+ */
360
+ userOnly?: boolean;
361
+ /**
362
+ * Input-only. Accepts any number of incoming connections; `execute()` receives
363
+ * values as an unordered array of `type`.
364
+ */
365
+ multi?: boolean;
366
+ /**
367
+ * Widget-specific configuration merged on top of the type's widget spec.
368
+ * Recognized keys: `options`, `min`, `max`, `step`, `rows`, `rowHeight`.
369
+ */
370
+ customProps?: Record<string, unknown>;
371
+ };
372
+
373
+ declare type PortDirection = "input" | "output";
374
+
375
+ declare type PortId = string;
376
+
377
+ /** Reference to one port on one node. */
378
+ export declare type PortRef = {
379
+ node: NodeId;
380
+ port: PortId;
381
+ };
382
+
383
+ /**
384
+ * Port in a node spec — same as {@link GraphPortSpec}; the name comes from the
385
+ * object key so authors do not repeat it.
386
+ */
387
+ export declare type PortSpec = GraphPortSpec;
388
+
389
+ declare type PortType = PortTypeId;
390
+
391
+ /**
392
+ * A registered data type. Carries validation, connection compatibility, and
393
+ * optional value lifecycle hooks. Registered at startup — only {@link PortTypeId}
394
+ * keys on ports are serialized in documents.
395
+ */
396
+ export declare interface PortTypeDefinition {
397
+ id: PortTypeId;
398
+ label: string;
399
+ color: string;
400
+ validate: (value: unknown) => boolean;
401
+ /**
402
+ * Whether an output of type `from` may connect into an input of this type.
403
+ * Decided by the destination type. Omitted means strict identity (`from === id`).
404
+ */
405
+ accepts?: (from: PortTypeId) => boolean;
406
+ /** Fallback when a port of this type omits its own default. */
407
+ defaultValue?: unknown;
408
+ /** Display/edit descriptor for the viewer (no functions). */
409
+ widget?: TypeWidgetSpec;
410
+ /** Parse a raw string (e.g. from an input field) into a value. */
411
+ parse?: (raw: string) => unknown;
412
+ /** Format a value for display in the viewer. */
413
+ format?: (value: unknown) => string;
414
+ /** Normalize or clamp a value after edit or connection. */
415
+ coerce?: (value: unknown) => unknown;
416
+ }
417
+
418
+ /** Key into the {@link TypeRegistry} (e.g. `"number"`). */
419
+ export declare type PortTypeId = string;
420
+
421
+ /**
422
+ * Bind a Vue component to a custom widget id
423
+ * ({@link TypeWidgetSpec} `kind: "custom"`).
424
+ */
425
+ export declare function registerComponentWidget(componentId: string, component: Component): void;
426
+
427
+ /**
428
+ * Register built-in Vue widgets for conventional `number` and `string` type ids.
429
+ * Call once at app startup before loading packs that rely on those widgets.
430
+ */
431
+ export declare function registerDefaultTypeWidgets(): void;
432
+
433
+ /**
434
+ * Bind a Vue component to all editable ports of a type id.
435
+ * Overrides the generic widget for that type.
436
+ */
437
+ export declare function registerTypeWidget(typeId: string, component: Component): void;
438
+
439
+ declare function resetView(): void;
440
+
441
+ /**
442
+ * Evaluate the graph as a function: supply values for the Input node's output
443
+ * ports (keyed by port name) and receive the Output node's input port values.
444
+ *
445
+ * Uses pull-based recursive evaluation with per-node memoization and cycle detection.
446
+ */
447
+ export declare function runGraph(map: NodeMap, inputs?: Values): GraphRunResult;
448
+
449
+ /**
450
+ * Serialize the current workspace to a {@link GraphDocument}.
451
+ * Alias of {@link exportGraph}.
452
+ */
453
+ export declare function serializeDocument(map: NodeMap): GraphDocument;
454
+
455
+ /** Library of available data types, keyed by id. */
456
+ export declare type TypeRegistry = Record<PortTypeId, PortTypeDefinition>;
457
+
458
+ /**
459
+ * Authoring format for a data type. {@link defineType} expands this into a full
460
+ * {@link PortTypeDefinition} (default label, color, and widget lifecycle hooks).
461
+ */
462
+ export declare interface TypeSpec {
463
+ /** Unique type id (e.g. `"number"`, `"my-pack/label"`). */
464
+ id: PortTypeId;
465
+ label?: string;
466
+ color?: string;
467
+ validate: (value: unknown) => boolean;
468
+ /**
469
+ * Whether an output of type `from` may connect into ports of this type.
470
+ * Omitted means strict identity.
471
+ */
472
+ accepts?: (from: PortTypeId) => boolean;
473
+ /** Fallback when a port of this type omits its own default. */
474
+ defaultValue?: unknown;
475
+ /** Viewer widget descriptor for ports of this type. */
476
+ widget?: TypeWidgetSpec;
477
+ /** Override default parse behaviour for this type's widget. */
478
+ parse?: (raw: string) => unknown;
479
+ /** Override default format behaviour for this type's widget. */
480
+ format?: (value: unknown) => string;
481
+ /** Override default coerce behaviour for this type's widget. */
482
+ coerce?: (value: unknown) => unknown;
483
+ }
484
+
485
+ /**
486
+ * Serializable widget descriptor for port value editing and display. Lives on the
487
+ * type definition; the Vue viewer resolves it to a concrete component.
488
+ */
489
+ export declare type TypeWidgetSpec = {
490
+ kind: "number";
491
+ min?: number;
492
+ max?: number;
493
+ step?: number;
494
+ /** Port row height in px; defaults to one line (20px). */
495
+ rowHeight?: number;
496
+ } | {
497
+ kind: "text";
498
+ /** Multiline row count; height is `rows × 20px` unless `rowHeight` is set. */
499
+ rows?: number;
500
+ /** Port row height in px; overrides `rows`. */
501
+ rowHeight?: number;
502
+ } | {
503
+ kind: "custom";
504
+ /** Id passed to `registerComponentWidget` in a pack's `setup` hook. */
505
+ componentId: string;
506
+ /** Port row height in px; defaults to one line (20px). */
507
+ rowHeight?: number;
508
+ };
509
+
510
+ /**
511
+ * Validate a document against the current map without applying it.
512
+ * @returns Human-readable error messages (empty when valid).
513
+ */
514
+ export declare function validateDocument(map: NodeMap, doc: GraphDocument): string[];
515
+
516
+ /** Port values keyed by port name. */
517
+ export declare type Values = Record<string, unknown>;
518
+
519
+ export { }