ant-design/components/calendar/index.ts
二货爱吃白萝卜 308f486d58
feat: DatePicker & Calendar export generate function directly (#41773)
* feat: DatePicker.gen support

* test: update snapshot

* docs: update docs
2023-04-12 17:20:08 +08:00

16 lines
506 B
TypeScript

import type { Dayjs } from 'dayjs';
import dayjsGenerateConfig from 'rc-picker/lib/generate/dayjs';
import type { CalendarProps } from './generateCalendar';
import generateCalendar from './generateCalendar';
const Calendar = generateCalendar<Dayjs>(dayjsGenerateConfig);
export type CalendarType = typeof Calendar & {
generateCalendar: typeof generateCalendar;
};
(Calendar as CalendarType).generateCalendar = generateCalendar;
export type { CalendarProps };
export default Calendar as CalendarType;