/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The bands a time view shades (#1148): weekends, and the hours outside the * working day, as data. Each band is a stretch of the window as window * fractions, and its kind; the host draws it down a timeline (along x) or * across a day column (along y), and the host's recipe gives it its look. * * Times are UTC, as everything on a time axis is (#326): a Saturday is a UTC * Saturday, and a working day's hours are UTC hours. A weekend day is shaded * whole, never also for its hours. Bands of one kind that meet are one band, * so a night runs from one day's close to the next day's open, and a weekend * from Saturday to Monday. * * @packageDocumentation */ import type { TimeWindow } from "./scale.js"; /** What a band shades. */ export type ShadeKind = "weekend" | "offHours"; /** One shaded stretch of the window. */ export interface ShadeBand { /** Where it starts, as a window fraction. */ readonly start: number; /** How long it is, as a window fraction. */ readonly width: number; /** What it shades. */ readonly kind: ShadeKind; } /** What a view shades. */ export interface ShadeOptions { /** The working day, in whole UTC hours: the hours before `from` and from `to` on are shaded. Omitted, no hour is. */ readonly hours?: { readonly from: number; readonly to: number; } | undefined; /** Whether Saturdays and Sundays are shaded whole: true by default. */ readonly weekends?: boolean | undefined; } /** * The bands a window shades (see the module docs). * * @param window - The window, `[min, max)` * @param options - The working day, and whether weekends shade * @returns The bands, in order; none for an empty window */ export declare function shadeBands(window: TimeWindow, options: ShadeOptions): ShadeBand[]; //# sourceMappingURL=shading.d.ts.map