@linkdlab/funcnodes_react_flow 0.3.21 → 0.4.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/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,7 +688,7 @@ 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;
@@ -346,7 +698,7 @@ declare class FuncNodesWorker {
346
698
  _ns_event_intercepts: Map<string, ((event: NodeSpaceEvent) => Promise<NodeSpaceEvent>)[]>;
347
699
  _last_pong: number;
348
700
  _unique_cmd_outs: {
349
- [key: string]: Promise<any>;
701
+ [key: string]: Promise<any> | undefined;
350
702
  };
351
703
  on_error: (error: any) => void;
352
704
  constructor(data: WorkerProps);
@@ -369,7 +721,7 @@ declare class FuncNodesWorker {
369
721
  trigger_node(node_id: string): Promise<void>;
370
722
  add_node(node_id: string): Promise<void>;
371
723
  remove_node(node_id: string): Promise<void>;
372
- _receive_node_added(data: NodeType): Promise<void>;
724
+ _receive_node_added(data: SerializedNodeType): Promise<void>;
373
725
  add_edge({ src_nid, src_ioid, trg_nid, trg_ioid, replace, }: {
374
726
  src_nid: string;
375
727
  src_ioid: string;
@@ -410,11 +762,12 @@ declare class FuncNodesWorker {
410
762
  [ioid: string]: any;
411
763
  }>;
412
764
  get_runstate(): Promise<any>;
413
- _send_cmd({ cmd, kwargs, wait_for_response, response_timeout, retries, unique, }: {
765
+ _send_cmd({ cmd, kwargs, as_bytes, wait_for_response, response_timeout, retries, unique, }: {
414
766
  cmd: string;
415
767
  kwargs?: any;
416
768
  wait_for_response?: boolean;
417
769
  response_timeout?: number;
770
+ as_bytes?: boolean;
418
771
  retries?: number;
419
772
  unique?: boolean;
420
773
  }): Promise<any>;
@@ -430,6 +783,9 @@ declare class FuncNodesWorker {
430
783
  add_lib(lib: string, release: string): Promise<any>;
431
784
  remove_lib(lib: string): Promise<any>;
432
785
  receive(data: JSONMessage): Promise<any>;
786
+ recieve_bytes(headerObj: {
787
+ [key: string]: string | undefined;
788
+ }, bytes: Uint8Array): Promise<void>;
433
789
  disconnect(): void;
434
790
  onclose(): void;
435
791
  reconnect(): Promise<void>;
@@ -466,15 +822,23 @@ declare class WebSocketWorker extends FuncNodesWorker {
466
822
  private initialTimeout;
467
823
  private maxTimeout;
468
824
  private _reconnect;
825
+ private CHUNK_TIMEOUT;
826
+ private blobChunks;
469
827
  constructor(data: WebSocketWorkerProps);
470
828
  private connect;
471
829
  private calculateReconnectTimeout;
472
830
  private auto_reconnect;
473
831
  onmessage(data: string): Promise<void>;
832
+ onbytes(data: Blob): Promise<void>;
474
833
  get http_protocol(): string;
475
834
  get secure_url(): boolean;
476
835
  get url_wo_protocol(): string;
477
836
  get http_url(): string;
837
+ get_io_subscription_url({ node_id, io_id, stream, }: {
838
+ node_id: string;
839
+ io_id: string;
840
+ stream: boolean;
841
+ }): string;
478
842
  upload_file({ files, onProgressCallback, root, }: {
479
843
  files: File[] | FileList;
480
844
  onProgressCallback?: (loaded: number, total?: number) => void;
@@ -601,90 +965,6 @@ interface EdgeActionDelete extends BaseEdgeAction {
601
965
  }
602
966
  type EdgeAction = EdgeActionAdd | EdgeActionDelete;
603
967
 
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
968
  interface Logger {
689
969
  level: number;
690
970
  set_level: (level: number) => void;
@@ -696,10 +976,10 @@ interface Logger {
696
976
 
697
977
  interface RenderOptions {
698
978
  typemap?: {
699
- [key: string]: string;
979
+ [key: string]: string | undefined;
700
980
  };
701
981
  inputconverter?: {
702
- [key: string]: string;
982
+ [key: string]: string | undefined;
703
983
  };
704
984
  }
705
985
  interface ProgressState {
@@ -726,14 +1006,14 @@ interface NodeSpaceEvent {
726
1006
  type: "nsevent";
727
1007
  event: string;
728
1008
  data: {
729
- [key: string]: any;
1009
+ [key: string]: any | undefined;
730
1010
  };
731
1011
  }
732
1012
  interface WorkerEvent {
733
1013
  type: "workerevent";
734
1014
  event: string;
735
1015
  data: {
736
- [key: string]: any;
1016
+ [key: string]: any | undefined;
737
1017
  };
738
1018
  }
739
1019
  interface LargeMessageHint {
@@ -754,7 +1034,7 @@ interface WorkerRepresentation {
754
1034
  name: string | null;
755
1035
  }
756
1036
  interface WorkersState {
757
- [key: string]: WorkerRepresentation;
1037
+ [key: string]: WorkerRepresentation | undefined;
758
1038
  }
759
1039
  interface FuncnodesReactHeaderProps {
760
1040
  show: boolean;
@@ -824,7 +1104,7 @@ interface FuncNodesReactFlowZustandInterface {
824
1104
  set_progress: (progress: ProgressState) => void;
825
1105
  auto_progress: () => void;
826
1106
  plugins: UseBoundStore<StoreApi<{
827
- [key: string]: FuncNodesReactPlugin;
1107
+ [key: string]: FuncNodesReactPlugin | undefined;
828
1108
  }>>;
829
1109
  add_plugin: (name: string, plugin: FuncNodesReactPlugin) => void;
830
1110
  reactflowRef: HTMLDivElement | null;
@@ -849,10 +1129,95 @@ declare const helperfunctions: {
849
1129
 
850
1130
  declare const FuncNodesReactFlowZustand: (props: FuncnodesReactFlowProps) => FuncNodesReactFlowZustandInterface;
851
1131
 
852
- declare const ReactFlowLayer: (props: ReactFlowLayerProps) => React.JSX.Element;
1132
+ interface DispatchOptions {
1133
+ overwrite?: boolean;
1134
+ }
1135
+ /**
1136
+ * 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
1137
 
854
- declare const assert_full_node: (node: PartialNodeType) => NodeType;
1138
+ * 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.
1139
+
1140
+ * @param {object} props - The props object for the RenderMappingProvider component.
1141
+ * @param {ReactElement} props.children - The child components that will be wrapped by the provider.
1142
+ * @param {object} props.plugins - An object containing various FuncNodesReactPlugin instances, which may include renderer plugins to be integrated into the render mappings.
1143
+
1144
+ * @returns {JSX.Element} A JSX element that provides the render mapping context to its children.
1145
+
1146
+ * Context Value:
1147
+ * The context value provided by this component includes the following properties and functions:
1148
+ * - Inputrenderer: A mapping of input types to their corresponding renderer components.
1149
+ * - Outputrenderer: A mapping of output types to their corresponding renderer components.
1150
+ * - HandlePreviewRenderer: A mapping of handle preview types to their corresponding renderer components.
1151
+ * - DataOverlayRenderer: A mapping of data overlay types to their corresponding renderer components.
1152
+ * - DataPreviewViewRenderer: A mapping of data preview view types to their corresponding renderer components.
1153
+ * - DataViewRenderer: A mapping of data view types to their corresponding renderer components.
1154
+ * - extendInputRenderMapping: A function to extend the input renderer mapping.
1155
+ * - extendOutputRenderMapping: A function to extend the output renderer mapping.
1156
+ * - extendHandlePreviewRenderMapping: A function to extend the handle preview renderer mapping.
1157
+ * - extendDataOverlayRenderMapping: A function to extend the data overlay renderer mapping.
1158
+ * - extendDataPreviewRenderMapping: A function to extend the data preview view renderer mapping.
1159
+ * - extendDataViewRenderMapping: A function to extend the data view renderer mapping.
1160
+ * - extendFromPlugin: A function to extend all relevant mappings from a given renderer plugin.
1161
+
1162
+ * Example usage:
1163
+ * ```jsx
1164
+ * <RenderMappingProvider plugins={myPlugins}>
1165
+ * <MyComponent />
1166
+ * </RenderMappingProvider>
1167
+ * ```
1168
+ */
1169
+ declare const RenderMappingProvider: ({ children, plugins, fnrf_zst, }: {
1170
+ children: ReactElement;
1171
+ plugins: {
1172
+ [key: string]: FuncNodesReactPlugin | undefined;
1173
+ };
1174
+ fnrf_zst: FuncNodesReactFlowZustandInterface;
1175
+ }) => React.JSX.Element;
1176
+ declare const RenderMappingContext: React.Context<{
1177
+ Inputrenderer: {
1178
+ [key: string]: InputRendererType | undefined;
1179
+ };
1180
+ Outputrenderer: {
1181
+ [key: string]: OutputRendererType | undefined;
1182
+ };
1183
+ HandlePreviewRenderer: {
1184
+ [key: string]: HandlePreviewRendererType | undefined;
1185
+ };
1186
+ DataOverlayRenderer: {
1187
+ [key: string]: DataOverlayRendererType | undefined;
1188
+ };
1189
+ DataPreviewViewRenderer: {
1190
+ [key: string]: DataPreviewViewRendererType | undefined;
1191
+ };
1192
+ DataViewRenderer: {
1193
+ [key: string]: DataViewRendererType | undefined;
1194
+ };
1195
+ InLineRenderer: {
1196
+ [key: string]: InLineRendererType | undefined;
1197
+ };
1198
+ NodeContextExtenders: {
1199
+ [key: string]: NodeContextExtenderType | undefined;
1200
+ };
1201
+ NodeRenderer: {
1202
+ [key: string]: NodeRendererType | undefined;
1203
+ };
1204
+ NodeHooks: {
1205
+ [key: string]: NodeHooksType[] | undefined;
1206
+ };
1207
+ extendInputRenderMapping: (_type: string, _component: InputRendererType, _options: DispatchOptions) => void;
1208
+ extendOutputRenderMapping: (_type: string, _component: OutputRendererType, _options: DispatchOptions) => void;
1209
+ extendHandlePreviewRenderMapping: (_type: string, _component: HandlePreviewRendererType, _options: DispatchOptions) => void;
1210
+ extendDataOverlayRenderMapping: (_type: string, _component: DataOverlayRendererType, _options: DispatchOptions) => void;
1211
+ extendDataPreviewRenderMapping: (_type: string, _component: DataPreviewViewRendererType, _options: DispatchOptions) => void;
1212
+ extendDataViewRenderMapping: (_type: string, _component: DataViewRendererType, _options: DispatchOptions) => void;
1213
+ extendNodeContextExtender: (_type: string, _component: NodeContextExtenderType, _options: DispatchOptions) => void;
1214
+ extendNodeRenderer: (_type: string, _component: NodeRendererType, _options: DispatchOptions) => void;
1215
+ extendNodeHooks: (_type: string, _component: NodeHooksType[], _options: DispatchOptions) => void;
1216
+ extendFromPlugin: (_plugin: RendererPlugin, _options: DispatchOptions) => void;
1217
+ }>;
1218
+
1219
+ declare const ReactFlowLayer: (props: ReactFlowLayerProps) => React.JSX.Element;
855
1220
 
856
1221
  declare const FuncNodes: (props: LimitedDeepPartial<FuncnodesReactFlowProps>) => React.JSX.Element;
857
1222
 
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 };
1223
+ export { FuncNodesContext, FuncNodesReactFlowZustand, type FuncNodesReactFlowZustandInterface, FuncNodesWorker, FuncnodesReactFlow, type FuncnodesReactFlowProps, NodeContext, type NodeContextType, type ProgressState, ReactFlowLayer, RenderMappingContext, RenderMappingProvider, WebSocketWorker, type WorkerProps, deep_update, FuncNodes as default, helperfunctions, index as latest_types, index$1 as v0_types, index as v1_types };