
import { PropertyType } from "./types";

export interface RootUnitItem { // 一级单元
  id: string;
  title: string;
  children: Array<UnitItem | PropertyItem>;
}

export interface UnitItem { // 二级单元项
  id: string;
  type: PropertyType.Unit;
  info: UnitInfo;
}

export interface UnitInfo {
  title: string;
  children: PropertyItem[];
}

export interface PropertyItem { // 属性项
  id: string;
  type: PropertyType;
  info: AllProperty;
}

export type AllProperty = InputInfo | SelectInfo | DateInfo | ImageInfo;

export interface InputInfo extends PropertyItem {
  label: string;
  type: PropertyType.Input;
  value: string;
}


export interface SelectInfo {
  label: string;
  value: string;
  options: string[];
}

export interface Option {
  id: string;
  label: string;
}

export interface DateInfo {
  label: string;
  value: string;
}

export interface ImageInfo {
  label: string;
  imgList: ImageItem[];
}

export interface ImageItem {
  url: string;
  dataUrl: string;
  file: File | null;
}


