lib.test.d.ts 732 B

1234567891011121314151617181920212223242526272829303132333435
  1. declare const enum LibTestType {
  2. empty,
  3. mobile,
  4. }
  5. interface LibTestOption {
  6. handle:Record<string, (value:any)=>boolean>,
  7. verification:(data:LibDataArray | LibData,toast?:boolean|string)=>LibTestItemResult,
  8. verificationPromise:(data:LibDataArray | LibData,toast?:boolean|string)=>Promise<Record<string, Record<string, any>>>,
  9. verificationItem:(data:LibData,toast?:boolean|string)=>any,
  10. }
  11. type LibTestOptions = {
  12. [key in LibTestType]:(value:any,option:LibData)=> boolean
  13. } & LibTestOption
  14. interface LibTestItemResult {
  15. // 是否验证通过
  16. verification: boolean,
  17. // 值 验证不通过 value 为 message
  18. value:any,
  19. // 校验不通过的类型
  20. type?: LibTestType
  21. }