/** * The recording's time axis, built from probed record onsets. * * Layer 4. Pure and synchronous: it is handed onsets that someone else read, and it decides what * they mean. Sole owner of what makes a timeline valid ON THE READING PATH — * `tal/annotations.ts` produces `recordOnsetTicks` and deliberately passes no judgement on it, * so every monotonicity and spacing verdict a read reaches is made here. * * Not "and nowhere else", which this said until 0.6.59. `validateRecording` checks the spacing * rule again and reports `RECORD_ONSET_SPACING_VIOLATION` of its own, from the segments a * COMPLETE index gives it — a stronger check than the one below, which sees a probed pair and * can only report net drift. A reader of this file concluded the conformance sweep did not * look. * * TIME AXIS, fixed here for the whole library: `t = 0` is the START OF RECORD 0, not the header * start time. Record 0's timekeeping onset is `startOffsetTicks` — in [0, 1) s — and it is the * bridge back to the header clock. Every other second edfcore reports (segment, gap, chunk, * window bound) is elapsed recording time. This is the EDFlib/pyEDFlib/MNE convention, and it is * the one under which sample `n` of a signal sits at exactly * `n * recordDuration / samplesPerRecord` with no sub-second constant to remember. */ import type { EdfDiagnostic, EdfHeader, EdfTimeline, ParseOptions } from '../types.js'; /** One record onset as observed on disk: which record, and its exact timekeeping value. */ export interface RecordOnsetProbe { readonly recordIndex: number; /** Verbatim, relative to the header start time — the axis rebasing has not happened yet. */ readonly onsetTicks: bigint; } /** * What a timeline can be built from: a header, and onsets someone else already read. Taking * probes rather than a source is what keeps this module free of I/O — how many records to read * and when is `record-index.ts`'s decision, and what they mean is this one's. */ export interface TimelineInput { readonly header: EdfHeader; /** * Ascending by `recordIndex`, first entry record 0 and last entry record `recordCount - 1`. * In practice the two probes `buildTimeline` reads; a single-record file supplies one entry * that is both. Empty exactly when the file has no records. */ readonly probes: readonly RecordOnsetProbe[]; /** * Diagnostics from decoding the probed records, folded into `timeline.diagnostics` so one * array explains the whole timeline. A `START_OFFSET_OUT_OF_RANGE` already present here is not * repeated below. */ readonly probeDiagnostics?: readonly EdfDiagnostic[]; } /** * Fatal, at any observed pair: a later record starting earlier than an earlier one makes every * time-based answer for the file wrong, so edfcore refuses to derive any of them. * * Equal onsets are not a violation — a file with `recordDuration = 0` has every record at the * same instant legally, and an insufficient advance is spacing, which is a warning. */ export declare function assertMonotonicOnsets(earlier: RecordOnsetProbe, later: RecordOnsetProbe): void; /** * `assertMonotonicOnsets` across a full onset array, which is what `buildRecordIndex` has. * * `firstRecordIndex` is the record `onsetTicks[0]` belongs to, so the diagnostic names the record * in the file rather than a position in the array. */ export declare function assertMonotonicOnsetArray(onsetTicks: ArrayLike, firstRecordIndex?: number): void; /** * `EdfTimeline` from the probed onsets plus the header. * * The span and the coverage are computed independently — last record end minus first record start, * against the sum of the record durations — because their being equal is the statement "this file * is contiguous as far as two reads can tell". Deriving either from the other would make that * identity true by construction and worth nothing. * * Both are RETURNED in ticks as well as in seconds, and the ticks are the pair to compare. They * were computed exactly here from the first release and then discarded at the return, which left * every caller asking the contiguity question of two float64 conversions of them. */ export declare function buildTimelineFromProbes(input: TimelineInput, options?: ParseOptions): EdfTimeline; //# sourceMappingURL=timeline.d.ts.map