types.d.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. export type errMessage = string | undefined;
  2. export type checkFields = Array<string | RegExp>;
  3. export interface checkRule {
  4. type?: string;
  5. min?: number;
  6. max?: number;
  7. length?: number;
  8. regex?: RegExp;
  9. message?: errMessage;
  10. require?: boolean;
  11. minLength?: number;
  12. maxLength?: number;
  13. validator?: validatorFunction;
  14. }
  15. export interface ruleItem {
  16. name: string;
  17. checkFields: checkFields;
  18. rules: Array<validatorFunction | checkRule>;
  19. }
  20. export interface validatorFunction {
  21. (value: any): string | null;
  22. }
  23. export declare enum checkCode {
  24. code_pass = 1,
  25. code_notPass = 2,
  26. code_notMatch = 3
  27. }
  28. export interface formOption {
  29. key: string;
  30. value: string;
  31. disabled?: boolean;
  32. checkField?: string;
  33. }
  34. export interface FormVerifyOption {
  35. isMustMatchRule: boolean;
  36. }
  37. export interface formItemData {
  38. val?: string;
  39. msg?: string;
  40. state?: number;
  41. showText?: string;
  42. label?: string;
  43. init?: string;
  44. options?: formOption[];
  45. depend?: string;
  46. reCheckField?: string;
  47. disables?: string[];
  48. [key: string]: any;
  49. }
  50. /**
  51. * 表单数据对象
  52. * object 表单数据对象
  53. */
  54. export interface formObject {
  55. [key: string]: formItemData;
  56. }
  57. export interface formOption {
  58. isMustMatchRule?: boolean;
  59. [key: string]: any;
  60. }
  61. export interface verifyForm {
  62. [key: string]: any;
  63. }
  64. //# sourceMappingURL=types.d.ts.map