/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type FlowchartBins } from "./details.js"; import type { FlowchartDurationStep, FlowchartWords } from "./messages.js"; /** A histogram's durations' unit, as its read gives it. */ export type FlowchartDurationUnit = "minutes" | "hours" | "days"; /** A duration in the step it prints in, and its number there. */ export interface FlowchartDuration { /** Its step: `zero` alone, else minutes, hours, days or whole weeks. */ readonly step: FlowchartDurationStep; /** Its number in that step. */ readonly n: number; } /** * The step a duration prints in (R41): `0` alone; under an hour, minutes; * under a day, hours; whole weeks, weeks; else days. * * @param value - The duration, in its unit * @param unit - The read's unit * @returns Its step, and its number there */ export declare function durationOf(value: number, unit: FlowchartDurationUnit): FlowchartDuration; /** * A duration as the details print it (R41) — `15m`, `4h`, `2d`, `1w`, `0`. * * @param value - The duration, in its unit * @param unit - The read's unit * @param words - The flowchart's words * @returns Its words */ export declare function durationText(value: number, unit: FlowchartDurationUnit, words: FlowchartWords): string; /** * A bin's words, by its place (R41): its edges — `4h – 8h` — or, the last, * open — `1w or more`. * * @param edges - The flowchart's bins' edges, ascending * @param bin - The bin's place * @param unit - The read's unit * @param words - The flowchart's words * @returns Its words */ export declare function binText(edges: readonly number[], bin: number, unit: FlowchartDurationUnit, words: FlowchartWords): string; /** * A histogram's caption (R36, R41): where half and nine in ten of its counts * fall — `Half within 4h · nine in ten within 2d`; `over 1w` where they reach * the open last bin. * * @param edges - The flowchart's bins' edges, ascending * @param counts - The row's count in each bin * @param unit - The read's unit * @param words - The flowchart's words * @returns The caption; `undefined` where nothing is counted */ export declare function marksText(edges: readonly number[], counts: readonly number[], unit: FlowchartDurationUnit, words: FlowchartWords): string | undefined; /** * A share in the app's locale (R29, R41): a whole percent — above nothing but * under one percent, `<1%`. * * @param share - The share, 0 to 1 * @param words - The flowchart's words * @returns Its words */ export declare function shareText(share: number, words: FlowchartWords): string; /** One tick an axis draws: its words, where they start across the axis, and how wide they draw — in px. */ export interface FlowchartTick { /** Its words. */ readonly text: string; /** Where its words start, from the axis's start: by the estimate, where it ends at the axis's end. */ readonly x: number; /** How wide they draw, by the estimate. */ readonly w: number; /** * Whether it ends at the axis's end, its words going no further whatever * they measure: drawn from the end, since a browser that rounds each * character to a whole pixel draws them wider than the estimate. */ readonly end: boolean; } /** A tick the app lists: where it is, in the read's unit, and its own words where it gives them. */ export interface FlowchartTickAt { /** Where it is. */ readonly at: number; /** The app's words for it; `undefined`, printed from the unit. */ readonly label: string | undefined; } /** A tick's text a character, on a card, in px: mono 9.5, the visual spec's. */ export declare const CARD_TICK_CHAR = 5.7; /** A tick's text a character, in the inspector, in px: mono 10, the visual spec's. */ export declare const PANE_TICK_CHAR = 6; /** * The ticks an axis draws across its width (R28; see the module docs): the * first edge, then the app's ticks or round durations, each placed where * `axisAt` puts it, those that do not fit left out. * * @param bins - The flowchart's bins * @param unit - The read's unit * @param ticks - The ticks the app lists; `undefined`, round durations * @param width - The axis's width, in px * @param char - A tick's text a character, in px * @param words - The flowchart's words * @returns The ticks drawn, in order */ export declare function axisTicks(bins: FlowchartBins, unit: FlowchartDurationUnit, ticks: readonly FlowchartTickAt[] | undefined, width: number, char: number, words: FlowchartWords): FlowchartTick[]; //# sourceMappingURL=details-words.d.ts.map