From 5076fdc812e402da9c5346751344a3bcd0a45260 Mon Sep 17 00:00:00 2001 From: Fabian Meul Date: Fri, 26 Oct 2018 13:57:35 +0200 Subject: [PATCH] fix: Updated react-native-calendars typings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added “selected” as a Calendar Prop * Added support for theming by themeId. --- types/react-native-calendars/index.d.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/types/react-native-calendars/index.d.ts b/types/react-native-calendars/index.d.ts index 647e64c0f2..20adae432a 100644 --- a/types/react-native-calendars/index.d.ts +++ b/types/react-native-calendars/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/wix/react-native-calendars#readme // Definitions by: Tyler Zhang // David Noreña +// Fabian Meul // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -23,6 +24,10 @@ export interface CalendarDot { selectedDotColor?: string; } +export interface CalendarThemeIdStyle { + [themeId: string]: ViewStyle; +} + export interface CalendarTheme { arrowColor?: string; backgroundColor?: string; @@ -43,6 +48,17 @@ export interface CalendarTheme { textMonthFontSize?: number; textSectionTitleColor?: string; todayTextColor?: string; + + // Theme ID's to style for + "stylesheet.calendar.header"?: CalendarThemeIdStyle; + "stylesheet.calendar.main"?: CalendarThemeIdStyle; + "stylesheet.calendar-list.main"?: CalendarThemeIdStyle; + "stylesheet.agenda.main"?: CalendarThemeIdStyle; + "stylesheet.agenda.list"?: CalendarThemeIdStyle; + "stylesheet.day.basic"?: CalendarThemeIdStyle; + "stylesheet.day.single"?: CalendarThemeIdStyle; + "stylesheet.day.multiDot"?: CalendarThemeIdStyle; + "stylesheet.day.period"?: CalendarThemeIdStyle; } export type DateCallbackHandler = (date: DateObject) => void; @@ -319,6 +335,11 @@ export interface CalendarListBaseProps extends CalendarBaseProps { * Enable or disable vertical scroll indicator. Default = false */ showScrollIndicator?: boolean; + + /** + * Initially selected day + */ + selected?: string; } export class CalendarList extends React.Component { }