linked-rolls 0.57.0 → 0.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +54 -367
  2. package/lib/{constraints.d.ts → analysis/constraints.d.ts} +1 -1
  3. package/lib/{constraints.js → analysis/constraints.js} +8 -7
  4. package/lib/analysis/ownPaper.d.ts +26 -0
  5. package/lib/analysis/ownPaper.js +41 -0
  6. package/lib/{reservations.d.ts → analysis/reservations.d.ts} +3 -3
  7. package/lib/{reservations.js → analysis/reservations.js} +3 -3
  8. package/lib/{sigla.d.ts → analysis/sigla.d.ts} +2 -2
  9. package/lib/{sigla.js → analysis/sigla.js} +4 -4
  10. package/lib/{witnesses.d.ts → analysis/witnesses.d.ts} +2 -2
  11. package/lib/{witnesses.js → analysis/witnesses.js} +2 -2
  12. package/lib/{Collation.d.ts → collation/Collation.d.ts} +4 -4
  13. package/lib/{Collation.js → collation/Collation.js} +4 -4
  14. package/lib/{alignment.d.ts → collation/alignment.d.ts} +4 -4
  15. package/lib/{alignment.js → collation/alignment.js} +10 -16
  16. package/lib/{scatter.d.ts → collation/scatter.d.ts} +4 -4
  17. package/lib/{scatter.js → collation/scatter.js} +3 -3
  18. package/lib/{statistics.d.ts → collation/statistics.d.ts} +1 -1
  19. package/lib/{statistics.js → collation/statistics.js} +2 -2
  20. package/lib/{substitution.d.ts → collation/substitution.d.ts} +9 -24
  21. package/lib/{substitution.js → collation/substitution.js} +13 -37
  22. package/lib/emulation/Emulation.d.ts +64 -0
  23. package/lib/emulation/Emulation.js +282 -0
  24. package/lib/emulation/negotiation.d.ts +14 -0
  25. package/lib/emulation/negotiation.js +20 -0
  26. package/lib/index.d.ts +43 -35
  27. package/lib/index.js +36 -35
  28. package/lib/{asJsonLd.d.ts → io/asJsonLd.d.ts} +1 -1
  29. package/lib/{asJsonLd.js → io/asJsonLd.js} +3 -3
  30. package/lib/{context.d.ts → io/context.d.ts} +4 -4
  31. package/lib/{context.js → io/context.js} +4 -4
  32. package/lib/{importJsonLd.d.ts → io/importJsonLd.d.ts} +1 -1
  33. package/lib/io/importJsonLd.js +128 -0
  34. package/lib/{migrate.js → io/migrate.js} +59 -55
  35. package/lib/{Agent.d.ts → model/Agent.d.ts} +1 -1
  36. package/lib/{Assumption.d.ts → model/Assumption.d.ts} +1 -1
  37. package/lib/{Edit.d.ts → model/Edit.d.ts} +1 -1
  38. package/lib/{Edition.d.ts → model/Edition.d.ts} +2 -2
  39. package/lib/{Feature.d.ts → model/Feature.d.ts} +1 -1
  40. package/lib/{FeatureSource.d.ts → model/FeatureSource.d.ts} +1 -1
  41. package/lib/{Perforator.d.ts → model/Perforator.d.ts} +1 -1
  42. package/lib/{RollCopy.d.ts → model/RollCopy.d.ts} +3 -10
  43. package/lib/{RollCopy.js → model/RollCopy.js} +3 -5
  44. package/lib/{Symbol.d.ts → model/Symbol.d.ts} +1 -1
  45. package/lib/{Version.d.ts → model/Version.d.ts} +10 -2
  46. package/lib/{Version.js → model/Version.js} +24 -1
  47. package/lib/{vocabulary.js → model/vocabulary.js} +2 -2
  48. package/lib/ops/beliefs.d.ts +9 -0
  49. package/lib/ops/beliefs.js +31 -0
  50. package/lib/ops/collation.d.ts +62 -0
  51. package/lib/ops/collation.js +228 -0
  52. package/lib/ops/commands.d.ts +9 -0
  53. package/lib/ops/commands.js +29 -0
  54. package/lib/ops/copies.d.ts +74 -0
  55. package/lib/ops/copies.js +135 -0
  56. package/lib/ops/draft.d.ts +59 -0
  57. package/lib/ops/draft.js +81 -0
  58. package/lib/ops/edits.d.ts +10 -0
  59. package/lib/ops/edits.js +82 -0
  60. package/lib/ops/features.d.ts +84 -0
  61. package/lib/ops/features.js +296 -0
  62. package/lib/ops/forget.d.ts +31 -0
  63. package/lib/ops/forget.js +110 -0
  64. package/lib/ops/immutable.d.ts +16 -0
  65. package/lib/ops/immutable.js +46 -0
  66. package/lib/ops/index.d.ts +13 -0
  67. package/lib/ops/index.js +7 -0
  68. package/lib/ops/versions.d.ts +33 -0
  69. package/lib/ops/versions.js +95 -0
  70. package/lib/readers/AtonParser.js +5 -7
  71. package/lib/readers/phillipsEroll.d.ts +3 -3
  72. package/lib/readers/phillipsEroll.js +4 -5
  73. package/lib/readers/spencerBar.d.ts +2 -2
  74. package/lib/readers/spencerBar.js +2 -3
  75. package/lib/readers/stanfordAton.d.ts +3 -3
  76. package/lib/readers/stanfordAton.js +2 -3
  77. package/lib/schema.json +0 -13
  78. package/lib/{ReproducingSystem.d.ts → systems/ReproducingSystem.d.ts} +3 -3
  79. package/lib/{TrackerBar.d.ts → systems/TrackerBar.d.ts} +48 -8
  80. package/lib/{TrackerBar.js → systems/TrackerBar.js} +11 -2
  81. package/lib/systems/index.d.ts +8 -2
  82. package/lib/systems/index.js +7 -1
  83. package/lib/systems/welte.d.ts +100 -0
  84. package/lib/systems/welte.js +119 -0
  85. package/lib/systems/welteLicensee/bar.d.ts +1 -1
  86. package/lib/systems/welteLicensee/bar.js +5 -2
  87. package/lib/systems/welteLicensee/system.d.ts +1 -1
  88. package/lib/systems/welteLicensee/system.js +1 -1
  89. package/lib/systems/welteT100/bar.d.ts +27 -1
  90. package/lib/systems/welteT100/bar.js +44 -2
  91. package/lib/systems/welteT100/system.d.ts +6 -39
  92. package/lib/systems/welteT100/system.js +19 -128
  93. package/lib/systems/welteT98/bar.d.ts +1 -1
  94. package/lib/systems/welteT98/bar.js +18 -2
  95. package/lib/systems/welteT98/system.d.ts +20 -38
  96. package/lib/systems/welteT98/system.js +20 -121
  97. package/lib/validate.d.ts +1 -1
  98. package/lib/{EditionView.d.ts → view/EditionView.d.ts} +17 -41
  99. package/lib/{EditionView.js → view/EditionView.js} +26 -75
  100. package/package.json +7 -2
  101. package/lib/Emulation.d.ts +0 -36
  102. package/lib/Emulation.js +0 -250
  103. package/lib/editionOps.d.ts +0 -260
  104. package/lib/editionOps.js +0 -1079
  105. package/lib/importJsonLd.js +0 -57
  106. /package/lib/{migrate.d.ts → io/migrate.d.ts} +0 -0
  107. /package/lib/{Agent.js → model/Agent.js} +0 -0
  108. /package/lib/{Assumption.js → model/Assumption.js} +0 -0
  109. /package/lib/{ConditionState.d.ts → model/ConditionState.d.ts} +0 -0
  110. /package/lib/{ConditionState.js → model/ConditionState.js} +0 -0
  111. /package/lib/{Edit.js → model/Edit.js} +0 -0
  112. /package/lib/{Edition.js → model/Edition.js} +0 -0
  113. /package/lib/{Feature.js → model/Feature.js} +0 -0
  114. /package/lib/{FeatureSource.js → model/FeatureSource.js} +0 -0
  115. /package/lib/{Perforator.js → model/Perforator.js} +0 -0
  116. /package/lib/{Quantity.d.ts → model/Quantity.d.ts} +0 -0
  117. /package/lib/{Quantity.js → model/Quantity.js} +0 -0
  118. /package/lib/{Symbol.js → model/Symbol.js} +0 -0
  119. /package/lib/{TrackCalibration.d.ts → model/TrackCalibration.d.ts} +0 -0
  120. /package/lib/{TrackCalibration.js → model/TrackCalibration.js} +0 -0
  121. /package/lib/{notes.d.ts → model/notes.d.ts} +0 -0
  122. /package/lib/{notes.js → model/notes.js} +0 -0
  123. /package/lib/{procedures.d.ts → model/procedures.d.ts} +0 -0
  124. /package/lib/{procedures.js → model/procedures.js} +0 -0
  125. /package/lib/{vocabulary.d.ts → model/vocabulary.d.ts} +0 -0
  126. /package/lib/{sorted.d.ts → shared/sorted.d.ts} +0 -0
  127. /package/lib/{sorted.js → shared/sorted.js} +0 -0
  128. /package/lib/{utils.d.ts → shared/utils.d.ts} +0 -0
  129. /package/lib/{utils.js → shared/utils.js} +0 -0
  130. /package/lib/{ReproducingSystem.js → systems/ReproducingSystem.js} +0 -0
@@ -1,260 +0,0 @@
1
- import { Draft } from "immer";
2
- import { EditionView, Path } from "./EditionView.js";
3
- import { Edition } from "./Edition.js";
4
- import { AnySymbol, PlacementRelation } from "./Symbol.js";
5
- import { CollationTolerance } from "./Collation.js";
6
- import { Edit } from "./Edit.js";
7
- import { GeneralRollCondition, ModificationPurpose, RollCopy, ScaleReading, Shift } from "./RollCopy.js";
8
- import { FeatureSource } from "./FeatureSource.js";
9
- import { AnyArgumentation, Belief, Certainty, ObjectAssumption } from "./Assumption.js";
10
- import { FeatureConditionAssignment, FeatureOrPatch, NestedFeature } from "./Feature.js";
11
- import { Millimeters } from "./Quantity.js";
12
- /**
13
- * A change to an edition, written onto an immer draft of it. One
14
- * operation is one undo step, so an operation that has to read the
15
- * edition first takes an `EditionView` of the state it will be
16
- * applied to and does all its writing in the one function it returns.
17
- */
18
- export type EditionOp = (draft: Draft<Edition>) => void;
19
- /**
20
- * Puts the copy into the edition with a version of its own, which
21
- * inserts every symbol the copy's own tracker bar reads on it. The
22
- * version is a reading in that system's words, so it is coded for the
23
- * system the copy was cut for.
24
- */
25
- export declare const createVersion: (copy: RollCopy) => EditionOp;
26
- /**
27
- * Puts the copy into the edition without a version of its own, as for a
28
- * copy whose features are not read into symbols: one known only from a
29
- * recording states instead which versions it carries.
30
- */
31
- export declare const addCopy: (copy: RollCopy) => EditionOp;
32
- /**
33
- * Shifts and then scales the copy's features into line with another
34
- * copy's, and puts the scale down to what the reading says: the paper,
35
- * or the speed the copy was cut for.
36
- */
37
- export declare const alignCopy: (copyId: string, shift: Shift, scale: number, reading?: ScaleReading) => EditionOp;
38
- /**
39
- * Puts the copy's features back where they were measured. A paper
40
- * stretch read off the alignment goes with it; a speed stated stays,
41
- * being a fact about the copy.
42
- */
43
- export declare const unalignCopy: (copyId: string) => EditionOp;
44
- /**
45
- * Takes the extension a pneumatic reader adds off the ends of the
46
- * copy's chains of holes, and records how much was taken, so that their lengths
47
- * can be compared with a scanned copy's at all.
48
- */
49
- export declare const shortenCopy: (copyId: string, extension: Millimeters, leaving?: ReadonlySet<string>) => EditionOp;
50
- /** Puts the reader's extension back on the copy's chains of holes. */
51
- export declare const unshortenCopy: (copyId: string) => EditionOp;
52
- /** States what the copy's features were read from, in place of any earlier statement. */
53
- export declare const stateSource: (copyId: string, source: FeatureSource) => EditionOp;
54
- /** Takes back the statement, leaving the copy silent about its source again. */
55
- export declare const clearSource: (copyId: string) => EditionOp;
56
- /** Gives the copy the siglum it is referred to by, or takes it away where the siglum given is blank. */
57
- export declare const nameCopy: (copyId: string, siglum: string) => EditionOp;
58
- /**
59
- * States that the copy carries the version, under the belief given. It
60
- * is meant for a copy whose features are not read into symbols, such as
61
- * one known only from a recording, and `carriageProblems` reports it
62
- * where features carry symbols already. A second statement about one
63
- * version is none.
64
- */
65
- export declare const stateCarriage: (copyId: string, versionId: string, belief?: Belief) => EditionOp;
66
- /** Takes back the copy's statement that it carries the version. */
67
- export declare const clearCarriage: (copyId: string, versionId: string) => EditionOp;
68
- /**
69
- * Adds a general condition to the copy, beside whatever is stated of it
70
- * already. The other condition a copy may be in, a paper stretch, is
71
- * read off an alignment and stated by `alignCopy`.
72
- */
73
- export declare const addGeneralCondition: (copyId: string, condition: ObjectAssumption<GeneralRollCondition>) => EditionOp;
74
- /**
75
- * States the condition of the feature, in place of any earlier
76
- * statement. Throws where the kind of feature is in no such condition;
77
- * `conditions` says which conditions each kind of feature may be in.
78
- */
79
- export declare const stateFeatureCondition: (copyId: string, featureId: string, condition: FeatureConditionAssignment) => EditionOp;
80
- /** The symbols of the versions that no other copy carries. */
81
- export declare const symbolsCarriedOnlyBy: (edition: Edition, copyId: string) => AnySymbol[];
82
- /**
83
- * The act a feature an editor states belongs to: the punching of the
84
- * copy, the act that brought another feature about, or, where neither
85
- * is said, an act of its own for the purpose given. A patch is never
86
- * punched, being glued on, so `punched` says nothing of one.
87
- */
88
- export interface FeatureAct {
89
- /** The copy came from its punching with it, which is where a reading of a scan puts every chain of holes. */
90
- punched?: boolean;
91
- /** The act that brought this feature about brought the new one about as well. */
92
- beside?: string;
93
- /** What the act was for, where a new one is made for the feature. */
94
- purpose?: ModificationPurpose;
95
- }
96
- /**
97
- * States that the copy bears the feature, in the act that brought it
98
- * about: a patch was glued on by an attachment, anything else was
99
- * produced, by the punching or by a later act. Which act, `FeatureAct`
100
- * says; a `beside` that names nothing the copy bears is passed over and
101
- * the feature goes into an act of its own.
102
- */
103
- export declare const addFeature: (copyId: string, feature: FeatureOrPatch, act?: FeatureAct) => EditionOp;
104
- /**
105
- * States that the patch bears the feature. What a patch bears came onto
106
- * the copy with the patch, so it belongs to no act of its own and
107
- * states no place: it stands where the patch stands.
108
- */
109
- export declare const addBorneFeature: (copyId: string, patchId: string, feature: NestedFeature) => EditionOp;
110
- /**
111
- * Takes the features off the copy, and out of the versions with what
112
- * only they carried. A feature may be named wherever the copy bears it:
113
- * a patch goes with everything glued onto it, and a feature of a patch
114
- * may be taken back on its own, the patch staying where it is. An act
115
- * left having produced or added nothing goes as well.
116
- */
117
- export declare const removeFeatures: (copyId: string, featureIds: readonly string[]) => EditionOp;
118
- /**
119
- * Takes the copy out of the edition together with the symbols only it
120
- * carries, and with every reference the versions and the argumentations
121
- * made to those symbols.
122
- */
123
- export declare const removeCopy: (copyId: string) => EditionOp;
124
- /** Why several features cannot be replaced by one. */
125
- export type MergeObstacle = 'fewer-than-two' | 'different-types' | 'different-tracks' | 'differing-conditions' | 'unlike-features' | 'different-acts';
126
- /**
127
- * What stands in the way of reading the features as one, or nothing
128
- * where they may be merged. Features may be merged where they differ
129
- * in nothing but their place along the roll, their depiction and the
130
- * condition at most one of them states. How far apart they lie is not
131
- * asked: whether a gap is a bridge of the perforator, a tear or two
132
- * perforations of their own is the editor's reading.
133
- */
134
- export declare const mergeObstacle: (features: readonly FeatureOrPatch[]) => MergeObstacle | undefined;
135
- /**
136
- * What stands in the way of reading the features the ids name as one,
137
- * as `mergeFeatures` will find it. `mergeObstacle` asks only what the
138
- * features themselves say, which cannot reach `different-acts`: one
139
- * feature is the work of one act, and where the features stand is the
140
- * edition's business rather than theirs.
141
- */
142
- export declare const mergeObstacleIn: (view: EditionView, featureIds: readonly string[]) => MergeObstacle | undefined;
143
- /**
144
- * Replaces the features of the copy with a single one covering them
145
- * all, where a scan has split what the editor reads as one feature.
146
- * The merged feature takes the place of the first it replaces and
147
- * spans from the first to the last, any gap between them included.
148
- * What the replaced features carried is carried by the merged one, and
149
- * whatever else named them, a modification or a comprehension, names
150
- * the merged one in their stead.
151
- *
152
- * Only the features the copy bears itself are merged. A feature of a
153
- * patch states no place along the roll of its own, so there is nothing
154
- * for a merge to span, and an id naming one is passed over as an id the
155
- * copy does not bear is. Features of two different acts are not merged
156
- * either: one feature is the work of one act.
157
- *
158
- * Throws where the features cannot stand for one; `mergeObstacle`
159
- * says beforehand whether they can.
160
- */
161
- export declare const mergeFeatures: (copyId: string, featureIds: readonly string[]) => EditionOp;
162
- /**
163
- * Bases the child on the parent. A symbol of the child that collates
164
- * with one the parent hands down adds its carriers to that symbol; the
165
- * rest become the child's insertions, and what the parent hands down
166
- * and the child lacks becomes its deletions. The derivation states the
167
- * tolerance it was collated at and becomes the principal one; the
168
- * hypotheses the child stated beside its former one stay.
169
- *
170
- * The edits the child already stated are rewritten only as far as a
171
- * collation wrote them (`isCollationsOwn`). An editor's reading of the
172
- * difference between the two texts stays, and the symbols it speaks for
173
- * are left out of the collation, so that connecting the two again
174
- * neither doubles them nor silently drops what somebody established by
175
- * hand. An equivalence is the collation's own, since it is drawn from
176
- * the two systems' vocabularies rather than read off the paper, but one
177
- * drawn again over the very same symbols is kept as it stands, with its
178
- * identifier and whatever was written on it.
179
- *
180
- * The child's own text is what it shows less what the parent hands
181
- * down, so that connecting two versions already connected collates the
182
- * child's symbols and not the parent's with themselves.
183
- */
184
- export declare const connectVersions: (view: EditionView, childId: string, parentId: string, tolerance?: ObjectAssumption<CollationTolerance>) => EditionOp;
185
- /**
186
- * Folds the version's own symbols into those it inherits and collates
187
- * with: the carriers pass over, and the insertions go. Collates at the
188
- * tolerance of the derivation, where the caller names none.
189
- */
190
- export declare const collateSymbols: (view: EditionView, versionId: string, symbolIds: readonly string[], tolerance?: CollationTolerance) => EditionOp;
191
- /**
192
- * Takes the named copies' reading of a symbol back out of the symbol it
193
- * was collated into: their carriers pass to a new symbol of the
194
- * version's own, the remaining copies keep the symbol they had, and the
195
- * version states the exchange.
196
- *
197
- * This is the inverse of the hand-over a collation makes, and it is
198
- * what lets a derivation be collated a second time. A collated symbol
199
- * is one symbol carrying every copy that reads it, so nothing else
200
- * takes the two readings apart again, and without that a tolerance
201
- * arrived at after the fact could never be applied.
202
- *
203
- * The copies named are one **side** of the derivation, the same side a
204
- * window is measured over, and `sidesOf` is what says which they are.
205
- * Naming one copy of a side that has several does not separate that
206
- * side: what stays behind is the rest of it, mixed with the other
207
- * side's copies, and a collation then compares one copy against that
208
- * mixture rather than the two texts against each other.
209
- *
210
- * Symbols the named copies alone carry are already the version's own
211
- * and are passed over, so a reading somebody has separated by hand
212
- * keeps its identifier and the edit that speaks for it. Named symbols
213
- * narrow the act to those; naming none separates the whole reading.
214
- */
215
- export declare const separateReadings: (view: EditionView, versionId: string, copies: ReadonlySet<string>, symbolIds?: readonly string[]) => EditionOp;
216
- /**
217
- * Makes the version stand on its own: what it inherited becomes its
218
- * own insertions, and its derivations go, the hypotheses among them,
219
- * with the motivations that belonged to them.
220
- */
221
- export declare const detachVersion: (view: EditionView, versionId: string) => EditionOp;
222
- /**
223
- * Takes the version out. Whatever read its text against it comes to
224
- * stand on its own, a hypothesis that something derives from it goes,
225
- * and so does a copy's statement that it carries the version.
226
- */
227
- export declare const removeVersion: (view: EditionView, versionId: string) => EditionOp;
228
- /** Takes the symbols out of the version's own insertions, and the edits that had nothing else. */
229
- export declare const removeSymbols: (versionId: string, symbolIds: readonly string[]) => EditionOp;
230
- /** Moves the edits into a new version based on this one. */
231
- export declare const deriveVersion: (versionId: string, editIds: readonly string[]) => EditionOp;
232
- /**
233
- * States that the version may also derive from the parent, beside what
234
- * it derives from already: a hypothesis, such as a contamination, under
235
- * the belief given. The text stays read against the principal derivation
236
- * unless the belief holds this one more certain. A version derives from
237
- * itself, or twice from one parent, in no statement.
238
- */
239
- export declare const stateDerivation: (versionId: string, parentId: string, belief?: Belief) => EditionOp;
240
- /** Takes back the hypothesis that the version derives from the parent; the principal derivation goes with `detachVersion`. */
241
- export declare const clearDerivation: (versionId: string, parentId: string) => EditionOp;
242
- /**
243
- * Replaces the edits with a single one carrying all their insertions
244
- * and deletions, classified by a guess at what the exchange does.
245
- */
246
- export declare const mergeEdits: (view: EditionView, versionId: string, toMerge: readonly Edit[]) => EditionOp;
247
- /** Replaces the edit with one edit per inserted and one per deleted symbol. */
248
- export declare const splitEdit: (versionId: string, toSplit: Edit) => EditionOp;
249
- /** States how the follower is placed relative to the reference, in place of any earlier statement. */
250
- export declare const placeCommand: (view: EditionView, followerId: string, referenceId: string, relation: PlacementRelation) => EditionOp;
251
- export declare const unplaceCommand: (view: EditionView, followerId: string) => EditionOp;
252
- /** The pair is stated on `statingId` only, as the format asks. */
253
- export declare const pairCommands: (view: EditionView, statingId: string, partnerId: string) => EditionOp;
254
- export declare const unpairCommand: (view: EditionView, statingId: string) => EditionOp;
255
- /** Annotates the assumption at the path with a belief held true, for reasons to be added. */
256
- export declare const createBelief: (path: Path) => EditionOp;
257
- export declare const clearBelief: (path: Path) => EditionOp;
258
- export declare const setCertainty: (path: Path, certainty: Certainty) => EditionOp;
259
- export declare const addReason: (path: Path, reason: AnyArgumentation) => EditionOp;
260
- export declare const removeReason: (path: Path, index: number) => EditionOp;