/** * A range of wall clock hours, and where one reading sits inside it. * * Two different things in this repository are a range of hours: the * instrument's own trading session, which a host states in its instrument * record (`host-interface.md` 4.3), and the range a script writes for * `session.isIn` (`stdlib.md` 12.5). They are spelled differently and they mean * different things, but the arithmetic is one arithmetic, and it is here so * that it is one rule rather than two that can drift. * * **The open is inclusive and the close is exclusive**, so two ranges written * back to back cover every minute once and no minute twice. A range whose start * and end are the same minute holds nothing, which is what writing a zero length * range says. * * **A range whose end is before its start crosses midnight and is read that * way**, which is what an overnight session needs. The day list then names the * day the range opened on rather than the day the reading falls on, because a * session that opens on Friday evening and closes on Saturday morning is a * Friday session: reading the list against the reading's own day would drop * half of every overnight session and keep the wrong half. * * **A session is named by the day it opened on**, which is what tells two * readings in one session from two readings in two. Naming it by an instant * would be wrong across a seasonal clock change, where a wall clock hour inside * a session is not an hour of elapsed time. */ import type { Civil } from '../../stdlib/index.js'; /** Hours as minutes from midnight, and the days they open on. */ export interface Hours { readonly from: number; /** Minutes from midnight at the close, which may be at 24:00. */ readonly to: number; /** The days it opens on, Monday as 1, or nothing for every day. */ readonly days: readonly number[] | null; } /** Where one reading sits in a range of hours. */ export interface Standing { readonly inside: boolean; /** Minutes since the hours opened, zero on the minute they opened. */ readonly elapsed: number; /** Minutes until they are scheduled to close. */ readonly remaining: number; /** The day they opened on, which is the name of this one session. */ readonly openingDay: number; } /** Where a wall clock reading sits in a range of hours, or outside every one. */ export declare function standingIn(hours: Hours, at: Civil): Standing; //# sourceMappingURL=hours.d.ts.map