/** * WHICH UNIT IS WORST, AND WHICH HAS BEEN THAT WAY LONGEST — the live board's * one ordering, as a function. * * It lives in the kit and not in a screen for the reason the countdown * (`deadline.ts`) does: "the exception is a row, ranked by severity then age" is * a contract, and a board that re-picks the ladder for itself says a unit is * urgent at a different distance than the board beside it. It is RN- and * React-free so the rule can be read against its cases rather than through a * rendered grid. * * TWO INPUTS, IN THIS ORDER, and the order is the finding: a unit the model has * FLAGGED outranks one whose reading has merely crossed its bound. A flag is * somebody's answer about the unit — it is off the road, the alarm went — where a * bound is arithmetic that crosses back on its own the moment the next reading * lands. Ranked the other way, one over-full bay outranks every breakdown on the * board. */ /** The conditions a unit can be in, WORST FIRST — the ladder the board reads by. */ export declare const BOARD_CONDITIONS: readonly ["flagged", "past", "steady"]; export type BoardCondition = (typeof BOARD_CONDITIONS)[number]; /** Where a unit stands, and since when — everything the ordering reads. */ export interface BoardStanding { condition: BoardCondition; /** * The day the unit entered the condition it is in, as the field stores it * (ISO, so it orders as text). Absent where nothing recorded one, which puts * the unit LAST inside its own condition: an undated exception cannot be shown * to be older than a dated one, and guessing either way reorders the rail on a * fact nobody has. */ since?: string | null; } /** * WHICH CONDITION A UNIT IS IN — the model's own flag, then the reading that has * crossed the bound it is read against. * * A flag nobody has answered is not a `false`: both are "not flagged" for the * ladder, and the difference is what the row's own mark draws. */ export declare function boardCondition(flagged: boolean | null | undefined, past: boolean): BoardCondition; /** * THE UNITS IN THE ORDER THE BOARD READS THEM — worst first, and inside one * condition the longest-standing first. * * A COPY, always: the rows are the caller's read and the board is one of several * surfaces over them, so sorting the array in place would reorder the register * the caller drew from the same read. * * Ties break on the order the rows ARRIVED, stated rather than left to the * engine: two units flagged on the same day have nothing left to rank them by, * and a board whose rows swap places between renders is one the reader cannot * point at. */ export declare function rankUnits(rows: readonly T[], standing: (row: T) => BoardStanding): T[];