types.ts 2.0 KB

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