diff --git a/apps/docs/components/node-form/effect/node-registry.tsx b/apps/docs/components/node-form/effect/node-registry.tsx index feabcfd5..004f0d73 100644 --- a/apps/docs/components/node-form/effect/node-registry.tsx +++ b/apps/docs/components/node-form/effect/node-registry.tsx @@ -1,6 +1,6 @@ import { DataEvent, - EffectProps, + EffectFuncProps, Field, FieldRenderProps, FormMeta, @@ -58,7 +58,7 @@ const formMeta: FormMeta = { field1: [ { event: DataEvent.onValueChange, - effect: ({ value }: EffectProps) => { + effect: ({ value }: EffectFuncProps) => { console.log('field1 value:', value); }, }, @@ -66,7 +66,7 @@ const formMeta: FormMeta = { field2: [ { event: DataEvent.onValueChange, - effect: ({ value, form }: EffectProps) => { + effect: ({ value, form }: EffectFuncProps) => { form.setValueIn('field3', 'field2 value is ' + value); }, }, diff --git a/apps/docs/components/node-form/effect/preview.tsx b/apps/docs/components/node-form/effect/preview.tsx index 3f00445f..45b02e60 100644 --- a/apps/docs/components/node-form/effect/preview.tsx +++ b/apps/docs/components/node-form/effect/preview.tsx @@ -12,7 +12,7 @@ import { nodeRegistry } from './node-registry.tsx'; const nodeRegistryFile = { code: `import { DataEvent, - EffectProps, + EffectFuncProps, Field, FieldRenderProps, FormMeta, @@ -70,7 +70,7 @@ const formMeta: FormMeta = { field1: [ { event: DataEvent.onValueChange, - effect: ({ value }: EffectProps) => { + effect: ({ value }: EffectFuncProps) => { console.log('field1 value:', value); }, }, @@ -78,7 +78,7 @@ const formMeta: FormMeta = { field2: [ { event: DataEvent.onValueChange, - effect: ({ value, form }: EffectProps) => { + effect: ({ value, form }: EffectFuncProps) => { form.setValueIn('field3', 'field2 value is ' + value); }, }, diff --git a/packages/node-engine/node/src/types.ts b/packages/node-engine/node/src/types.ts index 971ffd9b..e7fcf474 100644 --- a/packages/node-engine/node/src/types.ts +++ b/packages/node-engine/node/src/types.ts @@ -51,7 +51,7 @@ export enum DataEvent { export type EffectReturn = () => void; -export interface EffectProps { +export interface EffectFuncProps { name: FieldName; value: TFieldValue; prevValue?: TFieldValue; @@ -61,7 +61,7 @@ export interface EffectProps { } export type Effect = ( - props: EffectProps + props: EffectFuncProps ) => void | EffectReturn; export type ArrayAppendEffect = (props: {