import { Edition } from "../model/Edition.js"; import { ModificationPurpose } from "../model/RollCopy.js"; import { FeatureConditionAssignment, FeatureOrPatch, NestedFeature } from "../model/Feature.js"; import { EditionOp } from "./draft.js"; /** * States the condition of the feature, in place of any earlier * statement. Throws where the kind of feature is in no such condition; * `conditions` says which conditions each kind of feature may be in. * @category Operations */ export declare const stateFeatureCondition: (copyId: string, featureId: string, condition: FeatureConditionAssignment) => EditionOp; /** * The act a feature an editor states belongs to: the punching of the * copy, the act that brought another feature about, or, where neither * is said, an act of its own for the purpose given. A patch is never * punched, being glued on, so `punched` says nothing of one. * @category Operations */ export interface FeatureAct { /** The copy came from its punching with it, which is where a reading of a scan puts every chain of holes. */ punched?: boolean; /** The act that brought this feature about brought the new one about as well. */ beside?: string; /** What the act was for, where a new one is made for the feature. */ purpose?: ModificationPurpose; } /** * States that the copy bears the feature, in the act that brought it * about: a patch was glued on by an attachment, anything else was * produced, by the punching or by a later act. Which act, `FeatureAct` * says; a `beside` that names nothing the copy bears is passed over and * the feature goes into an act of its own. * @category Operations */ export declare const addFeature: (copyId: string, feature: FeatureOrPatch, act?: FeatureAct) => EditionOp; /** * States that the patch bears the feature. What a patch bears came onto * the copy with the patch, so it belongs to no act of its own and * states no place: it stands where the patch stands. * @category Operations */ export declare const addBorneFeature: (copyId: string, patchId: string, feature: NestedFeature) => EditionOp; /** * Takes the features off the copy, and out of the versions with what * only they carried. A feature may be named wherever the copy bears it: * a patch goes with everything glued onto it, and a feature of a patch * may be taken back on its own, the patch staying where it is. An act * left having produced or added nothing goes as well. * @category Operations */ export declare const removeFeatures: (copyId: string, featureIds: readonly string[]) => EditionOp; /** * Why several features cannot be replaced by one. * @category Operations */ export type MergeObstacle = 'fewer-than-two' | 'different-types' | 'different-tracks' | 'differing-conditions' | 'unlike-features' | 'different-acts'; /** * What stands in the way of reading the features as one, or nothing * where they may be merged. Features may be merged where they differ * in nothing but their place along the roll, their depiction and the * condition at most one of them states. How far apart they lie is not * asked: whether a gap is a bridge of the perforator, a tear or two * perforations of their own is the editor's reading. * @category Operations */ export declare const mergeObstacle: (features: readonly FeatureOrPatch[]) => MergeObstacle | undefined; /** * What stands in the way of reading the features the ids name as one, * as `mergeFeatures` will find it. `mergeObstacle` asks only what the * features themselves say, which cannot reach `different-acts`: one * feature is the work of one act, and where the features stand is the * edition's business rather than theirs. * @category Operations */ export declare const mergeObstacleIn: (edition: Edition, featureIds: readonly string[]) => MergeObstacle | undefined; /** * Replaces the features of the copy with a single one covering them * all, where a scan has split what the editor reads as one feature. * The merged feature takes the place of the first it replaces and * spans from the first to the last, any gap between them included. * What the replaced features carried is carried by the merged one, and * whatever else named them, a modification or a comprehension, names * the merged one in their stead. * * Only the features the copy bears itself are merged. A feature of a * patch states no place along the roll of its own, so there is nothing * for a merge to span, and an id naming one is passed over as an id the * copy does not bear is. Features of two different acts are not merged * either: one feature is the work of one act. * * Throws where the features cannot stand for one; `mergeObstacle` * says beforehand whether they can. * @category Operations */ export declare const mergeFeatures: (copyId: string, featureIds: readonly string[]) => EditionOp;