import type { ComponentType } from '../jsx'; import type { Item, ItemOptions } from './items'; import type { Structure, StructureOptions } from './structures'; import { TitleOptions } from './title'; export interface DesignOptions { /** 结构 */ structure?: string | WithType; /** 标题 */ title?: string | WithType; /** 数据项 */ item?: string | WithType; /** 针对层级布局,不同层级使用不同 item */ items?: (string | WithType)[]; } export interface ParsedDesignsOptions { structure: WithProps; title: { component: ComponentType | null; }; item: WithProps; items: WithProps[]; } export interface NullableParsedDesignsOptions { structure: WithProps | null; title: { component: ComponentType | null; }; item: WithProps | null; items: (WithProps | null)[]; } type WithType = T & { type: string }; type WithProps = T & { props?: P };