index.d.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { Component } from '@/router/types'
  2. // 组件配置
  3. export type ConfigType = {
  4. key: string
  5. title: string
  6. category: string
  7. categoryName: string
  8. package: string
  9. node: Component
  10. image: string | (() => Promise<typeof import('*.png')>)
  11. }
  12. // 组件实例类
  13. export interface PublicConfigType {
  14. id: string
  15. rename?: string
  16. attr: { x: number; y: number; w: number; h: number; zIndex: number }
  17. setPosition: Function
  18. }
  19. export interface CreateComponentType extends PublicConfigType {
  20. key: string
  21. chartConfig: Omit<ConfigType, 'node'>
  22. option: object
  23. }
  24. // 包分类枚举
  25. export enum PackagesCategoryEnum {
  26. CHARTS = 'Charts',
  27. TABLES = 'Tables',
  28. INFORMATION = 'Informations',
  29. DECORATES = 'Decorates'
  30. }
  31. // 包分类名称
  32. export enum PackagesCategoryName {
  33. CHARTS = '图表',
  34. TABLES = '表格',
  35. INFORMATION = '信息',
  36. DECORATES = '小组件'
  37. }
  38. // 图表包类型
  39. export type PackagesType = {
  40. [PackagesCategoryEnum.CHARTS]: ConfigType[]
  41. [PackagesCategoryEnum.INFORMATION]: ConfigType[]
  42. [PackagesCategoryEnum.TABLES]: ConfigType[]
  43. [PackagesCategoryEnum.DECORATES]: ConfigType[]
  44. }