/** The instrument's trading session, as `host-interface.md` 4.3 prints it. */ export interface SessionHours { /** A wall clock time, `"HH:MM"`, read in the instrument's timezone. */ readonly start: string; /** The same, where `"24:00"` is midnight at the end of the day. */ readonly end: string; /** Monday as 1 through Sunday as 7, or nothing for every day. */ readonly days?: readonly number[]; } /** What a bar's session comes to, absent where the record cannot say. */ export interface SessionFacts { readonly isFirstBar: boolean | null; readonly isLastBar: boolean | null; } /** No session stated, so neither fact has an answer. */ export declare const NO_SESSION: SessionFacts; /** * What the record is missing before any session fact can be read from it. * * `host-interface.md` 4.1 marks every fact here optional and 4.3 says what a * script sees when the session is one of them: absence, which a script can test. * That is the answer for a host that schedules no session, and it is not the * answer for the three records below, each of which is a host that believes it * stated one: * * - **A session and no timezone.** `start` and `end` are wall clock, so a * window with no zone to read it in is not a window. Nothing about the record * says which hours were meant, and every session study on that host draws * nothing. * - **A session whose clock times are not `"HH:MM"`.** `"9:00"` is the spelling * a host writes first and the one the record does not take. * - **Days outside one to seven.** Monday is 1 (`stdlib.md` 12.2), so a host * numbering Sunday as 0 states a week the instrument never opens in. * * Each of the three is reported at load rather than answered with absence, * because absence there is indistinguishable from the honest case and the honest * case is the one a reader will assume. A bare read of an instrument fact the * host did not state is a different question with the opposite answer: it is * absent and never refused (`host-interface.md` 4.5, decision 66), because a * record the host contradicts itself in is not a fact it left out. */ export declare function recordProblem(stated: SessionHours | undefined, zone: string | null): string | undefined; /** Reads one run's session facts, one bar at a time. */ export interface SessionReader { /** This bar's facts, given the bar before it, or nothing before it. */ factsAt(time: number | null, previousTime: number | null): SessionFacts; } /** * The reader for one run. * * Built once, because the instrument record is read once at load and is * constant for the whole run (`host-interface.md` 4.4). A fact that changed * mid-run would make the first bars of a chart disagree with the rest of it. */ export declare function sessionReader(stated: SessionHours | undefined, zone: string | null, barMinutes: number | null): SessionReader; //# sourceMappingURL=record.d.ts.map