import { Edition } from "../model/Edition.js"; import { EditShape } from "../model/Edit.js"; import { Millimeters } from "../model/Quantity.js"; import { EditionOp } from "../ops/draft.js"; /** * How far a perforation may be put from where it stood for the two to be * one move. WM 225 moves commands by up to about 60 mm. * @category Filiation */ export declare const defaultShiftWithin: import("../index.js").Quantity<"mm">; /** * How far an Off may follow an On for the two to be one function turned * on and off again, as an accent is. WM 225 has crescendo accents of up * to about 55 mm. * @category Filiation */ export declare const defaultPairWithin: import("../index.js").Quantity<"mm">; /** * How near the onsets of a perforation and the one put in its place lie * for the one to be a longer or shorter version of the other rather than * a moved one. The figure `mergeEdits` guesses with. * @category Filiation */ export declare const defaultResizeWithin: import("../index.js").Quantity<"mm">; /** * How near two perforations lie to stand at one place: the commands of a * cancel row, or an accent's On and the note set off for it. * @category Filiation */ export declare const defaultSamePlaceWithin: import("../index.js").Quantity<"mm">; /** * What a proposal of edits is computed with. Every value has a default, * the one the edits of WM 225 are reproduced with. * @category Filiation */ export interface EditOptions { /** `defaultShiftWithin` */ shiftWithin?: Millimeters; /** `defaultPairWithin` */ pairWithin?: Millimeters; /** `defaultResizeWithin` */ resizeWithin?: Millimeters; /** `defaultSamePlaceWithin` */ samePlaceWithin?: Millimeters; } /** * Why changes were taken for one edit. * @category Filiation */ export type EditGrouping = /** A change nothing else on its line goes with. */ 'single' /** A latched function turned on and off again shortly after, as an accent is, or off and on again, added or withdrawn. */ | 'pair' /** Notes of one pitch, or held commands of one function, that overlap: a note struck again, two tied into one, one made longer. */ | 'overlap' /** What the version deletes on a line, and what it puts nearby in its place. */ | 'move' /** A held command of the version standing for a latched pair of the parent's. */ | 'substitution' /** Cancels punched across several lines at one place. */ | 'row'; /** * An edit proposed from the changes of a version. * @category Filiation */ export interface ProposedEdit { /** The ids of the symbols it inserts, in the order of their places. */ insert: string[]; /** The ids of the symbols it deletes, in the order of their places. */ delete: string[]; /** The shape of the change, where it takes one the program knows. */ shape?: EditShape; grouping: EditGrouping; } /** * The edits of the version, proposed from what its edits insert and * delete, however they group it now. The proposal depends on the * version's changes and the text of its parent alone, so it is the same * whatever order the changes come in. * * Changes are read line by line: a latched function on its side of the * keyboard, a held one, or a pitch. A command or a note both texts keep * divides its line, and no edit runs across one, so that every edit * stays at one place. On a latched line, a function turned on and off * again shortly after is one edit, as an accent is; a pair withdrawn and * put elsewhere whole is one move, and so is a command put elsewhere on * its own, the nearest first; an Off with an On right after it breaks * the function off and takes it up again. Notes, and commands held for * as long as they last, are one edit where they overlap, and one move * where a note is put nearby. Where the version's system has no word for * a command of the parent's, a held command standing for a latched pair * is one edit with it; what has no counterpart stands alone. Cancels * punched across three lines or more at one place are one edit, as a * cancel row is. * * The shape is read off the group: a pair the bar spells an accent with * is an additional accent, as is a note set off from its chord by a few * millimetres where the version puts an accent's On; a perforation put * elsewhere is a shift, or where it begins about where the other did, * shortened or prolonged; a note struck again is shortened, two tied * prolonged; a change the text makes no use of is a redundancy added or * removed; and a change the other system has no word for is a recoding. * Whether a shift corrects an error, and why any change was made, is * not read off the shape. * * A version that derives from none states its text, not a change of * another, and each of its symbols stands alone. * @category Filiation */ export declare const proposeEdits: (edition: Edition, versionId: string, options?: EditOptions) => ProposedEdit[]; /** * The motivation a program states for each change the version makes, * by the id of the symbol it inserts or deletes: the one the shape of * the proposed edit it belongs to calls for (`motivationProposedFor`), * musical or technical. A version that derives from none makes no * change, and its symbols are given none. * @category Filiation */ export declare const proposedMotivations: (edition: Edition, versionId: string, options?: EditOptions) => ReadonlyMap; /** * The motivation a program states for an edit making these changes: * the generic musical one where any of them is a musical change, or one * the proposal does not see, and the technical one where all are * technical. */ export declare const motivationOfChanges: (motivations: ReadonlyMap, symbolIds: readonly string[]) => string; /** * Puts the proposed edits (`proposeEdits`) in place of the program's * edits of the versions, every version but the root where none are * named: those that say nothing of why they were made, or only that they * are musical or technical changes (`isCollationsOwn`). An edit with a * motivation of the editor's or held under a belief stays as it is, and * what a proposed edit shares with it stands symbol by symbol beside it. * An edit stated already over the very same symbols as a proposed one * is kept with its id and the kind of change it states, which the * editor may have said otherwise than the program read it; the others * are new, with ids that adopting again gives again. An edit that * states no kind has the motivation its shape calls for * (`motivationProposedFor`): the generic musical one for a musical * change, whose reason is left to the editor, and the technical one for * a technical change. * * Applied on the same draft after `adoptStemma`, it proposes the edits of * the stemma adopted, as one undo step. The edition's creation comes to * name the rule that keeps an edit at one place among its principles, * and this release among its software. * @category Operations */ export declare const adoptEdits: (versionIds?: readonly string[], options?: EditOptions) => EditionOp;