linked-rolls 0.70.0 → 0.71.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 (125) hide show
  1. package/README.md +20 -5
  2. package/lib/analysis/constraints.d.ts +7 -0
  3. package/lib/analysis/constraints.js +1 -0
  4. package/lib/analysis/ownPaper.d.ts +5 -1
  5. package/lib/analysis/ownPaper.js +5 -1
  6. package/lib/analysis/paper.d.ts +22 -4
  7. package/lib/analysis/paper.js +6 -0
  8. package/lib/analysis/reservations.d.ts +24 -1
  9. package/lib/analysis/reservations.js +15 -1
  10. package/lib/analysis/sigla.d.ts +6 -1
  11. package/lib/analysis/sigla.js +5 -1
  12. package/lib/analysis/stemma.d.ts +6 -1
  13. package/lib/analysis/stemma.js +6 -1
  14. package/lib/analysis/text.d.ts +16 -2
  15. package/lib/analysis/text.js +16 -2
  16. package/lib/analysis/witnesses.d.ts +20 -1
  17. package/lib/analysis/witnesses.js +4 -0
  18. package/lib/collation/Collation.d.ts +47 -8
  19. package/lib/collation/Collation.js +29 -5
  20. package/lib/collation/alignment.d.ts +16 -3
  21. package/lib/collation/alignment.js +15 -3
  22. package/lib/collation/scatter.d.ts +50 -9
  23. package/lib/collation/scatter.js +11 -1
  24. package/lib/collation/statistics.d.ts +39 -9
  25. package/lib/collation/statistics.js +27 -6
  26. package/lib/collation/substitution.d.ts +5 -0
  27. package/lib/collation/substitution.js +4 -0
  28. package/lib/emulation/Emulation.d.ts +16 -1
  29. package/lib/emulation/Emulation.js +10 -0
  30. package/lib/emulation/negotiation.d.ts +1 -0
  31. package/lib/emulation/negotiation.js +1 -0
  32. package/lib/index.d.ts +33 -2
  33. package/lib/index.js +2 -1
  34. package/lib/io/asJsonLd.d.ts +10 -0
  35. package/lib/io/asJsonLd.js +10 -0
  36. package/lib/io/context.d.ts +16 -2
  37. package/lib/io/context.js +16 -2
  38. package/lib/io/importJsonLd.d.ts +1 -0
  39. package/lib/io/importJsonLd.js +1 -0
  40. package/lib/io/migrate.d.ts +8 -0
  41. package/lib/io/migrate.js +8 -0
  42. package/lib/lookup/lookup.d.ts +29 -5
  43. package/lib/lookup/lookup.js +29 -5
  44. package/lib/lookup/paths.d.ts +23 -3
  45. package/lib/lookup/paths.js +17 -3
  46. package/lib/model/Agent.d.ts +28 -2
  47. package/lib/model/Agent.js +15 -1
  48. package/lib/model/Assumption.d.ts +96 -7
  49. package/lib/model/Assumption.js +65 -7
  50. package/lib/model/ConditionState.d.ts +1 -0
  51. package/lib/model/Edit.d.ts +10 -0
  52. package/lib/model/Edit.js +8 -0
  53. package/lib/model/Edition.d.ts +11 -0
  54. package/lib/model/Edition.js +1 -0
  55. package/lib/model/Feature.d.ts +74 -7
  56. package/lib/model/Feature.js +41 -3
  57. package/lib/model/FeatureSource.d.ts +14 -1
  58. package/lib/model/FeatureSource.js +7 -1
  59. package/lib/model/Perforator.d.ts +10 -0
  60. package/lib/model/Perforator.js +1 -0
  61. package/lib/model/Quantity.d.ts +160 -13
  62. package/lib/model/Quantity.js +110 -6
  63. package/lib/model/RollCopy.d.ts +74 -12
  64. package/lib/model/RollCopy.js +53 -10
  65. package/lib/model/Symbol.d.ts +38 -1
  66. package/lib/model/Symbol.js +16 -0
  67. package/lib/model/TrackCalibration.d.ts +10 -2
  68. package/lib/model/TrackCalibration.js +9 -2
  69. package/lib/model/Version.d.ts +24 -4
  70. package/lib/model/Version.js +19 -4
  71. package/lib/model/notes.d.ts +15 -2
  72. package/lib/model/notes.js +9 -2
  73. package/lib/model/procedures.d.ts +5 -1
  74. package/lib/model/procedures.js +5 -1
  75. package/lib/model/vocabulary.d.ts +6 -1
  76. package/lib/model/vocabulary.js +6 -1
  77. package/lib/ops/beliefs.d.ts +23 -1
  78. package/lib/ops/beliefs.js +23 -1
  79. package/lib/ops/collation.d.ts +3 -0
  80. package/lib/ops/collation.js +3 -0
  81. package/lib/ops/commands.d.ts +17 -2
  82. package/lib/ops/commands.js +17 -2
  83. package/lib/ops/copies.d.ts +37 -6
  84. package/lib/ops/copies.js +37 -6
  85. package/lib/ops/draft.d.ts +2 -0
  86. package/lib/ops/draft.js +1 -0
  87. package/lib/ops/edits.d.ts +5 -1
  88. package/lib/ops/edits.js +5 -1
  89. package/lib/ops/features.d.ts +12 -1
  90. package/lib/ops/features.js +7 -0
  91. package/lib/ops/versions.d.ts +15 -3
  92. package/lib/ops/versions.js +15 -3
  93. package/lib/readers/phillipsEroll.d.ts +12 -1
  94. package/lib/readers/phillipsEroll.js +6 -1
  95. package/lib/readers/spencerBar.d.ts +12 -1
  96. package/lib/readers/spencerBar.js +7 -1
  97. package/lib/readers/stanfordAton.d.ts +15 -0
  98. package/lib/readers/stanfordAton.js +9 -0
  99. package/lib/schema.json +10 -0
  100. package/lib/shared/utils.d.ts +12 -0
  101. package/lib/spec/context.json +4 -0
  102. package/lib/systems/ReproducingSystem.d.ts +46 -3
  103. package/lib/systems/TrackerBar.d.ts +45 -4
  104. package/lib/systems/TrackerBar.js +20 -3
  105. package/lib/systems/index.d.ts +9 -2
  106. package/lib/systems/index.js +9 -2
  107. package/lib/systems/velocity.d.ts +1 -0
  108. package/lib/systems/velocity.js +1 -0
  109. package/lib/systems/welte.d.ts +18 -3
  110. package/lib/systems/welte.js +9 -2
  111. package/lib/systems/welteLicensee/bar.d.ts +1 -0
  112. package/lib/systems/welteLicensee/bar.js +1 -0
  113. package/lib/systems/welteLicensee/system.d.ts +18 -0
  114. package/lib/systems/welteLicensee/system.js +17 -0
  115. package/lib/systems/welteT100/bar.d.ts +8 -0
  116. package/lib/systems/welteT100/bar.js +4 -0
  117. package/lib/systems/welteT100/system.d.ts +46 -5
  118. package/lib/systems/welteT100/system.js +29 -3
  119. package/lib/systems/welteT98/bar.d.ts +6 -0
  120. package/lib/systems/welteT98/bar.js +2 -0
  121. package/lib/systems/welteT98/system.d.ts +58 -5
  122. package/lib/systems/welteT98/system.js +42 -3
  123. package/lib/validate.d.ts +16 -0
  124. package/lib/validate.js +15 -0
  125. package/package.json +2 -1
package/lib/ops/copies.js CHANGED
@@ -13,6 +13,7 @@ import { featureIdsOf, carriedOnlyOn, forgetFeatures } from "./forget.js";
13
13
  * inserts every symbol the copy's own tracker bar reads on it. The
14
14
  * version is a reading in that system's words, so it is coded for the
15
15
  * system the copy was cut for.
16
+ * @category Operations
16
17
  */
17
18
  export const createVersion = (copy) => draft => {
18
19
  const bar = barOf(copy);
@@ -28,6 +29,7 @@ export const createVersion = (copy) => draft => {
28
29
  * Puts the copy into the edition without a version of its own, as for a
29
30
  * copy whose features are not read into symbols: one known only from a
30
31
  * recording states instead which versions it carries.
32
+ * @category Operations
31
33
  */
32
34
  export const addCopy = (copy) => draft => {
33
35
  draft.copies.push(copy);
@@ -38,6 +40,7 @@ export const addCopy = (copy) => draft => {
38
40
  * copy, or where the copy is the reference itself. The copy is read at
39
41
  * its own places whatever alignment it has, and through its own bar,
40
42
  * which is what lets a copy cut for another system be aligned at all.
43
+ * @category Operations
41
44
  */
42
45
  export const alignmentFor = (edition, copy, date = new Date()) => {
43
46
  const reference = referenceCopyOf(edition);
@@ -62,6 +65,7 @@ export const alignmentFor = (edition, copy, date = new Date()) => {
62
65
  * its features and tears onto the axis by them, in place of any
63
66
  * alignment it had. A copy that shares no run of notes with the
64
67
  * reference copy is left as it was.
68
+ * @category Operations
65
69
  */
66
70
  export const alignCopy = (copyId, date = new Date()) => draft => {
67
71
  const state = stateOf(draft);
@@ -75,6 +79,7 @@ export const alignCopy = (copyId, date = new Date()) => draft => {
75
79
  * Aligns every copy that has features with the reference copy, as
76
80
  * `alignCopy` does one. The reference copy itself is taken off any
77
81
  * alignment it had, its places being the axis.
82
+ * @category Operations
78
83
  */
79
84
  export const alignCopies = (date = new Date()) => draft => {
80
85
  const reference = referenceCopyOf(stateOf(draft));
@@ -100,6 +105,7 @@ export const alignCopies = (date = new Date()) => draft => {
100
105
  * aligns every other copy onto it. Every place the edition gives along
101
106
  * the roll moves with this, which is why it is a choice and not
102
107
  * something worked out.
108
+ * @category Operations
103
109
  */
104
110
  export const chooseReferenceCopy = (copyId, date = new Date()) => draft => {
105
111
  if (!draft.copies.some(copy => copy.id === copyId))
@@ -111,6 +117,7 @@ export const chooseReferenceCopy = (copyId, date = new Date()) => draft => {
111
117
  * Puts the copy's features back where they were measured, off the
112
118
  * axis. What the alignments say about the paper goes with it, since
113
119
  * that is worked out from them.
120
+ * @category Operations
114
121
  */
115
122
  export const unalignCopy = (copyId) => onCopy(copyId, copy => {
116
123
  revertAlignment(copy);
@@ -119,19 +126,32 @@ export const unalignCopy = (copyId) => onCopy(copyId, copy => {
119
126
  * Takes the extension a pneumatic reader adds off the ends of the
120
127
  * copy's chains of holes, and records how much was taken, so that their lengths
121
128
  * can be compared with a scanned copy's at all.
129
+ * @category Operations
122
130
  */
123
131
  export const shortenCopy = (copyId, extension, leaving) => onCopy(copyId, copy => shortenChains(extension, copy, leaving));
124
- /** Puts the reader's extension back on the copy's chains of holes. */
132
+ /**
133
+ * Puts the reader's extension back on the copy's chains of holes.
134
+ * @category Operations
135
+ */
125
136
  export const unshortenCopy = (copyId) => onCopy(copyId, copy => revertShortening(copy));
126
- /** States what the copy's features were read from, in place of any earlier statement. */
137
+ /**
138
+ * States what the copy's features were read from, in place of any earlier statement.
139
+ * @category Operations
140
+ */
127
141
  export const stateSource = (copyId, source) => onCopy(copyId, copy => {
128
142
  copy.readFrom = source;
129
143
  });
130
- /** Takes back the statement, leaving the copy silent about its source again. */
144
+ /**
145
+ * Takes back the statement, leaving the copy silent about its source again.
146
+ * @category Operations
147
+ */
131
148
  export const clearSource = (copyId) => onCopy(copyId, copy => {
132
149
  copy.readFrom = undefined;
133
150
  });
134
- /** Gives the copy the siglum it is referred to by, or takes it away where the siglum given is blank. */
151
+ /**
152
+ * Gives the copy the siglum it is referred to by, or takes it away where the siglum given is blank.
153
+ * @category Operations
154
+ */
135
155
  export const nameCopy = (copyId, siglum) => onCopy(copyId, copy => {
136
156
  const trimmed = siglum.trim();
137
157
  if (trimmed)
@@ -156,6 +176,7 @@ export const dropStatements = (copy, matches) => {
156
176
  * one known only from a recording, and `carriageProblems` reports it
157
177
  * where features carry symbols already. A second statement about one
158
178
  * version is none.
179
+ * @category Operations
159
180
  */
160
181
  export const stateCarriage = (copyId, versionId, belief) => onCopy(copyId, copy => {
161
182
  const statements = stateOf(copy).carries ?? [];
@@ -163,13 +184,17 @@ export const stateCarriage = (copyId, versionId, belief) => onCopy(copyId, copy
163
184
  return;
164
185
  copy.carries = [...statements, referenceHeld(versionId, belief)];
165
186
  });
166
- /** Takes back the copy's statement that it carries the version. */
187
+ /**
188
+ * Takes back the copy's statement that it carries the version.
189
+ * @category Operations
190
+ */
167
191
  export const clearCarriage = (copyId, versionId) => onCopy(copyId, copy => dropStatements(copy, statement => idOf(statement) === versionId));
168
192
  /**
169
193
  * Adds a general condition to the copy, beside whatever is stated of it
170
194
  * already. A paper stretch is added the same way, where one was
171
195
  * measured; what the alignments say of the paper is worked out from
172
196
  * them and stated nowhere.
197
+ * @category Operations
173
198
  */
174
199
  export const addGeneralCondition = (copyId, condition) => onCopy(copyId, copy => {
175
200
  copy.conditions.push(condition);
@@ -179,6 +204,7 @@ export const addGeneralCondition = (copyId, condition) => onCopy(copyId, copy =>
179
204
  * what was stated before; given nothing, it takes the statement away. A
180
205
  * copy has one paper, so it has one such condition, which may give a
181
206
  * strain in either direction.
207
+ * @category Operations
182
208
  */
183
209
  export const statePaperStretch = (copyId, stretch) => onCopy(copyId, copy => {
184
210
  copy.conditions = [...without(copy.conditions, isPaperStretch), ...(stretch ? [stretch] : [])];
@@ -187,11 +213,15 @@ export const statePaperStretch = (copyId, stretch) => onCopy(copyId, copy => {
187
213
  * Adds a tear to the copy, beside whatever is stated of it already. The
188
214
  * tear is given on the axis, where the copy's features stand, and moves
189
215
  * with them from then on.
216
+ * @category Operations
190
217
  */
191
218
  export const addTear = (copyId, tear) => onCopy(copyId, copy => {
192
219
  copy.conditions.push(tear);
193
220
  });
194
- /** The symbols of the versions that no other copy carries. */
221
+ /**
222
+ * The symbols of the versions that no other copy carries.
223
+ * @category Operations
224
+ */
195
225
  export const symbolsCarriedOnlyBy = (edition, copyId) => {
196
226
  const copy = edition.copies.find(c => c.id === copyId);
197
227
  return copy ? insertedIn(edition.versions).filter(carriedOnlyOn(featureIdsOf(copy))) : [];
@@ -200,6 +230,7 @@ export const symbolsCarriedOnlyBy = (edition, copyId) => {
200
230
  * Takes the copy out of the edition together with the symbols only it
201
231
  * carries, and with every reference the versions and the argumentations
202
232
  * made to those symbols.
233
+ * @category Operations
203
234
  */
204
235
  export const removeCopy = (copyId) => onCopy(copyId, (copy, draft) => {
205
236
  forgetFeatures(draft, featureIdsOf(copy));
@@ -15,6 +15,7 @@ import { WithId } from "../shared/utils.js";
15
15
  * (`reading`) and does all its writing in the one function it builds
16
16
  * from that. Where operations run one after another on one draft, each
17
17
  * reads what the ones before it wrote.
18
+ * @category Operations
18
19
  */
19
20
  export type EditionOp = (draft: Draft<Edition>) => void;
20
21
  export declare const noChange: EditionOp;
@@ -33,6 +34,7 @@ export declare const reading: (build: (edition: Edition) => EditionOp) => Editio
33
34
  * The state a draft stands at, as plain data. Reading a draft proxies
34
35
  * everything it touches, so what is only read is read from this, and
35
36
  * what is looked up in an edition is looked up in this (`takenOf`).
37
+ * @category Lookups
36
38
  */
37
39
  export declare const stateOf: <T>(draft: Draft<T>) => T;
38
40
  /** The ids of the items the rewriting left out. */
package/lib/ops/draft.js CHANGED
@@ -35,6 +35,7 @@ export const reading = (build) => draft => build(stateOf(draft))(draft);
35
35
  * The state a draft stands at, as plain data. Reading a draft proxies
36
36
  * everything it touches, so what is only read is read from this, and
37
37
  * what is looked up in an edition is looked up in this (`takenOf`).
38
+ * @category Lookups
38
39
  */
39
40
  export const stateOf = (draft) => isDraft(draft) ? takenOf(draft) : draft;
40
41
  /** The ids of the items the rewriting left out. */
@@ -3,7 +3,11 @@ import { EditionOp } from "./draft.js";
3
3
  /**
4
4
  * Replaces the edits with a single one carrying all their insertions
5
5
  * and deletions, classified by a guess at what the exchange does.
6
+ * @category Operations
6
7
  */
7
8
  export declare const mergeEdits: (versionId: string, toMerge: readonly Edit[]) => EditionOp;
8
- /** Replaces the edit with one edit per inserted and one per deleted symbol. */
9
+ /**
10
+ * Replaces the edit with one edit per inserted and one per deleted symbol.
11
+ * @category Operations
12
+ */
9
13
  export declare const splitEdit: (versionId: string, toSplit: Edit) => EditionOp;
package/lib/ops/edits.js CHANGED
@@ -63,6 +63,7 @@ const guessEditType = (edition, versionId, edit) => {
63
63
  /**
64
64
  * Replaces the edits with a single one carrying all their insertions
65
65
  * and deletions, classified by a guess at what the exchange does.
66
+ * @category Operations
66
67
  */
67
68
  export const mergeEdits = (versionId, toMerge) => reading(edition => {
68
69
  if (toMerge.length === 0)
@@ -79,7 +80,10 @@ export const mergeEdits = (versionId, toMerge) => reading(edition => {
79
80
  version.edits = [...editsOf(version).filter(edit => !mergedIds.has(edit.id)), merged];
80
81
  });
81
82
  });
82
- /** Replaces the edit with one edit per inserted and one per deleted symbol. */
83
+ /**
84
+ * Replaces the edit with one edit per inserted and one per deleted symbol.
85
+ * @category Operations
86
+ */
83
87
  export const splitEdit = (versionId, toSplit) => {
84
88
  const parts = [
85
89
  ...(toSplit.insert ?? []).map(insertion),
@@ -6,6 +6,7 @@ import { EditionOp } from "./draft.js";
6
6
  * States the condition of the feature, in place of any earlier
7
7
  * statement. Throws where the kind of feature is in no such condition;
8
8
  * `conditions` says which conditions each kind of feature may be in.
9
+ * @category Operations
9
10
  */
10
11
  export declare const stateFeatureCondition: (copyId: string, featureId: string, condition: FeatureConditionAssignment) => EditionOp;
11
12
  /**
@@ -13,6 +14,7 @@ export declare const stateFeatureCondition: (copyId: string, featureId: string,
13
14
  * copy, the act that brought another feature about, or, where neither
14
15
  * is said, an act of its own for the purpose given. A patch is never
15
16
  * punched, being glued on, so `punched` says nothing of one.
17
+ * @category Operations
16
18
  */
17
19
  export interface FeatureAct {
18
20
  /** The copy came from its punching with it, which is where a reading of a scan puts every chain of holes. */
@@ -28,12 +30,14 @@ export interface FeatureAct {
28
30
  * produced, by the punching or by a later act. Which act, `FeatureAct`
29
31
  * says; a `beside` that names nothing the copy bears is passed over and
30
32
  * the feature goes into an act of its own.
33
+ * @category Operations
31
34
  */
32
35
  export declare const addFeature: (copyId: string, feature: FeatureOrPatch, act?: FeatureAct) => EditionOp;
33
36
  /**
34
37
  * States that the patch bears the feature. What a patch bears came onto
35
38
  * the copy with the patch, so it belongs to no act of its own and
36
39
  * states no place: it stands where the patch stands.
40
+ * @category Operations
37
41
  */
38
42
  export declare const addBorneFeature: (copyId: string, patchId: string, feature: NestedFeature) => EditionOp;
39
43
  /**
@@ -42,9 +46,13 @@ export declare const addBorneFeature: (copyId: string, patchId: string, feature:
42
46
  * a patch goes with everything glued onto it, and a feature of a patch
43
47
  * may be taken back on its own, the patch staying where it is. An act
44
48
  * left having produced or added nothing goes as well.
49
+ * @category Operations
45
50
  */
46
51
  export declare const removeFeatures: (copyId: string, featureIds: readonly string[]) => EditionOp;
47
- /** Why several features cannot be replaced by one. */
52
+ /**
53
+ * Why several features cannot be replaced by one.
54
+ * @category Operations
55
+ */
48
56
  export type MergeObstacle = 'fewer-than-two' | 'different-types' | 'different-tracks' | 'differing-conditions' | 'unlike-features' | 'different-acts';
49
57
  /**
50
58
  * What stands in the way of reading the features as one, or nothing
@@ -53,6 +61,7 @@ export type MergeObstacle = 'fewer-than-two' | 'different-types' | 'different-tr
53
61
  * condition at most one of them states. How far apart they lie is not
54
62
  * asked: whether a gap is a bridge of the perforator, a tear or two
55
63
  * perforations of their own is the editor's reading.
64
+ * @category Operations
56
65
  */
57
66
  export declare const mergeObstacle: (features: readonly FeatureOrPatch[]) => MergeObstacle | undefined;
58
67
  /**
@@ -61,6 +70,7 @@ export declare const mergeObstacle: (features: readonly FeatureOrPatch[]) => Mer
61
70
  * features themselves say, which cannot reach `different-acts`: one
62
71
  * feature is the work of one act, and where the features stand is the
63
72
  * edition's business rather than theirs.
73
+ * @category Operations
64
74
  */
65
75
  export declare const mergeObstacleIn: (edition: Edition, featureIds: readonly string[]) => MergeObstacle | undefined;
66
76
  /**
@@ -80,5 +90,6 @@ export declare const mergeObstacleIn: (edition: Edition, featureIds: readonly st
80
90
  *
81
91
  * Throws where the features cannot stand for one; `mergeObstacle`
82
92
  * says beforehand whether they can.
93
+ * @category Operations
83
94
  */
84
95
  export declare const mergeFeatures: (copyId: string, featureIds: readonly string[]) => EditionOp;
@@ -20,6 +20,7 @@ const allows = (feature, condition) => {
20
20
  * States the condition of the feature, in place of any earlier
21
21
  * statement. Throws where the kind of feature is in no such condition;
22
22
  * `conditions` says which conditions each kind of feature may be in.
23
+ * @category Operations
23
24
  */
24
25
  export const stateFeatureCondition = (copyId, featureId, condition) => onFeature(copyId, featureId, feature => {
25
26
  if (!allows(feature, condition)) {
@@ -108,6 +109,7 @@ const actFor = (copy, patch, act) => {
108
109
  * produced, by the punching or by a later act. Which act, `FeatureAct`
109
110
  * says; a `beside` that names nothing the copy bears is passed over and
110
111
  * the feature goes into an act of its own.
112
+ * @category Operations
111
113
  */
112
114
  export const addFeature = (copyId, feature, act = {}) => onCopy(copyId, copy => {
113
115
  actFor(copy, isPatch(feature), act).push(feature);
@@ -116,6 +118,7 @@ export const addFeature = (copyId, feature, act = {}) => onCopy(copyId, copy =>
116
118
  * States that the patch bears the feature. What a patch bears came onto
117
119
  * the copy with the patch, so it belongs to no act of its own and
118
120
  * states no place: it stands where the patch stands.
121
+ * @category Operations
119
122
  */
120
123
  export const addBorneFeature = (copyId, patchId, feature) => onCopy(copyId, copy => {
121
124
  const patch = featuresOf(copy).flatMap(withBorneFeatures).find(borne => borne.id === patchId);
@@ -131,6 +134,7 @@ export const addBorneFeature = (copyId, patchId, feature) => onCopy(copyId, copy
131
134
  * a patch goes with everything glued onto it, and a feature of a patch
132
135
  * may be taken back on its own, the patch staying where it is. An act
133
136
  * left having produced or added nothing goes as well.
137
+ * @category Operations
134
138
  */
135
139
  export const removeFeatures = (copyId, featureIds) => onCopy(copyId, (copy, draft) => {
136
140
  const named = new Set(featureIds);
@@ -172,6 +176,7 @@ const conditionsOf = (features) => features.flatMap(feature => feature.condition
172
176
  * condition at most one of them states. How far apart they lie is not
173
177
  * asked: whether a gap is a bridge of the perforator, a tear or two
174
178
  * perforations of their own is the editor's reading.
179
+ * @category Operations
175
180
  */
176
181
  export const mergeObstacle = (features) => {
177
182
  if (features.length < 2)
@@ -209,6 +214,7 @@ const obstacleIn = (copy, featureIds) => {
209
214
  * features themselves say, which cannot reach `different-acts`: one
210
215
  * feature is the work of one act, and where the features stand is the
211
216
  * edition's business rather than theirs.
217
+ * @category Operations
212
218
  */
213
219
  export const mergeObstacleIn = (edition, featureIds) => {
214
220
  const copy = featureIds.map(id => copyOfFeature(edition, id)).find(copy => copy !== undefined);
@@ -277,6 +283,7 @@ const carryOver = (draft, replaced, mergedId) => {
277
283
  *
278
284
  * Throws where the features cannot stand for one; `mergeObstacle`
279
285
  * says beforehand whether they can.
286
+ * @category Operations
280
287
  */
281
288
  export const mergeFeatures = (copyId, featureIds) => onCopy(copyId, (copy, draft) => {
282
289
  const state = stateOf(copy);
@@ -7,17 +7,25 @@ export declare const hypothesesBeside: (version: Readonly<Version>, parentId: st
7
7
  * Makes the version stand on its own: what it inherited becomes its
8
8
  * own insertions, and its derivations go, the hypotheses among them,
9
9
  * with the motivations that belonged to them.
10
+ * @category Operations
10
11
  */
11
12
  export declare const detachVersion: (versionId: string) => EditionOp;
12
13
  /**
13
14
  * Takes the version out. Whatever read its text against it comes to
14
15
  * stand on its own, a hypothesis that something derives from it goes,
15
16
  * and so does a copy's statement that it carries the version.
17
+ * @category Operations
16
18
  */
17
19
  export declare const removeVersion: (versionId: string) => EditionOp;
18
- /** Takes the symbols out of the version's own insertions, and the edits that had nothing else. */
20
+ /**
21
+ * Takes the symbols out of the version's own insertions, and the edits that had nothing else.
22
+ * @category Operations
23
+ */
19
24
  export declare const removeSymbols: (versionId: string, symbolIds: readonly string[]) => EditionOp;
20
- /** Moves the edits into a new version based on this one. */
25
+ /**
26
+ * Moves the edits into a new version based on this one.
27
+ * @category Operations
28
+ */
21
29
  export declare const deriveVersion: (versionId: string, editIds: readonly string[]) => EditionOp;
22
30
  /**
23
31
  * States that the version may also derive from the parent, beside what
@@ -26,7 +34,11 @@ export declare const deriveVersion: (versionId: string, editIds: readonly string
26
34
  * unless the belief holds this one more certain. A version derives from
27
35
  * itself, twice from one parent, or from one of its own descendants in
28
36
  * no statement.
37
+ * @category Operations
29
38
  */
30
39
  export declare const stateDerivation: (versionId: string, parentId: string, belief?: Belief) => EditionOp;
31
- /** Takes back the hypothesis that the version derives from the parent; the principal derivation goes with `detachVersion`. */
40
+ /**
41
+ * Takes back the hypothesis that the version derives from the parent; the principal derivation goes with `detachVersion`.
42
+ * @category Operations
43
+ */
32
44
  export declare const clearDerivation: (versionId: string, parentId: string) => EditionOp;
@@ -30,6 +30,7 @@ const dropDerivations = (version, matches) => {
30
30
  * Makes the version stand on its own: what it inherited becomes its
31
31
  * own insertions, and its derivations go, the hypotheses among them,
32
32
  * with the motivations that belonged to them.
33
+ * @category Operations
33
34
  */
34
35
  export const detachVersion = (versionId) => reading(edition => {
35
36
  const edits = snapshotOf(edition, versionId).map(insertion);
@@ -43,6 +44,7 @@ export const detachVersion = (versionId) => reading(edition => {
43
44
  * Takes the version out. Whatever read its text against it comes to
44
45
  * stand on its own, a hypothesis that something derives from it goes,
45
46
  * and so does a copy's statement that it carries the version.
47
+ * @category Operations
46
48
  */
47
49
  export const removeVersion = (versionId) => reading(edition => {
48
50
  const detachments = edition.versions
@@ -56,9 +58,15 @@ export const removeVersion = (versionId) => reading(edition => {
56
58
  draft.versions = without(draft.versions, version => version.id === versionId);
57
59
  };
58
60
  });
59
- /** Takes the symbols out of the version's own insertions, and the edits that had nothing else. */
61
+ /**
62
+ * Takes the symbols out of the version's own insertions, and the edits that had nothing else.
63
+ * @category Operations
64
+ */
60
65
  export const removeSymbols = (versionId, symbolIds) => onVersion(versionId, version => dropInsertions(version, new Set(symbolIds)));
61
- /** Moves the edits into a new version based on this one. */
66
+ /**
67
+ * Moves the edits into a new version based on this one.
68
+ * @category Operations
69
+ */
62
70
  export const deriveVersion = (versionId, editIds) => onVersion(versionId, (version, draft) => {
63
71
  const chosen = new Set(editIds);
64
72
  const moved = editsOf(version).filter(edit => chosen.has(edit.id));
@@ -79,6 +87,7 @@ export const deriveVersion = (versionId, editIds) => onVersion(versionId, (versi
79
87
  * unless the belief holds this one more certain. A version derives from
80
88
  * itself, twice from one parent, or from one of its own descendants in
81
89
  * no statement.
90
+ * @category Operations
82
91
  */
83
92
  export const stateDerivation = (versionId, parentId, belief) => onVersion(versionId, (version, draft) => {
84
93
  const derivations = stateOf(version).basedOn ?? [];
@@ -88,7 +97,10 @@ export const stateDerivation = (versionId, parentId, belief) => onVersion(versio
88
97
  return;
89
98
  version.basedOn = [...derivations, referenceHeld(parentId, belief)];
90
99
  });
91
- /** Takes back the hypothesis that the version derives from the parent; the principal derivation goes with `detachVersion`. */
100
+ /**
101
+ * Takes back the hypothesis that the version derives from the parent; the principal derivation goes with `detachVersion`.
102
+ * @category Operations
103
+ */
92
104
  export const clearDerivation = (versionId, parentId) => onVersion(versionId, version => {
93
105
  if (readsAgainst(stateOf(version), parentId))
94
106
  return;
@@ -49,8 +49,15 @@ import { Millimeters, Seconds } from "../model/Quantity.js";
49
49
  * The two rules collide on one number, the lowest note of the T-100
50
50
  * sharing 24 with the tenth position. Notes win there, the note block
51
51
  * being the larger claim; none of his samples uses the number at all.
52
+ * @category Sources
52
53
  */
53
54
  export declare const CONTROL_OFFSET: Readonly<Record<string, number>>;
55
+ /**
56
+ * How `readFromPhillipsEroll` reads a file: the bar it numbers its
57
+ * positions by, where its expression numbers sit, how time is put back
58
+ * onto the paper, and what the reader added to the chains.
59
+ * @category Sources
60
+ */
54
61
  export interface PhillipsErollOptions {
55
62
  /**
56
63
  * The bar the file numbers its positions by, which is the bar of
@@ -87,7 +94,11 @@ export interface PhillipsErollOptions {
87
94
  * Reads one of his e-roll files as a copy of the roll, in millimetres
88
95
  * of paper, on the bar it was cut for and in that bar's numbering. A
89
96
  * position the bar does not read is left out, as the bar would leave it.
97
+ * @category Sources
90
98
  */
91
99
  export declare function readFromPhillipsEroll(buffer: ArrayBuffer, { system, controlOffset, placeAt, extension }?: PhillipsErollOptions): RollCopy;
92
- /** The bars his files are known to be numbered by. */
100
+ /**
101
+ * The bars his files are known to be numbered by.
102
+ * @category Sources
103
+ */
93
104
  export declare const phillipsSystems: readonly TrackerBar[];
@@ -54,6 +54,7 @@ import { inMetersPerMinute, mm, seconds, track } from "../model/Quantity.js";
54
54
  * The two rules collide on one number, the lowest note of the T-100
55
55
  * sharing 24 with the tenth position. Notes win there, the note block
56
56
  * being the larger claim; none of his samples uses the number at all.
57
+ * @category Sources
57
58
  */
58
59
  export const CONTROL_OFFSET = {
59
60
  'welte-t100': 14,
@@ -133,6 +134,7 @@ const controlOffsetOf = (system, given) => {
133
134
  * Reads one of his e-roll files as a copy of the roll, in millimetres
134
135
  * of paper, on the bar it was cut for and in that bar's numbering. A
135
136
  * position the bar does not read is left out, as the bar would leave it.
137
+ * @category Sources
136
138
  */
137
139
  export function readFromPhillipsEroll(buffer, { system = welteT100, controlOffset, placeAt, extension } = {}) {
138
140
  const file = read(new Uint8Array(buffer));
@@ -173,5 +175,8 @@ export function readFromPhillipsEroll(buffer, { system = welteT100, controlOffse
173
175
  shortenChains(extension, copy);
174
176
  return copy;
175
177
  }
176
- /** The bars his files are known to be numbered by. */
178
+ /**
179
+ * The bars his files are known to be numbered by.
180
+ * @category Sources
181
+ */
177
182
  export const phillipsSystems = [welteT100, welteLicensee];
@@ -6,8 +6,14 @@ import { TrackerBar } from "../systems/TrackerBar.js";
6
6
  * 640 Hz), and the tempo counts tenths of a foot per minute, which puts
7
7
  * 400 rows on an inch. This is the file's own calibration; whether the
8
8
  * scanner kept it is for an alignment with other copies to tell.
9
+ * @category Sources
9
10
  */
10
11
  export declare const SPENCER_ROWS_PER_INCH = 400;
12
+ /**
13
+ * How `readFromSpencerBar` reads a file: the rows of its image on an
14
+ * inch of paper, and the bar it numbers its positions by.
15
+ * @category Sources
16
+ */
11
17
  export interface SpencerBarOptions {
12
18
  /** Rows of the image on an inch of paper. */
13
19
  rowsPerInch?: number;
@@ -21,13 +27,18 @@ export interface SpencerBarOptions {
21
27
  * Reads the copy on the bar it was cut for, whose numbering it keeps.
22
28
  * A chain on a position that bar does not read is left out, as the bar
23
29
  * would leave it.
30
+ * @category Sources
24
31
  */
25
32
  export declare function readFromSpencerBar(buffer: ArrayBuffer, { rowsPerInch, system }?: SpencerBarOptions): RollCopy;
26
33
  /**
27
34
  * The `.ann` file beside a `.bar` holds the player's settings for the
28
35
  * roll as lines of "/key: value": title, composer, pianist, roll
29
36
  * number and class, and the tempo the roll is played at.
37
+ * @category Sources
30
38
  */
31
39
  export declare const readSpencerAnn: (text: string) => ReadonlyMap<string, string>;
32
- /** The paper speed a `.ann` states through its roll tempo, where it states one. */
40
+ /**
41
+ * The paper speed a `.ann` states through its roll tempo, where it states one.
42
+ * @category Sources
43
+ */
33
44
  export declare const paperSpeedOfSpencerAnn: (ann: ReadonlyMap<string, string>) => PaperSpeed | undefined;
@@ -22,6 +22,7 @@ const END_OF_EVENTS = 0xFF;
22
22
  * 640 Hz), and the tempo counts tenths of a foot per minute, which puts
23
23
  * 400 rows on an inch. This is the file's own calibration; whether the
24
24
  * scanner kept it is for an alignment with other copies to tell.
25
+ * @category Sources
25
26
  */
26
27
  export const SPENCER_ROWS_PER_INCH = 400;
27
28
  const byteAt = (bytes, at) => {
@@ -82,6 +83,7 @@ const holesOf = (events) => {
82
83
  * Reads the copy on the bar it was cut for, whose numbering it keeps.
83
84
  * A chain on a position that bar does not read is left out, as the bar
84
85
  * would leave it.
86
+ * @category Sources
85
87
  */
86
88
  export function readFromSpencerBar(buffer, { rowsPerInch = SPENCER_ROWS_PER_INCH, system = welteLicensee } = {}) {
87
89
  const bytes = new Uint8Array(buffer);
@@ -121,6 +123,7 @@ export function readFromSpencerBar(buffer, { rowsPerInch = SPENCER_ROWS_PER_INCH
121
123
  * The `.ann` file beside a `.bar` holds the player's settings for the
122
124
  * roll as lines of "/key: value": title, composer, pianist, roll
123
125
  * number and class, and the tempo the roll is played at.
126
+ * @category Sources
124
127
  */
125
128
  export const readSpencerAnn = (text) => new Map(text.split(/\r?\n/)
126
129
  .map(line => line.match(/^\/(\w+):\s*(.*?)\s*$/))
@@ -128,7 +131,10 @@ export const readSpencerAnn = (text) => new Map(text.split(/\r?\n/)
128
131
  .map(([, key, value]) => [key, value]));
129
132
  /** A roll tempo counts tenths of a foot per minute: tempo 83 runs the roll at 8.3 feet a minute. */
130
133
  const TEMPO_PER_FOOT_PER_MINUTE = 10;
131
- /** The paper speed a `.ann` states through its roll tempo, where it states one. */
134
+ /**
135
+ * The paper speed a `.ann` states through its roll tempo, where it states one.
136
+ * @category Sources
137
+ */
132
138
  export const paperSpeedOfSpencerAnn = (ann) => {
133
139
  const tempo = parseFloat(ann.get('roll_tempo') ?? '');
134
140
  if (isNaN(tempo) || tempo <= 0)
@@ -1,6 +1,12 @@
1
1
  import { RollCopy } from "../model/RollCopy.js";
2
2
  import { TrackerBar } from "../systems/TrackerBar.js";
3
3
  import { Track } from "../model/Quantity.js";
4
+ /**
5
+ * How `readFromStanfordAton` reads an analysis file: how its hole
6
+ * numbering is shifted onto the tracker bar, which bar the roll was cut
7
+ * for, and where its scan can be seen.
8
+ * @category Sources
9
+ */
4
10
  export interface StanfordAtonOptions {
5
11
  /**
6
12
  * Added to the scanning software's hole numbering to reach the
@@ -21,4 +27,13 @@ export interface StanfordAtonOptions {
21
27
  */
22
28
  scan?: string;
23
29
  }
30
+ /**
31
+ * Reads a hole analysis of a scan, in the ATON format of Stanford's
32
+ * SUPRA collection, as a copy of the roll: its chains of holes in
33
+ * millimetres of paper on the bar it was cut for, its edge tears, its
34
+ * dimensions and hole separation as the analysis measured them, and how
35
+ * the scan relates to the bar. A position the bar does not read is left
36
+ * out, as the bar would leave it.
37
+ * @category Sources
38
+ */
24
39
  export declare function readFromStanfordAton(atonString: string, { trackShift, system, scan }?: StanfordAtonOptions): RollCopy;
@@ -139,6 +139,15 @@ const measurementOf = (rollinfo) => {
139
139
  const takenBy = (measurement) => (value) => measurement
140
140
  ? { ...value, '@annotation': { id: v4(), belief: { type: 'belief', id: v4(), certainty: 'true', reasons: [measurement] } } }
141
141
  : value;
142
+ /**
143
+ * Reads a hole analysis of a scan, in the ATON format of Stanford's
144
+ * SUPRA collection, as a copy of the roll: its chains of holes in
145
+ * millimetres of paper on the bar it was cut for, its edge tears, its
146
+ * dimensions and hole separation as the analysis measured them, and how
147
+ * the scan relates to the bar. A position the bar does not read is left
148
+ * out, as the bar would leave it.
149
+ * @category Sources
150
+ */
142
151
  export function readFromStanfordAton(atonString, { trackShift, system = welteT100, scan } = {}) {
143
152
  const parser = new AtonParser();
144
153
  const json = parser.parse(atonString);
package/lib/schema.json CHANGED
@@ -490,6 +490,7 @@
490
490
  "ontology": "lrmoo:R76 is derivative of"
491
491
  },
492
492
  "DriveId": {
493
+ "description": "The IRI of a drive the type vocabulary declares.",
493
494
  "enum": [
494
495
  "https://w3id.org/reo/type/drive/ram-head",
495
496
  "https://w3id.org/reo/type/drive/asynchronous"
@@ -927,6 +928,14 @@
927
928
  "description": "The person who carried out this activity.",
928
929
  "ontology": "crm:P14 carried out by"
929
930
  },
931
+ "applies": {
932
+ "description": "The rules the inference draws its conclusion by, by IRI: a regularity of how the rolls were edited, such as that the same addition at the same place is not made twice independently, a default, such as that copies were not made from two exemplars, or a method, such as how the tolerance of a collation is found. The rules are stated once where they are published, and each inference names those it follows, so that a reader can see what a conclusion rests on besides its premises, and which conclusions rest on a rule.",
933
+ "items": {
934
+ "type": "string"
935
+ },
936
+ "type": "array",
937
+ "ontology": "crminf:J3 applied"
938
+ },
930
939
  "note": {
931
940
  "description": "A free-text note providing additional context.",
932
941
  "type": "string",
@@ -3396,6 +3405,7 @@
3396
3405
  "ontology": "crmdig:D14 Software"
3397
3406
  },
3398
3407
  "SourceKind": {
3408
+ "description": "A kind of source a copy's features can be read from, from the paper itself to a sound recording of the copy being played.",
3399
3409
  "enum": [
3400
3410
  "roll",
3401
3411
  "scan",
@@ -1,4 +1,8 @@
1
1
  export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
2
+ /**
3
+ * An object that says by its type which kind of entity it is.
4
+ * @category Format types
5
+ */
2
6
  export type WithType<T extends string> = {
3
7
  /**
4
8
  * The type discriminator for this object.
@@ -6,6 +10,10 @@ export type WithType<T extends string> = {
6
10
  */
7
11
  readonly type: T;
8
12
  };
13
+ /**
14
+ * An object the edition identifies, so that others can refer to it.
15
+ * @category Format types
16
+ */
9
17
  export type WithId = {
10
18
  /**
11
19
  * A unique identifier for this object.
@@ -16,6 +24,10 @@ export type WithId = {
16
24
  export declare const isDateString: (value: unknown) => value is string;
17
25
  /** The items by the key each of them gives, every group in the order its first item came in. */
18
26
  export declare const groupBy: <T>(items: readonly T[], keyOf: (item: T) => string) => Map<string, T[]>;
27
+ /**
28
+ * An object that may carry a note in free text.
29
+ * @category Format types
30
+ */
19
31
  export type WithNote = {
20
32
  /**
21
33
  * A free-text note providing additional context.