mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
fix: fix type name conflict
This commit is contained in:
parent
de59756c57
commit
ff1b637010
@ -1,6 +1,6 @@
|
||||
import {
|
||||
DataEvent,
|
||||
EffectProps,
|
||||
EffectFuncProps,
|
||||
Field,
|
||||
FieldRenderProps,
|
||||
FormMeta,
|
||||
@ -58,7 +58,7 @@ const formMeta: FormMeta<FormData> = {
|
||||
field1: [
|
||||
{
|
||||
event: DataEvent.onValueChange,
|
||||
effect: ({ value }: EffectProps<string, FormData>) => {
|
||||
effect: ({ value }: EffectFuncProps<string, FormData>) => {
|
||||
console.log('field1 value:', value);
|
||||
},
|
||||
},
|
||||
@ -66,7 +66,7 @@ const formMeta: FormMeta<FormData> = {
|
||||
field2: [
|
||||
{
|
||||
event: DataEvent.onValueChange,
|
||||
effect: ({ value, form }: EffectProps<string, FormData>) => {
|
||||
effect: ({ value, form }: EffectFuncProps<string, FormData>) => {
|
||||
form.setValueIn('field3', 'field2 value is ' + value);
|
||||
},
|
||||
},
|
||||
|
||||
@ -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<FormData> = {
|
||||
field1: [
|
||||
{
|
||||
event: DataEvent.onValueChange,
|
||||
effect: ({ value }: EffectProps<string, FormData>) => {
|
||||
effect: ({ value }: EffectFuncProps<string, FormData>) => {
|
||||
console.log('field1 value:', value);
|
||||
},
|
||||
},
|
||||
@ -78,7 +78,7 @@ const formMeta: FormMeta<FormData> = {
|
||||
field2: [
|
||||
{
|
||||
event: DataEvent.onValueChange,
|
||||
effect: ({ value, form }: EffectProps<string, FormData>) => {
|
||||
effect: ({ value, form }: EffectFuncProps<string, FormData>) => {
|
||||
form.setValueIn('field3', 'field2 value is ' + value);
|
||||
},
|
||||
},
|
||||
|
||||
@ -51,7 +51,7 @@ export enum DataEvent {
|
||||
|
||||
export type EffectReturn = () => void;
|
||||
|
||||
export interface EffectProps<TFieldValue = any, TFormValues = any> {
|
||||
export interface EffectFuncProps<TFieldValue = any, TFormValues = any> {
|
||||
name: FieldName;
|
||||
value: TFieldValue;
|
||||
prevValue?: TFieldValue;
|
||||
@ -61,7 +61,7 @@ export interface EffectProps<TFieldValue = any, TFormValues = any> {
|
||||
}
|
||||
|
||||
export type Effect<TFieldValue = any, TFormValues = any> = (
|
||||
props: EffectProps<TFieldValue, TFormValues>
|
||||
props: EffectFuncProps<TFieldValue, TFormValues>
|
||||
) => void | EffectReturn;
|
||||
|
||||
export type ArrayAppendEffect<TFieldValue = any, TFormValues = any> = (props: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user