/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * Which of a ruler's labels it draws (#1269): where its columns are narrower * than their labels, every k-th — k the smallest step at which every label it * draws fits whole, with a gap between two — and each period's first column * (a week's Monday under days, a month's first week under weeks, a year's * January under months) always among them, as the user ruled. Where even the * periods' first columns crowd each other, each draws that clears the one * drawn before it, and no other label does. A preferred label — the narrow * ruler's now bucket, which wears the brand where a chip has no room — draws * wherever it clears every period's first column drawn, and the labels it * crowds give way to it. * * A label is centred on its column, and may run past it into the columns * either side, which draw none. One that would run past the track's start or * end sits against its own column's edge there instead; one that cannot lie * inside the track either way draws nowhere. * * Pure: decided from the labels' widths as the ruler measured them, each * drawn whole. * * @packageDocumentation */ /** One column's label, as the ruler measured it. */ export interface RulerLabel { /** The column's centre, in px. */ readonly centre: number; /** The column's inside start edge, in px: where its label sits when, centred, it would run past the track's start. */ readonly start: number; /** The column's inside end edge, in px: where its label sits when, centred, it would run past the track's end. */ readonly end: number; /** The label's width, drawn whole, in px. */ readonly width: number; /** Whether the column starts a period: its label draws unless it crowds the period's first column drawn before it. */ readonly anchor: boolean; /** Whether the column's label draws wherever it clears every period's first column drawn. */ readonly prefer: boolean; } /** Where a label sits against its column: centred on it, or against its start or its end edge. */ export type RulerAlign = "centre" | "start" | "end"; /** What the ruler draws: each column's label shown or not, and where it sits. */ export interface RulerFit { /** Whether each column's label is drawn. */ readonly shown: readonly boolean[]; /** Where each column's label sits. */ readonly align: readonly RulerAlign[]; } /** * The labels a ruler draws — see the module docs. * * @param labels - Each column's label, in order * @param track - The track's ends, in px * @param gap - The room between two labels, in px * @returns Which labels draw, and where each sits */ export declare function thinTicks(labels: readonly RulerLabel[], track: { left: number; right: number; }, gap: number): RulerFit; //# sourceMappingURL=ruler-thin.d.ts.map