types.d.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. export interface PlainObject {
  2. [propsName: string]: any;
  3. }
  4. export interface VJson {
  5. [propName: string]: any;
  6. }
  7. export interface Model {
  8. success: boolean;
  9. msg: string;
  10. data: any;
  11. }
  12. /**
  13. * 处理 VJson 的
  14. * @param this 是指 scope 对象
  15. * @param vjson 是待处理的 VJson 对象
  16. * @result 返回处理 VJson 的 Promise 异步结果
  17. */
  18. export declare type ConfigProcess = (me: any, config: any) => any;
  19. /**
  20. * 参数的填写类型
  21. * module 选择一个功能模块
  22. * viewModel 从当前模块的 model 中,选择一个属性
  23. * refs 从当前模块的 refs 中选一个控件
  24. * event 当成事件输入框来填写
  25. * lookup 填写 lookup 表达式对象
  26. * ()=> Promise<string[], <id:string,value:string>[]> 函数的返回结果,作为填写范围
  27. * string 任意字符串
  28. * object 任意对象 (JSON5)
  29. */
  30. export declare type LibParamType = 'module' | 'viewModel' | 'refs' | 'event' | 'lookup' | 'string' | 'object' | (() => Promise<string[] | {
  31. id: string;
  32. value: string;
  33. }[]>);
  34. /**
  35. * 注册函数中的参数
  36. */
  37. export interface FunctionArgument {
  38. /**
  39. * 参数值存放的内容(类型)
  40. * module 选择一个功能模块
  41. * control 从当前模块的 controller 中选择一个方法
  42. * viewModel 从当前模块的 model 中,选择一个属性
  43. * refs 从当前模块的 refs 中选一个控件
  44. * event 当成事件输入框来填写
  45. * string 任意字符串
  46. * object 任意对象 (JSON5)
  47. */
  48. type: LibParamType;
  49. /**
  50. * 参数中文说明
  51. */
  52. title: string;
  53. /**
  54. * 参数名称
  55. */
  56. name: string;
  57. /**
  58. * 是否允许为空
  59. */
  60. allowEmpty?: boolean;
  61. /**
  62. * 过滤器
  63. * @param list
  64. */
  65. filter?: (items: any[]) => any[];
  66. }
  67. /**
  68. * 注册函数, 用在 @Lib 装饰器
  69. */
  70. export interface FunctionRegiste {
  71. /**
  72. * 函数名
  73. */
  74. name?: string;
  75. /**
  76. * 中文说明
  77. */
  78. title?: string;
  79. /**
  80. * 作者
  81. */
  82. author?: string;
  83. /**
  84. * 创建时间
  85. */
  86. createAt?: string;
  87. /**
  88. * 更新时间
  89. */
  90. updateAt?: string;
  91. /**
  92. * 备注
  93. */
  94. remark?: string;
  95. /**
  96. * 类型
  97. * system: 系统方法
  98. * format: 格式化作用
  99. */
  100. type: 'system' | 'format';
  101. /**
  102. * 分类名称
  103. */
  104. category?: string;
  105. /**
  106. * 文档链接
  107. */
  108. link?: string;
  109. /**
  110. * 方法体
  111. */
  112. target?: Function;
  113. }