@flowgram.ai/form-core 0.1.0-alpha.3 → 0.1.0-alpha.31
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/esm/index.js +13 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +285 -78
- package/dist/index.d.ts +285 -78
- package/dist/index.js +18 -14
- package/dist/index.js.map +1 -1
- package/package.json +14 -15
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FlowNodeEntity } from '@flowgram.ai/document';
|
|
3
|
-
import
|
|
3
|
+
import * as _flowgram_ai_utils from '@flowgram.ai/utils';
|
|
4
|
+
import { MaybePromise, Event, DisposableCollection, Emitter } from '@flowgram.ai/utils';
|
|
5
|
+
import { EntityData, PlaygroundContext, PluginContext, EntityDataRegistry } from '@flowgram.ai/core';
|
|
4
6
|
import * as inversify from 'inversify';
|
|
5
7
|
import { ContainerModule } from 'inversify';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
11
|
+
* SPDX-License-Identifier: MIT
|
|
12
|
+
*/
|
|
8
13
|
|
|
9
14
|
interface ErrorData {
|
|
10
15
|
error: Error | null;
|
|
@@ -16,94 +21,42 @@ declare class FlowNodeErrorData extends EntityData {
|
|
|
16
21
|
getError(): Error;
|
|
17
22
|
}
|
|
18
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
26
|
+
* SPDX-License-Identifier: MIT
|
|
27
|
+
*/
|
|
28
|
+
|
|
19
29
|
interface NodeErrorRenderProps {
|
|
20
30
|
error: Error;
|
|
21
31
|
context: NodeContext;
|
|
22
32
|
}
|
|
23
33
|
type NodeErrorRender = Render<NodeErrorRenderProps>;
|
|
24
34
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
interface NodeContext {
|
|
30
|
-
node: FlowNodeEntity;
|
|
31
|
-
playgroundContext: PlaygroundContext;
|
|
32
|
-
}
|
|
33
|
-
type Render<T = any> = (props: T) => any;
|
|
34
|
-
type NodePluginRender = Render<NodeContext>;
|
|
35
|
-
type NodePlaceholderRender = Render<NodeContext>;
|
|
36
|
-
interface NodeRenderProps {
|
|
37
|
-
node: FlowNodeEntity;
|
|
38
|
-
}
|
|
39
|
-
type NodeRenderHoc = (Component: React.JSXElementConstructor<NodeRenderProps>) => React.JSXElementConstructor<NodeRenderProps>;
|
|
40
|
-
|
|
41
|
-
declare enum MaterialRenderKey {
|
|
42
|
-
CustomNodeError = "Material_CustomNodeError"
|
|
43
|
-
}
|
|
44
|
-
declare class NodeManager {
|
|
45
|
-
readonly materialRenderRegistry: Map<string, Render>;
|
|
46
|
-
readonly pluginRenderRegistry: Map<string, Render>;
|
|
47
|
-
readonly nodeRenderHocs: NodeRenderHoc[];
|
|
48
|
-
protected nodeContributions: NodeContribution[];
|
|
49
|
-
registerMaterialRender(key: string, render: Render): void;
|
|
50
|
-
getMaterialRender(key: string): Render | undefined;
|
|
51
|
-
registerPluginRender(key: string, render: NodePluginRender): void;
|
|
52
|
-
getPluginRender(key: string): NodePluginRender | undefined;
|
|
53
|
-
registerNodeErrorRender(render: Render<NodeErrorRenderProps>): void;
|
|
54
|
-
get nodeRenderHoc(): (...args: any[]) => any;
|
|
55
|
-
registerNodeRenderHoc(hoc: NodeRenderHoc): void;
|
|
56
|
-
get nodeErrorRender(): Render | undefined;
|
|
57
|
-
protected init(): void;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
declare const NodeContribution: unique symbol;
|
|
61
|
-
interface NodeContribution {
|
|
62
|
-
onRegister?(nodeManager: NodeManager): void;
|
|
63
|
-
}
|
|
35
|
+
/**
|
|
36
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
37
|
+
* SPDX-License-Identifier: MIT
|
|
38
|
+
*/
|
|
64
39
|
|
|
65
|
-
declare const
|
|
40
|
+
declare const ErrorContainerModule: ContainerModule;
|
|
66
41
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
44
|
+
* SPDX-License-Identifier: MIT
|
|
45
|
+
*/
|
|
71
46
|
|
|
72
|
-
declare
|
|
73
|
-
NODE_ERROR_RENDER: string;
|
|
74
|
-
NODE_PLACEHOLDER_RENDER: string;
|
|
75
|
-
};
|
|
47
|
+
declare function getNodeError(node: FlowNodeEntity): Error;
|
|
76
48
|
|
|
77
|
-
interface INodeEngineContext {
|
|
78
|
-
readonly: boolean;
|
|
79
|
-
}
|
|
80
49
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
50
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
51
|
+
* SPDX-License-Identifier: MIT
|
|
83
52
|
*/
|
|
84
|
-
declare class NodeEngineContext {
|
|
85
|
-
static DEFAULT_READONLY: boolean;
|
|
86
|
-
static DEFAULT_JSON: {
|
|
87
|
-
readonly: boolean;
|
|
88
|
-
};
|
|
89
|
-
readonly onChangeEmitter: Emitter<NodeEngineContext>;
|
|
90
|
-
readonly onChange: _flowgram_ai_utils.Event<NodeEngineContext>;
|
|
91
|
-
private _readonly;
|
|
92
|
-
private _json;
|
|
93
|
-
get json(): INodeEngineContext;
|
|
94
|
-
get readonly(): boolean;
|
|
95
|
-
set readonly(value: boolean);
|
|
96
|
-
private fireChange;
|
|
97
|
-
private updateJSON;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
declare class NodeEngine {
|
|
101
|
-
nodeManager: NodeManager;
|
|
102
|
-
context: NodeEngineContext;
|
|
103
|
-
}
|
|
104
53
|
|
|
105
54
|
declare const FormCoreContainerModule: ContainerModule;
|
|
106
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
58
|
+
* SPDX-License-Identifier: MIT
|
|
59
|
+
*/
|
|
107
60
|
interface FormItemAbility {
|
|
108
61
|
type: string;
|
|
109
62
|
/**
|
|
@@ -116,6 +69,10 @@ interface AbilityClass {
|
|
|
116
69
|
new (): FormItemAbility;
|
|
117
70
|
}
|
|
118
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
74
|
+
* SPDX-License-Identifier: MIT
|
|
75
|
+
*/
|
|
119
76
|
interface IFormItem<T = any> {
|
|
120
77
|
value: T;
|
|
121
78
|
}
|
|
@@ -139,6 +96,11 @@ interface FormItemDomRef {
|
|
|
139
96
|
current: HTMLElement | null;
|
|
140
97
|
}
|
|
141
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
101
|
+
* SPDX-License-Identifier: MIT
|
|
102
|
+
*/
|
|
103
|
+
|
|
142
104
|
interface FormItemAbilityMeta<Options = any> {
|
|
143
105
|
type: string;
|
|
144
106
|
options: Options;
|
|
@@ -190,6 +152,11 @@ interface FormItemHooks<T> {
|
|
|
190
152
|
onValidate?: (params: FormItemHookParams & T) => void;
|
|
191
153
|
}
|
|
192
154
|
|
|
155
|
+
/**
|
|
156
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
157
|
+
* SPDX-License-Identifier: MIT
|
|
158
|
+
*/
|
|
159
|
+
|
|
193
160
|
type FormDataTypeName = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
|
|
194
161
|
type FormDataType = string | number | boolean | FormDataObject | DataArray | null;
|
|
195
162
|
interface FormDataObject {
|
|
@@ -247,7 +214,7 @@ interface IFormMeta {
|
|
|
247
214
|
/**
|
|
248
215
|
* 表单树结构root
|
|
249
216
|
*/
|
|
250
|
-
root
|
|
217
|
+
root?: IFormItemMeta;
|
|
251
218
|
/**
|
|
252
219
|
* 表单全局配置
|
|
253
220
|
*/
|
|
@@ -256,6 +223,7 @@ interface IFormMeta {
|
|
|
256
223
|
interface NodeFormContext {
|
|
257
224
|
node: FlowNodeEntity;
|
|
258
225
|
playgroundContext: PlaygroundContext;
|
|
226
|
+
clientContext: PluginContext & Record<string, any>;
|
|
259
227
|
}
|
|
260
228
|
interface IFormMetaOptions {
|
|
261
229
|
formatOnInit?: (value: any, context: NodeFormContext) => any;
|
|
@@ -270,6 +238,11 @@ interface FormMetaGeneratorParams<PlaygroundContext, FormValue = any> {
|
|
|
270
238
|
type FormMetaGenerator<PlaygroundContext = any, FormValue = any> = (params: FormMetaGeneratorParams<FormValue, FormValue>) => MaybePromise<IFormMeta>;
|
|
271
239
|
type FormMetaOrFormMetaGenerator = FormMetaGenerator | IFormMeta;
|
|
272
240
|
|
|
241
|
+
/**
|
|
242
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
243
|
+
* SPDX-License-Identifier: MIT
|
|
244
|
+
*/
|
|
245
|
+
|
|
273
246
|
type FormModelFactory = (entity: FlowNodeEntity) => FormModel;
|
|
274
247
|
declare const FormModelFactory: unique symbol;
|
|
275
248
|
declare const FormModelEntity: unique symbol;
|
|
@@ -288,9 +261,10 @@ declare abstract class FormModel {
|
|
|
288
261
|
* @deprecated
|
|
289
262
|
*/
|
|
290
263
|
abstract get formManager(): FormManager;
|
|
291
|
-
abstract get formMeta():
|
|
264
|
+
abstract get formMeta(): any;
|
|
292
265
|
abstract get initialized(): boolean;
|
|
293
266
|
abstract get valid(): FormModelValid;
|
|
267
|
+
abstract updateFormValues(value: any): void;
|
|
294
268
|
/**
|
|
295
269
|
* @deprecated
|
|
296
270
|
* use `formModel.getFieldIn` instead in FormModelV2 to get the model of a form field
|
|
@@ -337,6 +311,11 @@ declare abstract class FormItem {
|
|
|
337
311
|
dispose(): void;
|
|
338
312
|
}
|
|
339
313
|
|
|
314
|
+
/**
|
|
315
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
316
|
+
* SPDX-License-Identifier: MIT
|
|
317
|
+
*/
|
|
318
|
+
|
|
340
319
|
interface FormMetaTraverseParams {
|
|
341
320
|
formItemMeta: IFormItemMeta;
|
|
342
321
|
parentPath?: string;
|
|
@@ -354,6 +333,10 @@ declare class FormMeta implements IFormMeta {
|
|
|
354
333
|
static traverse({ formItemMeta, parentPath, handle }: FormMetaTraverseParams): void;
|
|
355
334
|
}
|
|
356
335
|
|
|
336
|
+
/**
|
|
337
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
338
|
+
* SPDX-License-Identifier: MIT
|
|
339
|
+
*/
|
|
357
340
|
interface Extension {
|
|
358
341
|
key: string;
|
|
359
342
|
}
|
|
@@ -365,6 +348,11 @@ declare class FormAbilityExtensionRegistry {
|
|
|
365
348
|
get collection(): Extension[];
|
|
366
349
|
}
|
|
367
350
|
|
|
351
|
+
/**
|
|
352
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
353
|
+
* SPDX-License-Identifier: MIT
|
|
354
|
+
*/
|
|
355
|
+
|
|
368
356
|
interface FormItemMaterialContext {
|
|
369
357
|
/**
|
|
370
358
|
* 当前表单项的meta
|
|
@@ -405,16 +393,31 @@ interface FormItemMaterialContext {
|
|
|
405
393
|
index?: number | undefined;
|
|
406
394
|
}
|
|
407
395
|
|
|
396
|
+
/**
|
|
397
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
398
|
+
* SPDX-License-Identifier: MIT
|
|
399
|
+
*/
|
|
400
|
+
|
|
408
401
|
declare class SetterAbility implements FormItemAbility {
|
|
409
402
|
static readonly type = "setter";
|
|
410
403
|
get type(): string;
|
|
411
404
|
}
|
|
412
405
|
|
|
406
|
+
/**
|
|
407
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
408
|
+
* SPDX-License-Identifier: MIT
|
|
409
|
+
*/
|
|
410
|
+
|
|
413
411
|
declare class ValidationAbility implements FormItemAbility {
|
|
414
412
|
static readonly type = "validation";
|
|
415
413
|
get type(): string;
|
|
416
414
|
}
|
|
417
415
|
|
|
416
|
+
/**
|
|
417
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
418
|
+
* SPDX-License-Identifier: MIT
|
|
419
|
+
*/
|
|
420
|
+
|
|
418
421
|
interface IValidateResult {
|
|
419
422
|
type: 'error' | 'warning';
|
|
420
423
|
message: string;
|
|
@@ -441,6 +444,11 @@ interface ValidationExtension {
|
|
|
441
444
|
validator: ValidatorFunction;
|
|
442
445
|
}
|
|
443
446
|
|
|
447
|
+
/**
|
|
448
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
449
|
+
* SPDX-License-Identifier: MIT
|
|
450
|
+
*/
|
|
451
|
+
|
|
444
452
|
interface SetterAbilityOptions {
|
|
445
453
|
/**
|
|
446
454
|
* 已注册的setter的唯一标识
|
|
@@ -472,11 +480,21 @@ interface SetterExtension {
|
|
|
472
480
|
}
|
|
473
481
|
type SetterHoc = (Component: React.JSXElementConstructor<SetterComponentProps>) => React.JSXElementConstructor<SetterComponentProps>;
|
|
474
482
|
|
|
483
|
+
/**
|
|
484
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
485
|
+
* SPDX-License-Identifier: MIT
|
|
486
|
+
*/
|
|
487
|
+
|
|
475
488
|
declare class DecoratorAbility implements FormItemAbility {
|
|
476
489
|
static readonly type = "decorator";
|
|
477
490
|
get type(): string;
|
|
478
491
|
}
|
|
479
492
|
|
|
493
|
+
/**
|
|
494
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
495
|
+
* SPDX-License-Identifier: MIT
|
|
496
|
+
*/
|
|
497
|
+
|
|
480
498
|
interface DecoratorAbilityOptions {
|
|
481
499
|
/**
|
|
482
500
|
* 已注册的decorator的唯一标识
|
|
@@ -494,6 +512,11 @@ interface DecoratorExtension {
|
|
|
494
512
|
component: (props: DecoratorComponentProps) => any;
|
|
495
513
|
}
|
|
496
514
|
|
|
515
|
+
/**
|
|
516
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
517
|
+
* SPDX-License-Identifier: MIT
|
|
518
|
+
*/
|
|
519
|
+
|
|
497
520
|
interface VisibilityAbilityOptions {
|
|
498
521
|
/**
|
|
499
522
|
* 是否隐藏
|
|
@@ -509,11 +532,21 @@ declare class VisibilityAbility implements FormItemAbility {
|
|
|
509
532
|
get type(): string;
|
|
510
533
|
}
|
|
511
534
|
|
|
535
|
+
/**
|
|
536
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
537
|
+
* SPDX-License-Identifier: MIT
|
|
538
|
+
*/
|
|
539
|
+
|
|
512
540
|
declare class EffectAbility implements FormItemAbility {
|
|
513
541
|
static readonly type = "effect";
|
|
514
542
|
get type(): string;
|
|
515
543
|
}
|
|
516
544
|
|
|
545
|
+
/**
|
|
546
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
547
|
+
* SPDX-License-Identifier: MIT
|
|
548
|
+
*/
|
|
549
|
+
|
|
517
550
|
interface EffectAbilityOptions {
|
|
518
551
|
/**
|
|
519
552
|
* 已注册的effect 唯一标识
|
|
@@ -546,11 +579,21 @@ interface EffectExtension {
|
|
|
546
579
|
effect: EffectFunction;
|
|
547
580
|
}
|
|
548
581
|
|
|
582
|
+
/**
|
|
583
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
584
|
+
* SPDX-License-Identifier: MIT
|
|
585
|
+
*/
|
|
586
|
+
|
|
549
587
|
declare class DefaultAbility implements FormItemAbility {
|
|
550
588
|
static readonly type = "default";
|
|
551
589
|
get type(): string;
|
|
552
590
|
}
|
|
553
591
|
|
|
592
|
+
/**
|
|
593
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
594
|
+
* SPDX-License-Identifier: MIT
|
|
595
|
+
*/
|
|
596
|
+
|
|
554
597
|
interface GetDefaultValueProps extends FormItemContext {
|
|
555
598
|
options: DefaultAbilityOptions;
|
|
556
599
|
context: FormItemMaterialContext;
|
|
@@ -559,6 +602,10 @@ interface DefaultAbilityOptions<T = any> {
|
|
|
559
602
|
getDefaultValue: (params: GetDefaultValueProps) => T;
|
|
560
603
|
}
|
|
561
604
|
|
|
605
|
+
/**
|
|
606
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
607
|
+
* SPDX-License-Identifier: MIT
|
|
608
|
+
*/
|
|
562
609
|
declare class FormPathService {
|
|
563
610
|
static readonly ROOT = "/";
|
|
564
611
|
static readonly DIVIDER = "/";
|
|
@@ -576,6 +623,11 @@ declare class FormPathService {
|
|
|
576
623
|
simplify(path: string): string;
|
|
577
624
|
}
|
|
578
625
|
|
|
626
|
+
/**
|
|
627
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
628
|
+
* SPDX-License-Identifier: MIT
|
|
629
|
+
*/
|
|
630
|
+
|
|
579
631
|
declare class FormContextMaker {
|
|
580
632
|
readonly nodeEngineContext: NodeEngineContext;
|
|
581
633
|
readonly playgroundContext: PlaygroundContext;
|
|
@@ -615,6 +667,11 @@ declare class FormManager {
|
|
|
615
667
|
protected init(): void;
|
|
616
668
|
}
|
|
617
669
|
|
|
670
|
+
/**
|
|
671
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
672
|
+
* SPDX-License-Identifier: MIT
|
|
673
|
+
*/
|
|
674
|
+
|
|
618
675
|
declare const FormContribution: unique symbol;
|
|
619
676
|
interface FormContribution {
|
|
620
677
|
onRegister?(formManager: FormManager): void;
|
|
@@ -653,6 +710,7 @@ declare class FlowNodeFormData extends EntityData {
|
|
|
653
710
|
getFormModel<TFormModel>(): TFormModel;
|
|
654
711
|
getDefaultData(): any;
|
|
655
712
|
createForm(formMetaOrFormMetaGenerator: any, initialValue?: any): void;
|
|
713
|
+
updateFormValues(value: any): void;
|
|
656
714
|
recreateForm(formMetaOrFormMetaGenerator: FormMetaOrFormMetaGenerator, initialValue?: any): void;
|
|
657
715
|
toJSON(): any;
|
|
658
716
|
dispose(): void;
|
|
@@ -663,22 +721,171 @@ declare class FlowNodeFormData extends EntityData {
|
|
|
663
721
|
fireDetaiChange(detailChangeEvent: DetailChangeEvent): void;
|
|
664
722
|
}
|
|
665
723
|
|
|
724
|
+
/**
|
|
725
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
726
|
+
* SPDX-License-Identifier: MIT
|
|
727
|
+
*/
|
|
728
|
+
|
|
666
729
|
declare function isNodeFormReady(node: FlowNodeEntity): boolean;
|
|
667
730
|
declare function getFormModel(node: FlowNodeEntity): FormModel;
|
|
668
731
|
|
|
732
|
+
/**
|
|
733
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
734
|
+
* SPDX-License-Identifier: MIT
|
|
735
|
+
*/
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* @deprecated
|
|
739
|
+
* use `NodeFormContext` instead
|
|
740
|
+
*/
|
|
741
|
+
type NodeContext = NodeFormContext;
|
|
742
|
+
type Render<T = any> = (props: T) => any;
|
|
743
|
+
type NodePluginRender = Render<NodeFormContext>;
|
|
744
|
+
type NodePlaceholderRender = Render<NodeFormContext>;
|
|
745
|
+
interface NodeRenderProps {
|
|
746
|
+
node: FlowNodeEntity;
|
|
747
|
+
}
|
|
748
|
+
type NodeRenderHoc = (Component: React.JSXElementConstructor<NodeRenderProps>) => React.JSXElementConstructor<NodeRenderProps>;
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
752
|
+
* SPDX-License-Identifier: MIT
|
|
753
|
+
*/
|
|
754
|
+
|
|
755
|
+
declare enum MaterialRenderKey {
|
|
756
|
+
CustomNodeError = "Material_CustomNodeError"
|
|
757
|
+
}
|
|
758
|
+
declare class NodeManager {
|
|
759
|
+
readonly materialRenderRegistry: Map<string, Render>;
|
|
760
|
+
readonly pluginRenderRegistry: Map<string, Render>;
|
|
761
|
+
readonly nodeRenderHocs: NodeRenderHoc[];
|
|
762
|
+
protected nodeContributions: NodeContribution[];
|
|
763
|
+
registerMaterialRender(key: string, render: Render): void;
|
|
764
|
+
getMaterialRender(key: string): Render | undefined;
|
|
765
|
+
registerPluginRender(key: string, render: NodePluginRender): void;
|
|
766
|
+
getPluginRender(key: string): NodePluginRender | undefined;
|
|
767
|
+
registerNodeErrorRender(render: Render<NodeErrorRenderProps>): void;
|
|
768
|
+
get nodeRenderHoc(): (...args: any[]) => any;
|
|
769
|
+
registerNodeRenderHoc(hoc: NodeRenderHoc): void;
|
|
770
|
+
get nodeErrorRender(): Render | undefined;
|
|
771
|
+
protected init(): void;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
776
|
+
* SPDX-License-Identifier: MIT
|
|
777
|
+
*/
|
|
778
|
+
|
|
779
|
+
declare const NodeContribution: unique symbol;
|
|
780
|
+
interface NodeContribution {
|
|
781
|
+
onRegister?(nodeManager: NodeManager): void;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
786
|
+
* SPDX-License-Identifier: MIT
|
|
787
|
+
*/
|
|
788
|
+
|
|
789
|
+
declare const NodeContainerModule: ContainerModule;
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
793
|
+
* SPDX-License-Identifier: MIT
|
|
794
|
+
*/
|
|
795
|
+
declare const PLUGIN_KEY: {
|
|
796
|
+
FORM: string;
|
|
797
|
+
ERROR: string;
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
802
|
+
* SPDX-License-Identifier: MIT
|
|
803
|
+
*/
|
|
804
|
+
declare const MATERIAL_KEY: {
|
|
805
|
+
NODE_ERROR_RENDER: string;
|
|
806
|
+
NODE_PLACEHOLDER_RENDER: string;
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
interface INodeEngineContext {
|
|
810
|
+
readonly: boolean;
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* NodeEngineContext 在 Node Engine 中为全局单例, 它的作用是让Node之间共享数据。
|
|
814
|
+
* context 分为内置context(如 readonly) 和 自定义context(业务可以按需注入)
|
|
815
|
+
*/
|
|
816
|
+
declare class NodeEngineContext {
|
|
817
|
+
static DEFAULT_READONLY: boolean;
|
|
818
|
+
static DEFAULT_JSON: {
|
|
819
|
+
readonly: boolean;
|
|
820
|
+
};
|
|
821
|
+
readonly onChangeEmitter: Emitter<NodeEngineContext>;
|
|
822
|
+
readonly onChange: _flowgram_ai_utils.Event<NodeEngineContext>;
|
|
823
|
+
private _readonly;
|
|
824
|
+
private _json;
|
|
825
|
+
get json(): INodeEngineContext;
|
|
826
|
+
get readonly(): boolean;
|
|
827
|
+
set readonly(value: boolean);
|
|
828
|
+
private fireChange;
|
|
829
|
+
private updateJSON;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
834
|
+
* SPDX-License-Identifier: MIT
|
|
835
|
+
*/
|
|
836
|
+
|
|
837
|
+
declare class NodeEngine {
|
|
838
|
+
nodeManager: NodeManager;
|
|
839
|
+
context: NodeEngineContext;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
844
|
+
* SPDX-License-Identifier: MIT
|
|
845
|
+
*/
|
|
669
846
|
declare function createNodeContainerModules(): inversify.ContainerModule[];
|
|
670
847
|
|
|
848
|
+
/**
|
|
849
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
850
|
+
* SPDX-License-Identifier: MIT
|
|
851
|
+
*/
|
|
852
|
+
|
|
671
853
|
declare const NodeRender: React.MemoExoticComponent<({ node }: NodeRenderProps) => React.JSX.Element>;
|
|
672
854
|
|
|
855
|
+
/**
|
|
856
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
857
|
+
* SPDX-License-Identifier: MIT
|
|
858
|
+
*/
|
|
859
|
+
|
|
673
860
|
declare function registerNodeErrorRender(nodeManager: NodeManager, render: Render): void;
|
|
674
861
|
declare function registerNodePlaceholderRender(nodeManager: NodeManager, render: NodePlaceholderRender): void;
|
|
675
862
|
|
|
863
|
+
/**
|
|
864
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
865
|
+
* SPDX-License-Identifier: MIT
|
|
866
|
+
*/
|
|
867
|
+
|
|
676
868
|
declare function createNodeEntityDatas(): EntityDataRegistry[];
|
|
677
869
|
|
|
870
|
+
/**
|
|
871
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
872
|
+
* SPDX-License-Identifier: MIT
|
|
873
|
+
*/
|
|
874
|
+
|
|
678
875
|
declare function useNodeEngineContext(): NodeEngineContext;
|
|
679
876
|
|
|
877
|
+
/**
|
|
878
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
879
|
+
* SPDX-License-Identifier: MIT
|
|
880
|
+
*/
|
|
881
|
+
|
|
680
882
|
declare function useFormItem(path: string): IFormItem | undefined;
|
|
681
883
|
|
|
884
|
+
/**
|
|
885
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
886
|
+
* SPDX-License-Identifier: MIT
|
|
887
|
+
*/
|
|
888
|
+
|
|
682
889
|
declare const NodeEngineReactContext: React.Context<INodeEngineContext>;
|
|
683
890
|
|
|
684
891
|
export { type AbilityClass, type DataArray, DecoratorAbility, type DecoratorAbilityOptions, type DecoratorComponentProps, type DecoratorExtension, DefaultAbility, type DefaultAbilityOptions, type DetailChangeEvent, EffectAbility, type EffectAbilityOptions, type EffectEvent, type EffectExtension, type EffectFunction, type EffectProps, ErrorContainerModule, type ErrorData, type Extension, FORM_VOID, type FeedbackStatus, type FeedbackText, FlowNodeErrorData, FlowNodeFormData, FormAbilityExtensionRegistry, FormContextMaker, FormContribution, FormCoreContainerModule, type FormDataObject, type FormDataType, type FormDataTypeName, type FormFeedback, FormItem, type FormItemAbility, type FormItemAbilityMeta, type FormItemContext, type FormItemDomRef, FormItemEventName, type FormItemFeedback, type FormItemHookParams, type FormItemHooks, type FormItemMaterialContext, FormManager, FormMeta, type FormMetaGenerator, type FormMetaGeneratorParams, type FormMetaOrFormMetaGenerator, type FormMetaTraverseParams, FormModel, FormModelEntity, FormModelFactory, type FormModelValid, FormPathService, type GetDefaultValueProps, type IFormItem, type IFormItemMeta, type IFormMeta, type IFormMetaOptions, type INodeEngineContext, type IValidateResult, MATERIAL_KEY, MaterialRenderKey, NodeContainerModule, type NodeContext, NodeContribution, NodeEngine, NodeEngineContext, NodeEngineReactContext, type NodeErrorRender, type NodeErrorRenderProps, type NodeFormContext, NodeManager, type NodePlaceholderRender, type NodePluginRender, NodeRender, type NodeRenderHoc, type NodeRenderProps, type OnFormValuesChangePayload, PLUGIN_KEY, type Render, SetterAbility, type SetterAbilityOptions, type SetterComponentProps, type SetterExtension, type SetterHoc, type SetterOrDecoratorContext, type TreeNode, ValidationAbility, type ValidationAbilityOptions, type ValidationExtension, type ValidatorFunction, type ValidatorFunctionResponse, type ValidatorProps, VisibilityAbility, type VisibilityAbilityOptions, createNodeContainerModules, createNodeEntityDatas, getFormModel, getNodeError, isNodeFormReady, registerNodeErrorRender, registerNodePlaceholderRender, useFormItem, useNodeEngineContext };
|