mobile-react-infinite-calendar
Version:
A mobile-optimized infinite scroll calendar component for React
88 lines (87 loc) • 2.42 kB
TypeScript
interface CalendarEventDisplay {
date: string;
title?: string;
color?: string;
id?: string;
}
export interface CalendarEvent<T = any> extends CalendarEventDisplay {
originalData?: T;
}
export interface SimpleCalendarEvent extends CalendarEventDisplay {
}
export interface DetailedCalendarEvent extends CalendarEventDisplay {
id: string;
title: string;
startTime: string;
endTime: string;
description?: string;
metadata?: Record<string, any>;
}
export interface Holiday {
id?: string;
name: string;
date: string;
color?: string;
}
export type ViewMode = 'day' | 'week' | 'month';
export type LocaleCode = 'ko-KR' | 'en-US' | 'ja-JP' | 'zh-CN' | 'en-GB' | 'de-DE' | 'fr-FR' | 'it-IT' | 'es-ES' | 'ko' | 'en' | 'ja' | 'zh' | 'de' | 'fr' | 'it' | 'es';
export interface ColorScheme {
primary?: string;
secondary?: string;
accent?: string;
background?: string;
text?: string;
border?: string;
}
export type Theme = 'light' | 'dark' | 'custom';
export interface HeaderDisplayOptions {
show?: boolean;
monthTitle?: boolean;
todayButton?: boolean;
weekDays?: boolean;
datePicker?: boolean;
}
export interface ClassNameOptions {
container?: string;
header?: string;
monthTitle?: string;
weekDay?: string;
dayCell?: string;
todayButton?: string;
datePickerOverlay?: string;
}
export interface AutoHeightOptions {
topOffset?: number;
bottomOffset?: number;
minHeight?: number;
maxHeight?: number;
}
export interface DebugOptions {
enabled?: boolean;
level?: 'error' | 'warn' | 'info' | 'debug';
showPerformance?: boolean;
}
export interface CalendarOptions {
header?: boolean | HeaderDisplayOptions;
classNames?: ClassNameOptions;
height?: number | 'auto' | string;
autoHeight?: AutoHeightOptions;
debug?: boolean | DebugOptions;
disableHolidays?: boolean;
initialDate?: Date;
}
export interface InfiniteCalendarProps {
events?: CalendarEvent[];
holidays?: Holiday[];
onDateClick?: (date: Date, events: CalendarEvent[]) => void;
locale?: LocaleCode | string;
holidayServiceKey?: string;
options?: CalendarOptions;
showTodayButton?: boolean;
showDatePicker?: boolean;
height?: number | 'auto';
initialDate?: Date;
}
export type Reservation = CalendarEvent;
export type Event = CalendarEvent;
export {};