import * as React from 'react'; import { ReactElement } from 'react'; import { RecursiveArray, TextStyle, ViewStyle } from 'react-native'; import { CalendarHeaderProps } from './components/CalendarHeader'; import { CalendarHeaderForMonthViewProps } from './components/CalendarHeaderForMonthView'; export interface ICalendarEventBase { start: Date; end: Date; title: string; children?: ReactElement | null; hideHours?: boolean; disabled?: boolean; /** * overlapping position of event starting from 0 (optional) */ overlapPosition?: number; /** * number of events overlapping with this event (optional) */ overlapCount?: number; } export type CalendarTouchableOpacityProps = { delayPressIn: number; key: string; style: RecursiveArray | ViewStyle; onPress: () => void; disabled: boolean; }; export type Mode = '3days' | 'week' | 'day' | 'custom' | 'month' | 'schedule'; export type EventCellStyle = ViewStyle | ViewStyle[] | ((event: T) => ViewStyle | ViewStyle[]); export type AllDayEventCellStyle = ViewStyle | ((event: T) => ViewStyle); export type CalendarCellStyle = ViewStyle | ((date?: Date, hourRowIndex?: number) => ViewStyle); export type CalendarCellTextStyle = TextStyle | ((date?: Date, hourRowIndex?: number) => TextStyle); export type WeekNum = 0 | 1 | 2 | 3 | 4 | 5 | 6; export type HasDateRange = [Date, Date]; export type DateRangeHandler = ([start, end]: HasDateRange) => void; export type HorizontalDirection = 'RIGHT' | 'LEFT'; export type EventRenderer = (event: T, touchableOpacityProps: CalendarTouchableOpacityProps) => JSX.Element; export type HeaderRenderer = React.JSXElementConstructor & { mode: Mode; }>; export type MonthHeaderRenderer = React.JSXElementConstructor; export type HourRenderer = React.JSXElementConstructor<{ ampm: boolean; hour: number; }>;