This repository has been archived on 2025-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
lcm-potty-chart/types/CalenderContext.d.ts
2022-01-07 10:49:32 -06:00

83 lines
1.2 KiB
TypeScript

type Days =
| "Sunday"
| "Monday"
| "Tuesday"
| "Wednesday"
| "Thursday"
| "Friday"
| "Saturday";
type DaysOfWeek = Days[];
interface WeekDays {
sunday: DaysOfWeek;
monday: DaysOfWeek;
}
type StickerVal = -2 | -1 | 0 | 1 | 2 | null;
interface Sticker {
date: Date;
sticker: StickerVal;
}
type StickerDays = Sticker[];
interface MonthSticker {
date: Date;
month: Sticker[];
}
interface MonthDay extends Sticker {
isOverflow: boolean;
overflowDirection: "prev" | "next" | null;
}
interface Month {
week1: MonthDay[];
week2: MonthDay[];
week3: MonthDay[];
week4: MonthDay[];
week5: MonthDay[];
week6: MonthDay[];
}
interface MonthInfo {
date: Date;
title: string;
}
interface MonthLayout {
sunday: {
weekdays: DaysOfWeek;
month: Month;
};
monday: {
weekdays: DaysOfWeek;
month: Month;
};
}
interface MonthContext extends MonthInfo {
layout: MonthLayout;
}
interface UpdateCalendarProps {
year: number;
month: number;
day: number;
}
interface UpdateCalendarProps {
year: number;
month: number;
day: number;
}
interface CalenderContextState {
selectedDate: Date;
title: string;
layout: MonthLayout;
updateDate: (input: UpdateCalendarProps) => void;
}