setupDefaults.d.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { CommafyOptions } from "./commafy"
  2. import { GetDateDiffRules } from "./getDateDiff"
  3. import { FirstDayOfWeek } from "./getWhatWeek"
  4. import { ToDateStringFormats } from "./toDateString"
  5. export interface SetupDefaults {
  6. /**
  7. * 默认树的转换配置
  8. * 用于 toArrayTree()、toTreeArray()
  9. */
  10. treeOptions?: {
  11. strict?: boolean;
  12. parentKey?: string;
  13. key?: string;
  14. children?: string;
  15. data?: string;
  16. [key: string]: any;
  17. };
  18. /**
  19. * 默认解析的日期格式
  20. * 用于 toDateString()
  21. */
  22. parseDateFormat?: string;
  23. /**
  24. * 默认格式化日期的规则
  25. * 用于 toDateString()
  26. */
  27. parseDateRules?: ToDateStringFormats;
  28. /**
  29. * 默认周视图的起始天
  30. * 用于 getWhatWeek()、getYearWeek()、toDateString()
  31. */
  32. firstDayOfWeek?: FirstDayOfWeek;
  33. /**
  34. * 默认日期差异规则配置
  35. * 用于 getDateDiff()
  36. */
  37. dateDiffRules?: GetDateDiffRules;
  38. /**
  39. * 分隔函数配置
  40. * 用于 commafy()
  41. */
  42. commafyOptions?: CommafyOptions;
  43. /**
  44. * 已被 parseDateRules 替换
  45. * @deprecated
  46. */
  47. formatStringMatchs?: any;
  48. /**
  49. * 已被 parseDateFormat 替换
  50. * @deprecated
  51. */
  52. formatString?: string;
  53. [key: string]: any;
  54. }
  55. export default SetupDefaults