From 6bf30fe9d2dfcb20c988797d451beebd79cfb1d6 Mon Sep 17 00:00:00 2001 From: Jeremy Valentine <38669521+valentine195@users.noreply.github.com> Date: Tue, 20 Feb 2024 15:33:55 -0500 Subject: [PATCH] chore: typings --- src/calendar/ui/Day/Day.svelte | 11 +++++++---- src/schemas/calendar/moons.ts | 2 +- src/stores/cache/moon-cache.ts | 2 +- src/stores/calendar.store.ts | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/calendar/ui/Day/Day.svelte b/src/calendar/ui/Day/Day.svelte index 103f19a..19cb616 100644 --- a/src/calendar/ui/Day/Day.svelte +++ b/src/calendar/ui/Day/Day.svelte @@ -3,11 +3,12 @@ import { getTypedContext } from "../../view"; import Dots from "../Events/Dots.svelte"; import { Menu, TFile } from "obsidian"; - import type { DayOrLeapDay, CalEvent } from "src/@types"; + import type { CalEvent } from "src/@types"; import Moon from "../Moon.svelte"; import { ViewState } from "src/stores/calendar.store"; import Flags from "../Events/Flags.svelte"; import { addEventWithModal } from "src/settings/modals/event/event"; + import type { DayOrLeapDay } from "src/schemas/calendar/timespans"; export let month: MonthStore; export let day: DayOrLeapDay; @@ -81,7 +82,7 @@ month: $index, year: year.year, }); - }) + }), ); let notes: { event: CalEvent; file: TFile }[] = []; for (const event of $events) { @@ -98,7 +99,7 @@ menu.addItem((item) => item.setTitle(`Open ${event.name}`).onClick(() => { app.workspace.getLeaf().openFile(file); - }) + }), ); } } @@ -167,7 +168,9 @@ padding: 4px; position: relative; text-align: center; - transition: background-color 0.1s ease-in, color 0.1s ease-in; + transition: + background-color 0.1s ease-in, + color 0.1s ease-in; vertical-align: baseline; display: flex; flex-flow: column nowrap; diff --git a/src/schemas/calendar/moons.ts b/src/schemas/calendar/moons.ts index 6901c8c..53a96bd 100644 --- a/src/schemas/calendar/moons.ts +++ b/src/schemas/calendar/moons.ts @@ -53,5 +53,5 @@ export type Phase = | "New Moon Risen"; export type MoonState = Moon & { - phase: Phase; + phase: Phase | undefined; }; diff --git a/src/stores/cache/moon-cache.ts b/src/stores/cache/moon-cache.ts index 6ba6afc..0467081 100644 --- a/src/stores/cache/moon-cache.ts +++ b/src/stores/cache/moon-cache.ts @@ -1,9 +1,9 @@ -import type { MoonState } from "src/@types"; import { DayCache, EntityCache, MonthCache, YearCache } from "./entity-cache"; import { type Readable, get } from "svelte/store"; import { YearStoreCache } from "../years.store"; import { MOON_PHASES } from "src/utils/constants"; import { wrap } from "src/utils/functions"; +import type { MoonState } from "src/schemas/calendar/moons"; class YearMoonCache extends YearCache { update(moons: MoonState[]) { diff --git a/src/stores/calendar.store.ts b/src/stores/calendar.store.ts index 6f26d0e..7027227 100644 --- a/src/stores/calendar.store.ts +++ b/src/stores/calendar.store.ts @@ -1,7 +1,6 @@ import type { Calendar, CalDate, - MoonState, CalEventCategory, } from "src/@types"; import { @@ -16,6 +15,7 @@ import { dateString } from "src/utils/functions"; import { MoonCache } from "./cache/moon-cache"; import type Calendarium from "src/main"; import { EventStore } from "./events.store"; +import type { MoonState } from "src/schemas/calendar/moons"; export type CalendarStore = ReturnType;