mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
fix: 修复类型问题 & 增加类型导出 (#116)
This commit is contained in:
parent
b58bb43bcf
commit
05b287f3f8
@ -11,7 +11,7 @@ import { FieldArrayModel } from './field-array-model';
|
|||||||
// parentContainer?: interfaces.Container;
|
// parentContainer?: interfaces.Container;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
type CreateFormOptions = FormOptions & {
|
export type CreateFormOptions<T = any> = FormOptions<T> & {
|
||||||
/**
|
/**
|
||||||
* 为 true 时,createForm 不会对form 初始化, 用户需要手动调用 control.init()
|
* 为 true 时,createForm 不会对form 初始化, 用户需要手动调用 control.init()
|
||||||
* 该配置主要为了解决,用户需要去监听一些form 的初始化事件,那么他需要再配置完监听后再初始化。
|
* 该配置主要为了解决,用户需要去监听一些form 的初始化事件,那么他需要再配置完监听后再初始化。
|
||||||
@ -20,7 +20,9 @@ type CreateFormOptions = FormOptions & {
|
|||||||
disableAutoInit?: boolean;
|
disableAutoInit?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createForm<TValues>(options?: CreateFormOptions): CreateFormReturn<TValues> {
|
export function createForm<TValues>(
|
||||||
|
options?: CreateFormOptions<TValues>
|
||||||
|
): CreateFormReturn<TValues> {
|
||||||
const { disableAutoInit = false, ...formOptions } = options || {};
|
const { disableAutoInit = false, ...formOptions } = options || {};
|
||||||
const formModel = new FormModel();
|
const formModel = new FormModel();
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
export { FormModel } from './form-model';
|
export { FormModel } from './form-model';
|
||||||
export { createForm } from './create-form';
|
export { createForm, type CreateFormOptions } from './create-form';
|
||||||
export { FieldModel } from './field-model';
|
export { FieldModel } from './field-model';
|
||||||
export { FieldArrayModel } from './field-array-model';
|
export { FieldArrayModel } from './field-array-model';
|
||||||
|
|
||||||
|
|||||||
@ -16,10 +16,10 @@ export type {
|
|||||||
Field as IField,
|
Field as IField,
|
||||||
Form as IForm,
|
Form as IForm,
|
||||||
Errors,
|
Errors,
|
||||||
Warnings
|
Warnings,
|
||||||
} from './types';
|
} from './types';
|
||||||
|
|
||||||
export { ValidateTrigger } from './types';
|
export { ValidateTrigger } from './types';
|
||||||
export { createForm } from './core/create-form';
|
export { createForm, type CreateFormOptions } from './core/create-form';
|
||||||
export { Glob } from './utils';
|
export { Glob } from './utils';
|
||||||
export * from './core';
|
export * from './core';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user