calendar.d.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import { EpPropFinalized } from "../../../utils/vue/props/types.js";
  2. import * as _$vue from "vue";
  3. import { ExtractPublicPropTypes } from "vue";
  4. //#region ../../packages/components/calendar/src/calendar.d.ts
  5. type CalendarDateType = 'prev-month' | 'next-month' | 'prev-year' | 'next-year' | 'today';
  6. interface CalendarProps {
  7. /**
  8. * @description binding value
  9. */
  10. modelValue?: Date;
  11. /**
  12. * @description time range, including start time and end time.
  13. * Start time must be start day of week, end time must be end day of week, the time span cannot exceed two months.
  14. */
  15. range?: [Date, Date];
  16. /**
  17. * @description type of the controller for the Calendar header
  18. */
  19. controllerType?: 'button' | 'select';
  20. /**
  21. * @description format label when `controller-type` is 'select'
  22. */
  23. formatter?: (value: number, type: 'year' | 'month') => string | number;
  24. }
  25. /**
  26. * @deprecated Removed after 3.0.0, Use `CalendarProps` instead.
  27. */
  28. declare const calendarProps: {
  29. readonly modelValue: {
  30. readonly type: _$vue.PropType<Date>;
  31. readonly required: false;
  32. readonly validator: ((val: unknown) => boolean) | undefined;
  33. __epPropKey: true;
  34. };
  35. readonly range: {
  36. readonly type: _$vue.PropType<[Date, Date]>;
  37. readonly required: false;
  38. readonly validator: ((val: unknown) => boolean) | undefined;
  39. __epPropKey: true;
  40. };
  41. readonly controllerType: EpPropFinalized<StringConstructor, "button" | "select", unknown, "button", boolean>;
  42. readonly formatter: {
  43. readonly type: _$vue.PropType<(value: number, type: "year" | "month") => string | number>;
  44. readonly required: false;
  45. readonly validator: ((val: unknown) => boolean) | undefined;
  46. __epPropKey: true;
  47. };
  48. };
  49. /**
  50. * @deprecated Removed after 3.0.0, Use `CalendarProps` instead.
  51. */
  52. type CalendarPropsPublic = ExtractPublicPropTypes<typeof calendarProps>;
  53. declare const calendarEmits: {
  54. "update:modelValue": (value: Date) => boolean;
  55. input: (value: Date) => boolean;
  56. };
  57. type CalendarEmits = typeof calendarEmits;
  58. //#endregion
  59. export { CalendarDateType, CalendarEmits, CalendarProps, CalendarPropsPublic, calendarEmits, calendarProps };