import { Edition } from "../model/Edition.js"; import { HorizontalSpan } from "../model/Feature.js"; import { RollCopy } from "../model/RollCopy.js"; import { Millimeters } from "../model/Quantity.js"; import { TrackerBar, TrackMeaning } from "../systems/TrackerBar.js"; import { CollationTolerance } from "../collation/Collation.js"; /** * One copy's reading of one feature: what the copy's bar reads off it, * and where. * @category Filiation */ export interface CopyReading { /** The feature and what it is read as, since a feature across two positions reads as two commands. */ id: string; copy: string; feature: string; meaning: TrackMeaning; key: string; place: HorizontalSpan; } /** * A reading the copies share: the readings of one meaning that lie at * about the same place, at most one of each copy. * @category Filiation */ export interface CollatedReading { /** * A name for the reading, the same for the same meaning on the same * features, so that collating again gives it again. */ id: string; meaning: TrackMeaning; key: string; /** The features carrying it, each on another copy. */ carriers: string[]; /** The copies carrying it, in the order the collation was given them. */ copies: string[]; /** Where it lies: the median of its carriers at either end. */ place: HorizontalSpan; } /** * How far two copies may put one reading apart, and where that window * is centred: the systematic difference between the two and the scatter * about it, as `scatter.ts` measures a derivation's. * @category Filiation */ export interface PairWindow extends CollationTolerance { /** How many readings the window was measured on; none where it fell back on the default. */ n: number; } /** * A command one copy holds where another latches, as a transfer into a * system with held commands spells it: the readings of the one standing * for the readings of the other. * @category Filiation */ export interface Recoding { /** The collated readings of the latched pair. */ replaced: string[]; /** The collated readings of the held command. */ by: string[]; } /** * The collation of a set of copies. * @category Filiation */ export interface CopyCollation { copies: string[]; readings: CollatedReading[]; /** By pair of copies (`a|b|group`, the pair in the order the copies were given), the window used. */ windows: Record; recodings: Recoding[]; /** By copy, where its text begins and ends. */ extent: Record; } /** * What the copy's own punching put on the paper and its bar reads as * text, in order of onset. * * A later alteration of the copy is not part of what was punched from * the version, so only the features of the production count. Where the * bar finds the roll's end, reading stops, and the end itself is not * read. A command no other scale has a word for (the motor, the rewind, * the electric cut-off) runs the instrument rather than the music and * is no reading either. * @category Filiation */ export declare const readingsOfCopy: (copy: Readonly) => CopyReading[]; /** * Collates the copies all at once. Every reading is compared with every * reading of the same meaning on the other copies, and two are taken to * be one where they lie within the window of their pair of copies at * both ends. The readings are then joined nearest pair first, and never * so that one copy would read a joined reading twice. * * Collating one copy after another against what was collated before, as * connecting versions does, depends on the order: six copies collated in * their 720 orders give hundreds of different results. Compared all with * all, the result is the same whichever order the copies are given in, * and only the copies themselves decide it. * @category Filiation */ export declare const collateCopies: (edition: Pick, copyIds: readonly string[]) => CopyCollation; /** Whether the bar has a word for the meaning at all. */ export declare const reads: (bar: TrackerBar, meaning: TrackMeaning) => boolean;