/** * Calendar grid geometry — pure `date → date` layout math with no Svelte or * event/item awareness. The shared foundation under both Calendar and Planner: * month grids, week rows, ISO week numbers, year month-lists. */ /** * Generate a 2D grid of dates for a month view. * Each row is a 7-element array representing one week. Includes padding days * from the previous/next months so every row is full. * * @param year - Full year (e.g. 2026) * @param month - Month index (0-11) * @param weekStartsOn - Day the week starts on (0=Sun, 1=Mon, ..., 6=Sat) * @param fixedWeeks - Always emit 6 rows, padding with trailing next-month days. * A month needs 4, 5 or 6 rows depending on where it starts, so a grid that * sizes to its content changes height as the reader pages through the year — * fine embedded in a page, wrong inside a popover, where the cells then move * out from under the pointer. * @returns 2D array of Date objects (4-6 rows of 7 days, or always 6 with `fixedWeeks`) */ export declare function getMonthGrid(year: number, month: number, weekStartsOn?: number, fixedWeeks?: boolean): Date[][]; /** * Get the 7 dates for the week containing the given date. * * @param date - Any date within the target week * @param weekStartsOn - Day the week starts on (0=Sun, 1=Mon, ..., 6=Sat) * @returns Array of 7 Date objects starting from the week-start day */ export declare function getWeekDates(date: Date, weekStartsOn?: number): Date[]; /** * Get the ISO 8601 week number for a date (weeks start Monday; week 1 contains * the year's first Thursday). */ export declare function getWeekNumber(date: Date): number; /** * Get metadata for all 12 months of a year. * * @param year - Full year (e.g. 2026) * @returns Array of 12 objects with month index and year */ export declare function getYearMonths(year: number): { month: number; year: number; }[]; /** * Number of days in a month, leap years included. `month` is 0-based * (0 = January). Day 0 of the next month is the last day of this one. */ export declare function daysInMonth(year: number, month: number): number; /** * Clamp a month/year to optional min/max date boundaries. * Returns the (possibly adjusted) month/year plus flags for whether navigating * one month back/forward would stay within bounds. */ export declare function clampMonth(month: number, year: number, minDate?: Date, maxDate?: Date): { month: number; year: number; canGoBack: boolean; canGoForward: boolean; };