import { NamedExoticComponent } from 'react'; import { FlatListProps, ViewabilityConfig } from 'react-native'; import { CalendarDate, CalendarItem, CalendarTheme, Locale, MarkedDate, MarkedDates } from './types'; /** * Day related types */ export declare type DayComponentProps = CalendarDate & MarkedDate & { listWidth: number; onPress?: (date: Omit) => void; theme?: CalendarTheme['day']; pastDay: boolean; today: boolean; }; /** * Week related types */ export declare type WeekComponentProps = { Day: NamedExoticComponent; listWidth: number; dayTheme?: CalendarTheme['day']; markedDates?: MarkedDates; onDayPress?: (date: Omit) => void; theme?: CalendarTheme['week']; week: Array; }; /** * Month related types */ export declare type MonthComponentProps = { Day: NamedExoticComponent; DayNames: NamedExoticComponent; MonthTitle: NamedExoticComponent; Week: NamedExoticComponent; calendarKey: string; dates: Array; firstDay: BinaryBoolean; hideExtraDays: boolean; horizontal?: boolean; index: number; listWidth: number; locales: Locale; month: string; markedDates?: MarkedDates; months: Array; onDayPress?: (date: Omit) => void; theme?: CalendarTheme; }; export declare type DayNamesComponentProps = { dayNames: Array; theme?: CalendarTheme['dayNames']; }; export declare type MonthTitleComponentProps = { theme?: CalendarTheme['monthTitle']; title: string; }; export declare type ArrowsComponentProps = { leftArrowDisabled: boolean; listWidth: number; onArrowPress: (direction: 'left' | 'right') => void; rightArrowDisabled: boolean; }; declare type PickedFlatListProps = 'initialNumToRender' | 'maxToRenderPerBatch' | 'removeClippedSubviews' | 'updateCellsBatchingPeriod' | 'windowSize' | 'showsHorizontalScrollIndicator' | 'showsVerticalScrollIndicator' | 'snapToAlignment' | 'snapToInterval' | 'snapToOffsets' | 'snapToStart' | 'snapToEnd' | 'onScroll' | 'onScrollBeginDrag' | 'onScrollEndDrag' | 'onMomentumScrollEnd' | 'onMomentumScrollBegin'; export declare type CalendarProps = Pick, PickedFlatListProps> & { /** * Starting date for calendar. i.e. 2020-01-01. */ startISODate: string; /** * Ending date for calendar. i.e. 2020-12-31. */ endISODate: string; /** * Day to which calendar is initially scrolled. Default is today. */ currentDay?: string; /** * Key string which exists in Locales object. */ locale?: string; /** * Height of calendar view. */ calendarHeight?: number; /** * First day of calendar. 0 means Sunday, 1 means Monday. */ firstDay?: BinaryBoolean; /** * Hides days from previous / next month in first / last week. Default `true`. */ hideExtraDays?: boolean; /** * Hides arrows for switching month (only works with `horizontal` prop on true). Default `true`. */ hideArrows?: boolean; /** * If true, renders calendar horizontally. Additionally, adds `pagingEnabled` to FlatList. */ horizontal?: boolean; /** * Defines if Calendar can be scrolled. Default `true`. */ scrollEnabled?: boolean; /** * Callback after day is pressed. * * @param {Object} date * @param {number} date.day Day number of month. * @param {number} date.month Month number of year (from 0 to 11). * @param {number} date.year Year. * @param {number} date.dayString Date. (YYYY-MM-DD). */ onDayPress?: (date: Omit) => void; /** * Gets called when the user clicks on the button * * @param {'left' | 'right'} direction Direction in which calendar will move. * @param {number} currentMonthIndex Index of current visible month. * @param {number} lastMonthIndex Index of last month generated. */ onArrowPress?: (params: { direction: 'left' | 'right'; currentMonthIndex: number; lastMonthIndex: number; }) => void; /** * Style object passed to main component (FlatList). */ style?: FixMe; /** * ViewabilityConfig passed to FlatList. * See React-Native docs of VirtualizedList for reference. */ viewabilityConfig?: ViewabilityConfig; /** * TODO * * @ignore */ markedDates?: MarkedDates; /** * TODO * * @ignore */ theme?: CalendarTheme; ArrowsComponent?: NamedExoticComponent; DayComponent?: NamedExoticComponent; DayNamesComponent?: NamedExoticComponent; MonthTitleComponent?: NamedExoticComponent; WeekComponent?: NamedExoticComponent; }; export {};