PropertyDescription.d.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. export declare type GroupType = 'css' | 'data' | 'bind' | 'common' | 'listeners' | 'fix';
  2. export interface PropertyValue {
  3. /**
  4. * 属性名
  5. */
  6. name: string;
  7. /**
  8. * 默认值
  9. */
  10. default: any;
  11. /**
  12. * 隶属分组
  13. */
  14. group: GroupType;
  15. /**
  16. * 描述
  17. */
  18. desc: string;
  19. /**
  20. * 取值范围
  21. */
  22. type: 'boolean' | 'number' | 'string' | 'object' | 'dataSource' | 'valid' | 'format' | Array<string> | 'widget' | 'listeners' | 'fix';
  23. eventParamter?: string[];
  24. eventResult?: string;
  25. eventDoc?: (vjson: any) => string;
  26. expr?: boolean;
  27. }
  28. export interface EventValue {
  29. /**
  30. * 属性名
  31. */
  32. name: string;
  33. /**
  34. * 描述
  35. */
  36. desc: string;
  37. }
  38. export interface PropertyDescriptionInterface {
  39. props: PropertyValue[];
  40. events?: EventValue[];
  41. }
  42. export declare class PropertyDescription {
  43. propertyes: PropertyDescriptionInterface;
  44. constructor(...args: PropertyDescriptionInterface[]);
  45. merge(pd: PropertyDescriptionInterface): void;
  46. /**
  47. * 根据分组名 获取属性定义
  48. */
  49. getPropsByGroup(name: GroupType): PropertyValue[];
  50. /**
  51. * 获取全部事件
  52. */
  53. getEvents(): EventValue[];
  54. }