UNPKG

dingtalk-docs-cool-app

Version:

钉钉文档酷应用插件扩展 开发者初始化包

75 lines (74 loc) 1.74 kB
import { FieldType } from './field'; export declare const enum FormItemComponent { SingleSelect = "SingleSelect", MultiSelect = "MultiSelect", Textarea = "Textarea", Radio = "Radio", FieldSelect = "FieldSelect", TableSelect = "TableSelect" } interface SingleSelect { component: FormItemComponent.SingleSelect; props: { placeholder?: string; options: Array<{ key: string; title: string; }>; defaultValue?: string; }; } interface MultiSelect { component: FormItemComponent.MultiSelect; props: { placeholder?: string; options: Array<{ key: string; title: string; }>; defaultValue?: string[]; }; } interface Textarea { component: FormItemComponent.Textarea; props: { placeholder?: string; enableFieldReference?: boolean; }; } interface Radio { component: FormItemComponent.Radio; props: { defaultValue?: string; options: Array<{ label: string; value: string; }>; }; } interface FieldSelect { component: FormItemComponent.FieldSelect; props: { mode?: 'single' | 'multiple'; supportTypes?: FieldType[]; }; } interface TableSelect { component: FormItemComponent.TableSelect; props: { mode?: 'single' | 'multiple'; placeholder?: string; }; } type FormItemComponentType = SingleSelect | MultiSelect | Textarea | Radio | FieldSelect | TableSelect; export type FormItem = { key: string; label: string; validator?: { required?: boolean; }; tooltips?: { title?: string; }; } & FormItemComponentType; export {};