types.ts 1.9 KB

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