@linkdlab/funcnodes_react_flow 0.3.22 → 0.4.3

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/index.d.ts CHANGED
@@ -3,6 +3,78 @@ import { JSX, ReactElement } from 'react';
3
3
  import { UseBoundStore, StoreApi } from 'zustand';
4
4
  import { Node, Edge, OnNodesChange, OnEdgesChange, OnConnect, useReactFlow } from 'reactflow';
5
5
 
6
+ interface AllOf {
7
+ allOf: SerializedType[];
8
+ }
9
+ interface AnyOf {
10
+ anyOf: SerializedType[];
11
+ }
12
+ interface ArrayOf {
13
+ type: "array";
14
+ items: SerializedType;
15
+ uniqueItems: boolean;
16
+ }
17
+ interface DictOf {
18
+ type: "object";
19
+ keys: SerializedType;
20
+ values: SerializedType;
21
+ }
22
+ interface EnumOf {
23
+ type: "enum";
24
+ values: (number | string | boolean | null)[];
25
+ keys: string[];
26
+ nullable: boolean;
27
+ }
28
+ interface TypeOf {
29
+ type: "type";
30
+ value: SerializedType;
31
+ }
32
+ type SerializedType = string | AllOf | AnyOf | ArrayOf | DictOf | EnumOf | TypeOf;
33
+ type RenderType = "string" | "number" | "boolean" | "image" | SerializedType;
34
+ interface BaseRenderOptions {
35
+ type: RenderType;
36
+ }
37
+ interface DataRenderOptions extends BaseRenderOptions {
38
+ src?: string;
39
+ preview_type?: string;
40
+ }
41
+ interface StringRenderOptions extends BaseRenderOptions {
42
+ max_length?: number;
43
+ }
44
+ interface ImageRenderOptions extends BaseRenderOptions {
45
+ format?: "png" | "jpeg";
46
+ }
47
+ type RenderOptions$1 = BaseRenderOptions | ImageRenderOptions | StringRenderOptions;
48
+
49
+ interface IORenderOptions extends BaseRenderOptions {
50
+ set_default: boolean;
51
+ }
52
+ interface IOValueOptions {
53
+ min?: number;
54
+ max?: number;
55
+ step?: number;
56
+ options?: (string | number)[] | EnumOf;
57
+ colorspace?: string;
58
+ }
59
+ interface IOType$1 {
60
+ connected: boolean;
61
+ does_trigger: boolean;
62
+ full_id: string;
63
+ id: string;
64
+ is_input: boolean;
65
+ name: string;
66
+ node: string;
67
+ type: SerializedType;
68
+ value: any;
69
+ fullvalue?: any;
70
+ render_options: IORenderOptions;
71
+ value_options?: IOValueOptions;
72
+ valuepreview_type?: string;
73
+ try_get_full_value: undefined | (() => void);
74
+ hidden: boolean;
75
+ set_hidden: undefined | ((v: boolean) => void);
76
+ }
77
+
6
78
  type DeepPartial<T> = T extends object ? {
7
79
  [P in keyof T]?: DeepPartial<T[P]>;
8
80
  } : T;
@@ -123,84 +195,6 @@ declare const deep_update: <T extends {}>(target: LimitedDeepPartial<T>, source:
123
195
  change: boolean;
124
196
  };
125
197
 
126
- type RenderType = "string" | "number" | "boolean" | "image" | SerializedType;
127
- interface BaseRenderOptions {
128
- type: RenderType;
129
- }
130
- interface DataRenderOptions extends BaseRenderOptions {
131
- src?: string;
132
- preview_type?: string;
133
- }
134
-
135
- interface AllOf {
136
- allOf: SerializedType[];
137
- }
138
- interface AnyOf {
139
- anyOf: SerializedType[];
140
- }
141
- interface ArrayOf {
142
- type: "array";
143
- items: SerializedType;
144
- uniqueItems: boolean;
145
- }
146
- interface DictOf {
147
- type: "object";
148
- keys: SerializedType;
149
- values: SerializedType;
150
- }
151
- interface EnumOf {
152
- type: "enum";
153
- values: (number | string | boolean | null)[];
154
- keys: string[];
155
- nullable: boolean;
156
- }
157
- interface TypeOf {
158
- type: "type";
159
- value: SerializedType;
160
- }
161
- type SerializedType = string | AllOf | AnyOf | ArrayOf | DictOf | EnumOf | TypeOf;
162
- interface IORenderOptions extends BaseRenderOptions {
163
- set_default: boolean;
164
- }
165
- interface IOValueOptions {
166
- min?: number;
167
- max?: number;
168
- step?: number;
169
- options?: (string | number)[] | EnumOf;
170
- colorspace?: string;
171
- }
172
- interface IOType {
173
- connected: boolean;
174
- does_trigger: boolean;
175
- full_id: string;
176
- id: string;
177
- is_input: boolean;
178
- name: string;
179
- node: string;
180
- type: SerializedType;
181
- value: any;
182
- fullvalue?: any;
183
- render_options: IORenderOptions;
184
- value_options?: IOValueOptions;
185
- valuepreview_type?: string;
186
- try_get_full_value: undefined | (() => void);
187
- hidden: boolean;
188
- set_hidden: undefined | ((v: boolean) => void);
189
- }
190
- interface UpdateableIOOptions {
191
- name?: string;
192
- hidden?: boolean;
193
- }
194
- type OutputRendererProps = {
195
- io: IOType;
196
- };
197
- type OutputRendererType = ({ io }: OutputRendererProps) => JSX.Element;
198
- interface InputRendererProps {
199
- io: IOType;
200
- inputconverter: [(v: any) => any, (v: any) => any];
201
- }
202
- type InputRendererType = ({ io, inputconverter, }: InputRendererProps) => JSX.Element;
203
-
204
198
  /**
205
199
  * Interface representing the state of a tqdm progress bar.
206
200
  *
@@ -252,9 +246,9 @@ interface BaseNodeAction {
252
246
  id: string;
253
247
  immediate?: boolean;
254
248
  }
255
- interface NodeActionAdd extends BaseNodeAction {
249
+ interface NodeActionAdd$1 extends BaseNodeAction {
256
250
  type: "add";
257
- node: NodeType;
251
+ node: NodeType$1;
258
252
  }
259
253
  /**
260
254
  * Interface for the NodeActionUpdate.
@@ -262,7 +256,7 @@ interface NodeActionAdd extends BaseNodeAction {
262
256
  * It has a type property set to "update", an id property for the node to be updated,
263
257
  * and a node property of PartialNodeType which contains the properties to be updated.
264
258
  */
265
- interface NodeActionUpdate extends BaseNodeAction {
259
+ interface NodeActionUpdate$1 extends BaseNodeAction {
266
260
  type: "update";
267
261
  node: PartialNodeType;
268
262
  }
@@ -287,24 +281,18 @@ interface NodeActionTrigger extends BaseNodeAction {
287
281
  * Type alias for NodeAction.
288
282
  * A NodeAction can be either a NodeActionAdd, NodeActionUpdate, or NodeActionDelete.
289
283
  */
290
- type NodeAction = NodeActionAdd | NodeActionUpdate | NodeActionDelete | NodeActionError | NodeActionTrigger;
291
- type NodeStore = UseBoundStore<StoreApi<NodeType>>;
284
+ type NodeAction$1 = NodeActionAdd$1 | NodeActionUpdate$1 | NodeActionDelete | NodeActionError | NodeActionTrigger;
285
+ type NodeStore$1 = UseBoundStore<StoreApi<NodeType$1>>;
292
286
  interface NodeRenderOptions {
293
287
  data?: DataRenderOptions;
294
288
  }
295
- interface NodeProperties {
296
- "frontend:size": [number, number];
297
- "frontend:pos": [number, number];
298
- "frontend:collapsed": boolean;
299
- [key: string]: any;
300
- }
301
- interface NodeType {
289
+ interface NodeType$1 {
302
290
  id: string;
303
291
  node_name: string;
304
292
  io: {
305
- [key: string]: IOType;
293
+ [key: string]: IOType$1 | undefined;
306
294
  };
307
- frontend?: {
295
+ frontend: {
308
296
  pos: [number, number];
309
297
  size: [number, number];
310
298
  collapsed: boolean;
@@ -315,10 +303,374 @@ interface NodeType {
315
303
  render_options?: NodeRenderOptions;
316
304
  io_order: string[];
317
305
  progress: TqdmState;
306
+ }
307
+ type PartialNodeType = DeepPartial<NodeType$1>;
308
+
309
+ interface InputRendererProps$1 {
310
+ io: IOType$1;
311
+ inputconverter: [(v: any) => any, (v: any) => any];
312
+ }
313
+ type InputRendererType$1 = ({ io, inputconverter, }: InputRendererProps$1) => JSX.Element;
314
+ type OutputRendererProps$1 = {
315
+ io: IOType$1;
316
+ };
317
+ type OutputRendererType$1 = ({ io }: OutputRendererProps$1) => JSX.Element;
318
+ type DataViewRendererProps$1 = {
319
+ io: IOType$1;
320
+ };
321
+ type DataViewRendererType$1 = ({ io, }: DataViewRendererProps$1) => JSX.Element;
322
+ type HandlePreviewRendererProps$1 = {
323
+ io: IOType$1;
324
+ };
325
+ type HandlePreviewRendererType$1 = ({ io, }: HandlePreviewRendererProps$1) => JSX.Element;
326
+ type DataOverlayRendererProps$1 = {
327
+ io: IOType$1;
328
+ };
329
+ type DataOverlayRendererType$1 = ({ io, }: DataOverlayRendererProps$1) => JSX.Element;
330
+ type DataPreviewViewRendererProps$1 = {
331
+ io: IOType$1;
332
+ };
333
+ type DataPreviewViewRendererType$1 = ({ io, }: DataPreviewViewRendererProps$1) => JSX.Element;
334
+
335
+ interface NodeContextType {
336
+ node_data: NodeType;
337
+ [key: string]: any | undefined;
338
+ }
339
+ declare const NodeContext: React.Context<NodeContextType | null>;
340
+
341
+ type RenderPluginFactoryProps = {
342
+ React: typeof React;
343
+ fnrf_zst: FuncNodesReactFlowZustandInterface;
344
+ NodeContext: React.Context<NodeContextType | null>;
345
+ };
346
+ interface RendererPlugin$1 {
347
+ input_renderers?: {
348
+ [key: string]: InputRendererType$1 | undefined;
349
+ };
350
+ output_renderers?: {
351
+ [key: string]: OutputRendererType$1 | undefined;
352
+ };
353
+ handle_preview_renderers?: {
354
+ [key: string]: HandlePreviewRendererType$1 | undefined;
355
+ };
356
+ data_overlay_renderers?: {
357
+ [key: string]: DataOverlayRendererType$1 | undefined;
358
+ };
359
+ data_preview_renderers?: {
360
+ [key: string]: DataPreviewViewRendererType$1 | undefined;
361
+ };
362
+ data_view_renderers?: {
363
+ [key: string]: DataViewRendererType$1 | undefined;
364
+ };
365
+ }
366
+ interface FuncNodesReactPlugin$1 {
367
+ RendererPlugin?: RendererPlugin$1;
368
+ renderpluginfactory?: (props: RenderPluginFactoryProps) => RendererPlugin$1;
369
+ v?: 0 | "0";
370
+ }
371
+ type AnyFuncNodesReactPlugin$1 = FuncNodesReactPlugin$1;
372
+ type AnyRendererPlugin$1 = RendererPlugin$1;
373
+ type AnyRenderPluginFactoryProps$1 = RenderPluginFactoryProps;
374
+
375
+ type index$1_AllOf = AllOf;
376
+ type index$1_AnyOf = AnyOf;
377
+ type index$1_ArrayOf = ArrayOf;
378
+ type index$1_BaseNodeAction = BaseNodeAction;
379
+ type index$1_BaseRenderOptions = BaseRenderOptions;
380
+ type index$1_DataRenderOptions = DataRenderOptions;
381
+ type index$1_DictOf = DictOf;
382
+ type index$1_EnumOf = EnumOf;
383
+ type index$1_IORenderOptions = IORenderOptions;
384
+ type index$1_IOValueOptions = IOValueOptions;
385
+ type index$1_ImageRenderOptions = ImageRenderOptions;
386
+ type index$1_NodeActionDelete = NodeActionDelete;
387
+ type index$1_NodeActionError = NodeActionError;
388
+ type index$1_NodeActionTrigger = NodeActionTrigger;
389
+ type index$1_NodeRenderOptions = NodeRenderOptions;
390
+ type index$1_PartialNodeType = PartialNodeType;
391
+ type index$1_RenderPluginFactoryProps = RenderPluginFactoryProps;
392
+ type index$1_RenderType = RenderType;
393
+ type index$1_SerializedType = SerializedType;
394
+ type index$1_StringRenderOptions = StringRenderOptions;
395
+ type index$1_TypeOf = TypeOf;
396
+ declare namespace index$1 {
397
+ export type { index$1_AllOf as AllOf, AnyFuncNodesReactPlugin$1 as AnyFuncNodesReactPlugin, index$1_AnyOf as AnyOf, AnyRenderPluginFactoryProps$1 as AnyRenderPluginFactoryProps, AnyRendererPlugin$1 as AnyRendererPlugin, index$1_ArrayOf as ArrayOf, index$1_BaseNodeAction as BaseNodeAction, index$1_BaseRenderOptions as BaseRenderOptions, DataOverlayRendererProps$1 as DataOverlayRendererProps, DataOverlayRendererType$1 as DataOverlayRendererType, DataPreviewViewRendererProps$1 as DataPreviewViewRendererProps, DataPreviewViewRendererType$1 as DataPreviewViewRendererType, index$1_DataRenderOptions as DataRenderOptions, DataViewRendererProps$1 as DataViewRendererProps, DataViewRendererType$1 as DataViewRendererType, index$1_DictOf as DictOf, index$1_EnumOf as EnumOf, FuncNodesReactPlugin$1 as FuncNodesReactPlugin, HandlePreviewRendererProps$1 as HandlePreviewRendererProps, HandlePreviewRendererType$1 as HandlePreviewRendererType, index$1_IORenderOptions as IORenderOptions, IOType$1 as IOType, index$1_IOValueOptions as IOValueOptions, index$1_ImageRenderOptions as ImageRenderOptions, InputRendererProps$1 as InputRendererProps, InputRendererType$1 as InputRendererType, NodeAction$1 as NodeAction, NodeActionAdd$1 as NodeActionAdd, index$1_NodeActionDelete as NodeActionDelete, index$1_NodeActionError as NodeActionError, index$1_NodeActionTrigger as NodeActionTrigger, NodeActionUpdate$1 as NodeActionUpdate, index$1_NodeRenderOptions as NodeRenderOptions, NodeStore$1 as NodeStore, NodeType$1 as NodeType, OutputRendererProps$1 as OutputRendererProps, OutputRendererType$1 as OutputRendererType, index$1_PartialNodeType as PartialNodeType, RenderOptions$1 as RenderOptions, index$1_RenderPluginFactoryProps as RenderPluginFactoryProps, index$1_RenderType as RenderType, RendererPlugin$1 as RendererPlugin, index$1_SerializedType as SerializedType, index$1_StringRenderOptions as StringRenderOptions, index$1_TypeOf as TypeOf };
398
+ }
399
+
400
+ interface NodeProperties {
401
+ "frontend:size": [number, number];
402
+ "frontend:pos": [number, number];
403
+ "frontend:collapsed": boolean;
404
+ [key: string]: any | undefined;
405
+ }
406
+ interface NodeActionUpdate extends BaseNodeAction {
407
+ type: "update";
408
+ node: PartialSerializedNodeType;
409
+ }
410
+ interface NodeActionAdd extends BaseNodeAction {
411
+ type: "add";
412
+ node: SerializedNodeType;
413
+ }
414
+ type NodeAction = NodeActionAdd | NodeActionUpdate | NodeActionDelete | NodeActionError | NodeActionTrigger;
415
+ type PartialSerializedNodeType = LimitedDeepPartial<SerializedNodeType>;
416
+ interface BasicNodeType {
417
+ id: string;
418
+ node_id: string;
419
+ node_name: string;
420
+ name: string;
421
+ error?: string;
422
+ render_options?: NodeRenderOptions;
318
423
  description?: string;
319
424
  properties: NodeProperties;
425
+ status?: {
426
+ [key: string]: any | undefined;
427
+ };
428
+ }
429
+ type SerializedNodeIOMappingType = {
430
+ [key: string]: SerializedIOType | undefined;
431
+ };
432
+ type PartialSerializedNodeIOMappingType = {
433
+ [key: string]: PartialSerializedIOType | undefined;
434
+ };
435
+ interface SerializedNodeType extends BasicNodeType {
436
+ in_trigger: boolean;
437
+ io: SerializedNodeIOMappingType;
438
+ io_order?: string[];
439
+ progress: TqdmState;
440
+ }
441
+ interface NodeType extends Omit<BasicNodeType, "in_trigger" | "io"> {
442
+ in_trigger: UseBoundStore<StoreApi<boolean>>;
443
+ io: {
444
+ [key: string]: IOStore | undefined;
445
+ };
446
+ inputs: string[];
447
+ outputs: string[];
448
+ io_order: string[];
449
+ progress: UseBoundStore<StoreApi<TqdmState>>;
450
+ }
451
+ interface NodeStore {
452
+ _state: UseBoundStore<StoreApi<NodeType>>;
453
+ use: () => NodeType;
454
+ getState: () => NodeType;
455
+ setState: (new_state: Partial<NodeType>) => void;
456
+ update: (new_state: PartialSerializedNodeType) => void;
457
+ }
458
+
459
+ type DataStructureProps<D> = {
460
+ data: D;
461
+ mime: string;
462
+ };
463
+ declare class DataStructure<D, R> {
464
+ private _data;
465
+ private _mime;
466
+ constructor({ data, mime }: DataStructureProps<D>);
467
+ get data(): D;
468
+ get value(): R;
469
+ get mime(): string;
470
+ toString(): string;
471
+ toJSON(): string;
472
+ dispose(): void;
473
+ }
474
+
475
+ interface ValueStoreInterface {
476
+ preview: DataStructure<any, any> | undefined;
477
+ full: DataStructure<any, any> | undefined;
478
+ }
479
+ interface IOStore {
480
+ _state: UseBoundStore<StoreApi<IOType>>;
481
+ use: () => IOType;
482
+ getState: () => IOType;
483
+ setState: (new_state: Partial<IOType>) => void;
484
+ update: (new_state: PartialSerializedIOType) => void;
485
+ valuestore: UseBoundStore<StoreApi<ValueStoreInterface>>;
486
+ node: NodeStore;
487
+ updateValueStore: (newData: Partial<ValueStoreInterface>) => void;
488
+ }
489
+ interface BasicIOType {
490
+ connected: boolean;
491
+ does_trigger: boolean;
492
+ full_id: string;
493
+ id: string;
494
+ is_input: boolean;
495
+ name: string;
496
+ node: string;
497
+ type: SerializedType;
498
+ render_options: IORenderOptions;
499
+ value_options?: IOValueOptions;
500
+ valuepreview_type?: string;
501
+ hidden: boolean;
502
+ emit_value_set: boolean;
503
+ default?: any;
504
+ required: boolean;
505
+ }
506
+ interface SerializedIOType extends BasicIOType {
507
+ value: string | number | boolean | undefined | DataStructure<any, any>;
508
+ fullvalue: string | number | boolean | undefined | DataStructure<any, any>;
509
+ }
510
+ interface IOType extends BasicIOType {
511
+ try_get_full_value: () => void;
512
+ set_hidden: (v: boolean) => void;
513
+ }
514
+ type PartialSerializedIOType = LimitedDeepPartial<SerializedIOType>;
515
+ interface UpdateableIOOptions {
516
+ name?: string;
517
+ hidden?: boolean;
518
+ }
519
+
520
+ interface DataOverlayRendererProps {
521
+ iostore: IOStore;
522
+ value: any;
523
+ preValue?: any;
524
+ onLoaded?: () => void;
525
+ }
526
+ type DataOverlayRendererType = ({ iostore, value, preValue, onLoaded, }: DataOverlayRendererProps) => JSX.Element;
527
+ interface InputRendererProps {
528
+ iostore: IOStore;
529
+ inputconverter: [(v: any) => any, (v: any) => any];
530
+ }
531
+ type InputRendererType = ({ iostore, inputconverter, }: InputRendererProps) => JSX.Element;
532
+ type OutputRendererProps = {
533
+ iostore: IOStore;
534
+ };
535
+ type OutputRendererType = ({ iostore, }: OutputRendererProps) => JSX.Element;
536
+ type DataViewRendererProps = {
537
+ iostore: IOStore;
538
+ value: any;
539
+ preValue?: any;
540
+ onLoaded?: () => void;
541
+ };
542
+ type DataViewRendererType = ({ iostore, value, preValue, onLoaded, }: DataViewRendererProps) => JSX.Element;
543
+ type HandlePreviewRendererProps = {
544
+ iostore: IOStore;
545
+ };
546
+ type HandlePreviewRendererType = ({ iostore, }: HandlePreviewRendererProps) => JSX.Element;
547
+ type DataPreviewViewRendererProps = {
548
+ iostore: IOStore;
549
+ };
550
+ type DataPreviewViewRendererType = ({ iostore, }: DataPreviewViewRendererProps) => JSX.Element;
551
+ interface NodeContextExtenderProps {
552
+ node_data: NodeType;
553
+ }
554
+ type NodeContextExtenderType = ({ node_data, }: NodeContextExtenderProps) => {
555
+ [key: string]: any | undefined;
556
+ };
557
+ interface NodeRendererProps {
558
+ node_data: NodeType;
559
+ }
560
+ type NodeRendererType = ({ node_data, }: NodeRendererProps) => JSX.Element;
561
+ interface InLineRendererProps {
562
+ iostore: IOStore;
563
+ }
564
+ type InLineRendererType = ({ iostore }: InLineRendererProps) => string;
565
+ type NodeHooksProps = {
566
+ nodecontext: NodeContextType;
567
+ };
568
+ type NodeHooksType = ({ nodecontext }: NodeHooksProps) => void;
569
+
570
+ interface RendererPlugin {
571
+ input_renderers?: {
572
+ [key: string]: InputRendererType | undefined;
573
+ };
574
+ output_renderers?: {
575
+ [key: string]: OutputRendererType | undefined;
576
+ };
577
+ handle_preview_renderers?: {
578
+ [key: string]: HandlePreviewRendererType | undefined;
579
+ };
580
+ data_overlay_renderers?: {
581
+ [key: string]: DataOverlayRendererType | undefined;
582
+ };
583
+ data_preview_renderers?: {
584
+ [key: string]: DataPreviewViewRendererType | undefined;
585
+ };
586
+ data_view_renderers?: {
587
+ [key: string]: DataViewRendererType | undefined;
588
+ };
589
+ node_renderers?: {
590
+ [key: string]: NodeRendererType | undefined;
591
+ };
592
+ node_context_extenders?: {
593
+ [key: string]: NodeContextExtenderType | undefined;
594
+ };
595
+ node_hooks?: {
596
+ [key: string]: NodeHooksType[] | undefined;
597
+ };
598
+ }
599
+ interface FuncNodesReactPlugin {
600
+ renderpluginfactory?: (props: RenderPluginFactoryProps) => RendererPlugin;
601
+ v: 1 | "1";
602
+ }
603
+ type AnyFuncNodesReactPlugin = FuncNodesReactPlugin$1 | FuncNodesReactPlugin;
604
+ type AnyRendererPlugin = RendererPlugin$1 | RendererPlugin;
605
+ type AnyRenderPluginFactoryProps = RenderPluginFactoryProps | RenderPluginFactoryProps;
606
+
607
+ type index_AllOf = AllOf;
608
+ type index_AnyFuncNodesReactPlugin = AnyFuncNodesReactPlugin;
609
+ type index_AnyOf = AnyOf;
610
+ type index_AnyRenderPluginFactoryProps = AnyRenderPluginFactoryProps;
611
+ type index_AnyRendererPlugin = AnyRendererPlugin;
612
+ type index_ArrayOf = ArrayOf;
613
+ type index_BaseNodeAction = BaseNodeAction;
614
+ type index_BaseRenderOptions = BaseRenderOptions;
615
+ type index_BasicIOType = BasicIOType;
616
+ type index_BasicNodeType = BasicNodeType;
617
+ type index_DataOverlayRendererProps = DataOverlayRendererProps;
618
+ type index_DataOverlayRendererType = DataOverlayRendererType;
619
+ type index_DataPreviewViewRendererProps = DataPreviewViewRendererProps;
620
+ type index_DataPreviewViewRendererType = DataPreviewViewRendererType;
621
+ type index_DataRenderOptions = DataRenderOptions;
622
+ type index_DataViewRendererProps = DataViewRendererProps;
623
+ type index_DataViewRendererType = DataViewRendererType;
624
+ type index_DictOf = DictOf;
625
+ type index_EnumOf = EnumOf;
626
+ type index_FuncNodesReactPlugin = FuncNodesReactPlugin;
627
+ type index_HandlePreviewRendererProps = HandlePreviewRendererProps;
628
+ type index_HandlePreviewRendererType = HandlePreviewRendererType;
629
+ type index_IORenderOptions = IORenderOptions;
630
+ type index_IOStore = IOStore;
631
+ type index_IOType = IOType;
632
+ type index_IOValueOptions = IOValueOptions;
633
+ type index_ImageRenderOptions = ImageRenderOptions;
634
+ type index_InLineRendererProps = InLineRendererProps;
635
+ type index_InLineRendererType = InLineRendererType;
636
+ type index_InputRendererProps = InputRendererProps;
637
+ type index_InputRendererType = InputRendererType;
638
+ type index_NodeAction = NodeAction;
639
+ type index_NodeActionAdd = NodeActionAdd;
640
+ type index_NodeActionDelete = NodeActionDelete;
641
+ type index_NodeActionError = NodeActionError;
642
+ type index_NodeActionTrigger = NodeActionTrigger;
643
+ type index_NodeActionUpdate = NodeActionUpdate;
644
+ type index_NodeContextExtenderProps = NodeContextExtenderProps;
645
+ type index_NodeContextExtenderType = NodeContextExtenderType;
646
+ type index_NodeHooksProps = NodeHooksProps;
647
+ type index_NodeHooksType = NodeHooksType;
648
+ type index_NodeProperties = NodeProperties;
649
+ type index_NodeRenderOptions = NodeRenderOptions;
650
+ type index_NodeRendererProps = NodeRendererProps;
651
+ type index_NodeRendererType = NodeRendererType;
652
+ type index_NodeStore = NodeStore;
653
+ type index_NodeType = NodeType;
654
+ type index_OutputRendererProps = OutputRendererProps;
655
+ type index_OutputRendererType = OutputRendererType;
656
+ type index_PartialNodeType = PartialNodeType;
657
+ type index_PartialSerializedIOType = PartialSerializedIOType;
658
+ type index_PartialSerializedNodeIOMappingType = PartialSerializedNodeIOMappingType;
659
+ type index_PartialSerializedNodeType = PartialSerializedNodeType;
660
+ type index_RenderPluginFactoryProps = RenderPluginFactoryProps;
661
+ type index_RenderType = RenderType;
662
+ type index_RendererPlugin = RendererPlugin;
663
+ type index_SerializedIOType = SerializedIOType;
664
+ type index_SerializedNodeIOMappingType = SerializedNodeIOMappingType;
665
+ type index_SerializedNodeType = SerializedNodeType;
666
+ type index_SerializedType = SerializedType;
667
+ type index_StringRenderOptions = StringRenderOptions;
668
+ type index_TypeOf = TypeOf;
669
+ type index_UpdateableIOOptions = UpdateableIOOptions;
670
+ type index_ValueStoreInterface = ValueStoreInterface;
671
+ declare namespace index {
672
+ export type { index_AllOf as AllOf, index_AnyFuncNodesReactPlugin as AnyFuncNodesReactPlugin, index_AnyOf as AnyOf, index_AnyRenderPluginFactoryProps as AnyRenderPluginFactoryProps, index_AnyRendererPlugin as AnyRendererPlugin, index_ArrayOf as ArrayOf, index_BaseNodeAction as BaseNodeAction, index_BaseRenderOptions as BaseRenderOptions, index_BasicIOType as BasicIOType, index_BasicNodeType as BasicNodeType, index_DataOverlayRendererProps as DataOverlayRendererProps, index_DataOverlayRendererType as DataOverlayRendererType, index_DataPreviewViewRendererProps as DataPreviewViewRendererProps, index_DataPreviewViewRendererType as DataPreviewViewRendererType, index_DataRenderOptions as DataRenderOptions, index_DataViewRendererProps as DataViewRendererProps, index_DataViewRendererType as DataViewRendererType, index_DictOf as DictOf, index_EnumOf as EnumOf, index_FuncNodesReactPlugin as FuncNodesReactPlugin, index_HandlePreviewRendererProps as HandlePreviewRendererProps, index_HandlePreviewRendererType as HandlePreviewRendererType, index_IORenderOptions as IORenderOptions, index_IOStore as IOStore, index_IOType as IOType, index_IOValueOptions as IOValueOptions, index_ImageRenderOptions as ImageRenderOptions, index_InLineRendererProps as InLineRendererProps, index_InLineRendererType as InLineRendererType, index_InputRendererProps as InputRendererProps, index_InputRendererType as InputRendererType, index_NodeAction as NodeAction, index_NodeActionAdd as NodeActionAdd, index_NodeActionDelete as NodeActionDelete, index_NodeActionError as NodeActionError, index_NodeActionTrigger as NodeActionTrigger, index_NodeActionUpdate as NodeActionUpdate, index_NodeContextExtenderProps as NodeContextExtenderProps, index_NodeContextExtenderType as NodeContextExtenderType, index_NodeHooksProps as NodeHooksProps, index_NodeHooksType as NodeHooksType, index_NodeProperties as NodeProperties, index_NodeRenderOptions as NodeRenderOptions, index_NodeRendererProps as NodeRendererProps, index_NodeRendererType as NodeRendererType, index_NodeStore as NodeStore, index_NodeType as NodeType, index_OutputRendererProps as OutputRendererProps, index_OutputRendererType as OutputRendererType, index_PartialNodeType as PartialNodeType, index_PartialSerializedIOType as PartialSerializedIOType, index_PartialSerializedNodeIOMappingType as PartialSerializedNodeIOMappingType, index_PartialSerializedNodeType as PartialSerializedNodeType, RenderOptions$1 as RenderOptions, index_RenderPluginFactoryProps as RenderPluginFactoryProps, index_RenderType as RenderType, index_RendererPlugin as RendererPlugin, index_SerializedIOType as SerializedIOType, index_SerializedNodeIOMappingType as SerializedNodeIOMappingType, index_SerializedNodeType as SerializedNodeType, index_SerializedType as SerializedType, index_StringRenderOptions as StringRenderOptions, index_TypeOf as TypeOf, index_UpdateableIOOptions as UpdateableIOOptions, index_ValueStoreInterface as ValueStoreInterface };
320
673
  }
321
- type PartialNodeType = DeepPartial<NodeType>;
322
674
 
323
675
  interface WorkerProps {
324
676
  zustand?: FuncNodesReactFlowZustandInterface;
@@ -336,17 +688,20 @@ interface HookProperties {
336
688
  declare class FuncNodesWorker {
337
689
  messagePromises: Map<string, any>;
338
690
  _zustand?: FuncNodesReactFlowZustandInterface;
339
- _local_nodeupdates: Map<string, PartialNodeType>;
691
+ _local_nodeupdates: Map<string, PartialSerializedNodeType>;
340
692
  _nodeupdatetimer: ReturnType<typeof setTimeout>;
341
693
  uuid: string;
342
694
  _responsive: boolean;
695
+ private CHUNK_TIMEOUT;
696
+ private PONGDELAY;
697
+ private blobChunks;
343
698
  state: UseBoundStore<StoreApi<FuncNodesWorkerState>>;
344
699
  on_sync_complete: (worker: FuncNodesWorker) => Promise<void>;
345
700
  _hooks: Map<string, ((p: HookProperties) => Promise<void>)[]>;
346
701
  _ns_event_intercepts: Map<string, ((event: NodeSpaceEvent) => Promise<NodeSpaceEvent>)[]>;
347
702
  _last_pong: number;
348
703
  _unique_cmd_outs: {
349
- [key: string]: Promise<any>;
704
+ [key: string]: Promise<any> | undefined;
350
705
  };
351
706
  on_error: (error: any) => void;
352
707
  constructor(data: WorkerProps);
@@ -369,7 +724,7 @@ declare class FuncNodesWorker {
369
724
  trigger_node(node_id: string): Promise<void>;
370
725
  add_node(node_id: string): Promise<void>;
371
726
  remove_node(node_id: string): Promise<void>;
372
- _receive_node_added(data: NodeType): Promise<void>;
727
+ _receive_node_added(data: SerializedNodeType): Promise<void>;
373
728
  add_edge({ src_nid, src_ioid, trg_nid, trg_ioid, replace, }: {
374
729
  src_nid: string;
375
730
  src_ioid: string;
@@ -410,11 +765,12 @@ declare class FuncNodesWorker {
410
765
  [ioid: string]: any;
411
766
  }>;
412
767
  get_runstate(): Promise<any>;
413
- _send_cmd({ cmd, kwargs, wait_for_response, response_timeout, retries, unique, }: {
768
+ _send_cmd({ cmd, kwargs, as_bytes, wait_for_response, response_timeout, retries, unique, }: {
414
769
  cmd: string;
415
770
  kwargs?: any;
416
771
  wait_for_response?: boolean;
417
772
  response_timeout?: number;
773
+ as_bytes?: boolean;
418
774
  retries?: number;
419
775
  unique?: boolean;
420
776
  }): Promise<any>;
@@ -423,13 +779,17 @@ declare class FuncNodesWorker {
423
779
  files: File[] | FileList;
424
780
  onProgressCallback?: (loaded: number, total?: number) => void;
425
781
  root?: string;
426
- }): Promise<string[]>;
782
+ }): Promise<string>;
427
783
  handle_large_message_hint({}: LargeMessageHint): Promise<void>;
428
784
  receive_workerevent({ event, data }: WorkerEvent): Promise<void>;
429
785
  receive_nodespace_event(ns_event: NodeSpaceEvent): Promise<void>;
430
786
  add_lib(lib: string, release: string): Promise<any>;
431
787
  remove_lib(lib: string): Promise<any>;
432
788
  receive(data: JSONMessage): Promise<any>;
789
+ onbytes(data: Uint8Array): Promise<void>;
790
+ recieve_bytes(headerObj: {
791
+ [key: string]: string | undefined;
792
+ }, bytes: Uint8Array): Promise<void>;
433
793
  disconnect(): void;
434
794
  onclose(): void;
435
795
  reconnect(): Promise<void>;
@@ -475,11 +835,16 @@ declare class WebSocketWorker extends FuncNodesWorker {
475
835
  get secure_url(): boolean;
476
836
  get url_wo_protocol(): string;
477
837
  get http_url(): string;
838
+ get_io_subscription_url({ node_id, io_id, stream, }: {
839
+ node_id: string;
840
+ io_id: string;
841
+ stream: boolean;
842
+ }): string;
478
843
  upload_file({ files, onProgressCallback, root, }: {
479
844
  files: File[] | FileList;
480
845
  onProgressCallback?: (loaded: number, total?: number) => void;
481
846
  root?: string;
482
- }): Promise<string[]>;
847
+ }): Promise<string>;
483
848
  handle_large_message_hint({ msg_id }: LargeMessageHint): Promise<void>;
484
849
  onopen(): void;
485
850
  onclose(): void;
@@ -601,90 +966,6 @@ interface EdgeActionDelete extends BaseEdgeAction {
601
966
  }
602
967
  type EdgeAction = EdgeActionAdd | EdgeActionDelete;
603
968
 
604
- type HandlePreviewRendererType = ({ io }: {
605
- io: IOType;
606
- }) => JSX.Element;
607
- type DataOverlayRendererType = ({ io }: {
608
- io: IOType;
609
- }) => JSX.Element;
610
- type DataPreviewViewRendererType = ({ io }: {
611
- io: IOType;
612
- }) => JSX.Element;
613
- type DataViewRendererType = ({ io }: {
614
- io: IOType;
615
- }) => JSX.Element;
616
- /**
617
- * RenderMappingProvider is a React component that provides a context for managing and extending the mappings of input renderers, handle preview renderers, data overlay renderers, data preview view renderers, and data view renderers. These mappings are used throughout the application to render various types of inputs, previews, and data views dynamically.
618
-
619
- * The provider initializes with a set of default mappings and allows these mappings to be extended or overwritten via actions dispatched within the component's reducer. Additionally, it can automatically integrate renderer plugins, extending the functionality based on the provided plugins.
620
-
621
- * @param {object} props - The props object for the RenderMappingProvider component.
622
- * @param {ReactElement} props.children - The child components that will be wrapped by the provider.
623
- * @param {object} props.plugins - An object containing various FuncNodesReactPlugin instances, which may include renderer plugins to be integrated into the render mappings.
624
-
625
- * @returns {JSX.Element} A JSX element that provides the render mapping context to its children.
626
-
627
- * Context Value:
628
- * The context value provided by this component includes the following properties and functions:
629
- * - Inputrenderer: A mapping of input types to their corresponding renderer components.
630
- * - Outputrenderer: A mapping of output types to their corresponding renderer components.
631
- * - HandlePreviewRenderer: A mapping of handle preview types to their corresponding renderer components.
632
- * - DataOverlayRenderer: A mapping of data overlay types to their corresponding renderer components.
633
- * - DataPreviewViewRenderer: A mapping of data preview view types to their corresponding renderer components.
634
- * - DataViewRenderer: A mapping of data view types to their corresponding renderer components.
635
- * - extendInputRenderMapping: A function to extend the input renderer mapping.
636
- * - extendOutputRenderMapping: A function to extend the output renderer mapping.
637
- * - extendHandlePreviewRenderMapping: A function to extend the handle preview renderer mapping.
638
- * - extendDataOverlayRenderMapping: A function to extend the data overlay renderer mapping.
639
- * - extendDataPreviewRenderMapping: A function to extend the data preview view renderer mapping.
640
- * - extendDataViewRenderMapping: A function to extend the data view renderer mapping.
641
- * - extendFromPlugin: A function to extend all relevant mappings from a given renderer plugin.
642
-
643
- * Example usage:
644
- * ```jsx
645
- * <RenderMappingProvider plugins={myPlugins}>
646
- * <MyComponent />
647
- * </RenderMappingProvider>
648
- * ```
649
- */
650
- declare const RenderMappingProvider: ({ children, plugins, fnrf_zst, }: {
651
- children: ReactElement;
652
- plugins: {
653
- [key: string]: FuncNodesReactPlugin;
654
- };
655
- fnrf_zst: FuncNodesReactFlowZustandInterface;
656
- }) => JSX.Element;
657
-
658
- interface RendererPlugin {
659
- input_renderers?: {
660
- [key: string]: InputRendererType;
661
- };
662
- output_renderers?: {
663
- [key: string]: OutputRendererType;
664
- };
665
- handle_preview_renderers?: {
666
- [key: string]: HandlePreviewRendererType;
667
- };
668
- data_overlay_renderers?: {
669
- [key: string]: DataOverlayRendererType;
670
- };
671
- data_preview_renderers?: {
672
- [key: string]: DataPreviewViewRendererType;
673
- };
674
- data_view_renderers?: {
675
- [key: string]: DataViewRendererType;
676
- };
677
- }
678
-
679
- type RenderPluginFactoryProps = {
680
- React: typeof React;
681
- fnrf_zst: FuncNodesReactFlowZustandInterface;
682
- };
683
- interface FuncNodesReactPlugin {
684
- RendererPlugin?: RendererPlugin;
685
- renderpluginfactory?: (props: RenderPluginFactoryProps) => RendererPlugin;
686
- }
687
-
688
969
  interface Logger {
689
970
  level: number;
690
971
  set_level: (level: number) => void;
@@ -696,10 +977,10 @@ interface Logger {
696
977
 
697
978
  interface RenderOptions {
698
979
  typemap?: {
699
- [key: string]: string;
980
+ [key: string]: string | undefined;
700
981
  };
701
982
  inputconverter?: {
702
- [key: string]: string;
983
+ [key: string]: string | undefined;
703
984
  };
704
985
  }
705
986
  interface ProgressState {
@@ -726,14 +1007,14 @@ interface NodeSpaceEvent {
726
1007
  type: "nsevent";
727
1008
  event: string;
728
1009
  data: {
729
- [key: string]: any;
1010
+ [key: string]: any | undefined;
730
1011
  };
731
1012
  }
732
1013
  interface WorkerEvent {
733
1014
  type: "workerevent";
734
1015
  event: string;
735
1016
  data: {
736
- [key: string]: any;
1017
+ [key: string]: any | undefined;
737
1018
  };
738
1019
  }
739
1020
  interface LargeMessageHint {
@@ -754,7 +1035,7 @@ interface WorkerRepresentation {
754
1035
  name: string | null;
755
1036
  }
756
1037
  interface WorkersState {
757
- [key: string]: WorkerRepresentation;
1038
+ [key: string]: WorkerRepresentation | undefined;
758
1039
  }
759
1040
  interface FuncnodesReactHeaderProps {
760
1041
  show: boolean;
@@ -824,7 +1105,7 @@ interface FuncNodesReactFlowZustandInterface {
824
1105
  set_progress: (progress: ProgressState) => void;
825
1106
  auto_progress: () => void;
826
1107
  plugins: UseBoundStore<StoreApi<{
827
- [key: string]: FuncNodesReactPlugin;
1108
+ [key: string]: FuncNodesReactPlugin | undefined;
828
1109
  }>>;
829
1110
  add_plugin: (name: string, plugin: FuncNodesReactPlugin) => void;
830
1111
  reactflowRef: HTMLDivElement | null;
@@ -849,10 +1130,96 @@ declare const helperfunctions: {
849
1130
 
850
1131
  declare const FuncNodesReactFlowZustand: (props: FuncnodesReactFlowProps) => FuncNodesReactFlowZustandInterface;
851
1132
 
852
- declare const ReactFlowLayer: (props: ReactFlowLayerProps) => React.JSX.Element;
1133
+ interface DispatchOptions {
1134
+ overwrite?: boolean;
1135
+ }
1136
+ /**
1137
+ * RenderMappingProvider is a React component that provides a context for managing and extending the mappings of input renderers, handle preview renderers, data overlay renderers, data preview view renderers, and data view renderers. These mappings are used throughout the application to render various types of inputs, previews, and data views dynamically.
853
1138
 
854
- declare const assert_full_node: (node: PartialNodeType) => NodeType;
1139
+ * The provider initializes with a set of default mappings and allows these mappings to be extended or overwritten via actions dispatched within the component's reducer. Additionally, it can automatically integrate renderer plugins, extending the functionality based on the provided plugins.
1140
+
1141
+ * @param {object} props - The props object for the RenderMappingProvider component.
1142
+ * @param {ReactElement} props.children - The child components that will be wrapped by the provider.
1143
+ * @param {object} props.plugins - An object containing various FuncNodesReactPlugin instances, which may include renderer plugins to be integrated into the render mappings.
1144
+
1145
+ * @returns {JSX.Element} A JSX element that provides the render mapping context to its children.
1146
+
1147
+ * Context Value:
1148
+ * The context value provided by this component includes the following properties and functions:
1149
+ * - Inputrenderer: A mapping of input types to their corresponding renderer components.
1150
+ * - Outputrenderer: A mapping of output types to their corresponding renderer components.
1151
+ * - HandlePreviewRenderer: A mapping of handle preview types to their corresponding renderer components.
1152
+ * - DataOverlayRenderer: A mapping of data overlay types to their corresponding renderer components.
1153
+ * - DataPreviewViewRenderer: A mapping of data preview view types to their corresponding renderer components.
1154
+ * - DataViewRenderer: A mapping of data view types to their corresponding renderer components.
1155
+ * - extendInputRenderMapping: A function to extend the input renderer mapping.
1156
+ * - extendOutputRenderMapping: A function to extend the output renderer mapping.
1157
+ * - extendHandlePreviewRenderMapping: A function to extend the handle preview renderer mapping.
1158
+ * - extendDataOverlayRenderMapping: A function to extend the data overlay renderer mapping.
1159
+ * - extendDataPreviewRenderMapping: A function to extend the data preview view renderer mapping.
1160
+ * - extendDataViewRenderMapping: A function to extend the data view renderer mapping.
1161
+ * - extendFromPlugin: A function to extend all relevant mappings from a given renderer plugin.
1162
+
1163
+ * Example usage:
1164
+ * ```jsx
1165
+ * <RenderMappingProvider plugins={myPlugins}>
1166
+ * <MyComponent />
1167
+ * </RenderMappingProvider>
1168
+ * ```
1169
+ */
1170
+ declare const RenderMappingProvider: ({ children, plugins, fnrf_zst, }: {
1171
+ children: ReactElement;
1172
+ plugins: {
1173
+ [key: string]: FuncNodesReactPlugin | undefined;
1174
+ };
1175
+ fnrf_zst: FuncNodesReactFlowZustandInterface;
1176
+ }) => React.JSX.Element;
1177
+ declare const RenderMappingContext: React.Context<{
1178
+ Inputrenderer: {
1179
+ [key: string]: InputRendererType | undefined;
1180
+ };
1181
+ Outputrenderer: {
1182
+ [key: string]: OutputRendererType | undefined;
1183
+ };
1184
+ HandlePreviewRenderer: {
1185
+ [key: string]: HandlePreviewRendererType | undefined;
1186
+ };
1187
+ DataOverlayRenderer: {
1188
+ [key: string]: DataOverlayRendererType | undefined;
1189
+ };
1190
+ DataPreviewViewRenderer: {
1191
+ [key: string]: DataPreviewViewRendererType | undefined;
1192
+ };
1193
+ DataViewRenderer: {
1194
+ [key: string]: DataViewRendererType | undefined;
1195
+ };
1196
+ InLineRenderer: {
1197
+ [key: string]: InLineRendererType | undefined;
1198
+ };
1199
+ NodeContextExtenders: {
1200
+ [key: string]: NodeContextExtenderType | undefined;
1201
+ };
1202
+ NodeRenderer: {
1203
+ [key: string]: NodeRendererType | undefined;
1204
+ };
1205
+ NodeHooks: {
1206
+ [key: string]: NodeHooksType[] | undefined;
1207
+ };
1208
+ extendInputRenderMapping: (_type: string, _component: InputRendererType, _options: DispatchOptions) => void;
1209
+ extendOutputRenderMapping: (_type: string, _component: OutputRendererType, _options: DispatchOptions) => void;
1210
+ extendHandlePreviewRenderMapping: (_type: string, _component: HandlePreviewRendererType, _options: DispatchOptions) => void;
1211
+ extendDataOverlayRenderMapping: (_type: string, _component: DataOverlayRendererType, _options: DispatchOptions) => void;
1212
+ extendDataPreviewRenderMapping: (_type: string, _component: DataPreviewViewRendererType, _options: DispatchOptions) => void;
1213
+ extendDataViewRenderMapping: (_type: string, _component: DataViewRendererType, _options: DispatchOptions) => void;
1214
+ extendNodeContextExtender: (_type: string, _component: NodeContextExtenderType, _options: DispatchOptions) => void;
1215
+ extendNodeRenderer: (_type: string, _component: NodeRendererType, _options: DispatchOptions) => void;
1216
+ extendNodeHooks: (_type: string, _component: NodeHooksType[], _options: DispatchOptions) => void;
1217
+ extendFromPlugin: (_plugin: RendererPlugin, _options: DispatchOptions) => void;
1218
+ }>;
1219
+
1220
+ declare const ReactFlowLayer: (props: ReactFlowLayerProps) => React.JSX.Element;
855
1221
 
856
1222
  declare const FuncNodes: (props: LimitedDeepPartial<FuncnodesReactFlowProps>) => React.JSX.Element;
857
1223
 
858
- export { type DataOverlayRendererType, type DataPreviewViewRendererType, type DataViewRendererType, FuncNodesContext, FuncNodesReactFlowZustand, type FuncNodesReactFlowZustandInterface, type FuncNodesReactPlugin, FuncNodesWorker, FuncnodesReactFlow, type FuncnodesReactFlowProps, type HandlePreviewRendererType, type IOType, type InputRendererProps, type NodeType, type OutputRendererProps, type PartialNodeType, type ProgressState, ReactFlowLayer, RenderMappingProvider, type RenderPluginFactoryProps, type RendererPlugin, WebSocketWorker, type WorkerProps, assert_full_node, deep_update, FuncNodes as default, helperfunctions };
1224
+ export { FuncNodesContext, FuncNodesReactFlowZustand, FuncNodesWorker, FuncnodesReactFlow, NodeContext, ReactFlowLayer, RenderMappingContext, RenderMappingProvider, WebSocketWorker, deep_update, FuncNodes as default, helperfunctions, index as latest_types, index$1 as v0_types, index as v1_types };
1225
+ export type { FuncNodesReactFlowZustandInterface, FuncnodesReactFlowProps, NodeContextType, ProgressState, WorkerProps };