linked-rolls 0.70.0 → 0.72.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.
- package/README.md +106 -5
- package/lib/analysis/constraints.d.ts +7 -0
- package/lib/analysis/constraints.js +1 -0
- package/lib/analysis/ownPaper.d.ts +5 -1
- package/lib/analysis/ownPaper.js +5 -1
- package/lib/analysis/paper.d.ts +22 -4
- package/lib/analysis/paper.js +6 -0
- package/lib/analysis/reservations.d.ts +24 -1
- package/lib/analysis/reservations.js +15 -1
- package/lib/analysis/sigla.d.ts +6 -1
- package/lib/analysis/sigla.js +5 -1
- package/lib/analysis/stemma.d.ts +6 -1
- package/lib/analysis/stemma.js +6 -1
- package/lib/analysis/text.d.ts +16 -2
- package/lib/analysis/text.js +16 -2
- package/lib/analysis/witnesses.d.ts +20 -1
- package/lib/analysis/witnesses.js +4 -0
- package/lib/collation/Collation.d.ts +47 -8
- package/lib/collation/Collation.js +29 -5
- package/lib/collation/alignment.d.ts +16 -3
- package/lib/collation/alignment.js +15 -3
- package/lib/collation/scatter.d.ts +50 -9
- package/lib/collation/scatter.js +11 -1
- package/lib/collation/statistics.d.ts +39 -9
- package/lib/collation/statistics.js +27 -6
- package/lib/collation/substitution.d.ts +5 -0
- package/lib/collation/substitution.js +4 -0
- package/lib/emulation/Emulation.d.ts +16 -1
- package/lib/emulation/Emulation.js +10 -0
- package/lib/emulation/negotiation.d.ts +1 -0
- package/lib/emulation/negotiation.js +1 -0
- package/lib/filiation/adoption.d.ts +47 -0
- package/lib/filiation/adoption.js +190 -0
- package/lib/filiation/changes.d.ts +33 -0
- package/lib/filiation/changes.js +38 -0
- package/lib/filiation/index.d.ts +12 -0
- package/lib/filiation/index.js +12 -0
- package/lib/filiation/presence.d.ts +50 -0
- package/lib/filiation/presence.js +122 -0
- package/lib/filiation/proposal.d.ts +132 -0
- package/lib/filiation/proposal.js +376 -0
- package/lib/filiation/readings.d.ts +108 -0
- package/lib/filiation/readings.js +281 -0
- package/lib/filiation/search.d.ts +113 -0
- package/lib/filiation/search.js +268 -0
- package/lib/filiation/systems.d.ts +21 -0
- package/lib/filiation/systems.js +39 -0
- package/lib/filiation/trees.d.ts +20 -0
- package/lib/filiation/trees.js +69 -0
- package/lib/index.d.ts +34 -2
- package/lib/index.js +3 -1
- package/lib/io/asJsonLd.d.ts +10 -0
- package/lib/io/asJsonLd.js +10 -0
- package/lib/io/context.d.ts +16 -2
- package/lib/io/context.js +16 -2
- package/lib/io/importJsonLd.d.ts +1 -0
- package/lib/io/importJsonLd.js +1 -0
- package/lib/io/migrate.d.ts +8 -0
- package/lib/io/migrate.js +8 -0
- package/lib/lookup/lookup.d.ts +29 -5
- package/lib/lookup/lookup.js +29 -5
- package/lib/lookup/paths.d.ts +23 -3
- package/lib/lookup/paths.js +17 -3
- package/lib/model/Agent.d.ts +28 -2
- package/lib/model/Agent.js +15 -1
- package/lib/model/Assumption.d.ts +96 -7
- package/lib/model/Assumption.js +65 -7
- package/lib/model/ConditionState.d.ts +1 -0
- package/lib/model/Edit.d.ts +10 -0
- package/lib/model/Edit.js +8 -0
- package/lib/model/Edition.d.ts +11 -0
- package/lib/model/Edition.js +1 -0
- package/lib/model/Feature.d.ts +74 -7
- package/lib/model/Feature.js +41 -3
- package/lib/model/FeatureSource.d.ts +14 -1
- package/lib/model/FeatureSource.js +7 -1
- package/lib/model/Perforator.d.ts +10 -0
- package/lib/model/Perforator.js +1 -0
- package/lib/model/Quantity.d.ts +160 -13
- package/lib/model/Quantity.js +110 -6
- package/lib/model/RollCopy.d.ts +74 -12
- package/lib/model/RollCopy.js +53 -10
- package/lib/model/Symbol.d.ts +38 -1
- package/lib/model/Symbol.js +16 -0
- package/lib/model/TrackCalibration.d.ts +10 -2
- package/lib/model/TrackCalibration.js +9 -2
- package/lib/model/Version.d.ts +24 -4
- package/lib/model/Version.js +19 -4
- package/lib/model/notes.d.ts +15 -2
- package/lib/model/notes.js +9 -2
- package/lib/model/procedures.d.ts +5 -1
- package/lib/model/procedures.js +5 -1
- package/lib/model/vocabulary.d.ts +6 -1
- package/lib/model/vocabulary.js +6 -1
- package/lib/ops/beliefs.d.ts +23 -1
- package/lib/ops/beliefs.js +23 -1
- package/lib/ops/collation.d.ts +3 -0
- package/lib/ops/collation.js +3 -0
- package/lib/ops/commands.d.ts +17 -2
- package/lib/ops/commands.js +17 -2
- package/lib/ops/copies.d.ts +37 -6
- package/lib/ops/copies.js +37 -6
- package/lib/ops/draft.d.ts +2 -0
- package/lib/ops/draft.js +1 -0
- package/lib/ops/edits.d.ts +5 -1
- package/lib/ops/edits.js +5 -1
- package/lib/ops/features.d.ts +12 -1
- package/lib/ops/features.js +7 -0
- package/lib/ops/versions.d.ts +15 -3
- package/lib/ops/versions.js +15 -3
- package/lib/readers/phillipsEroll.d.ts +12 -1
- package/lib/readers/phillipsEroll.js +6 -1
- package/lib/readers/spencerBar.d.ts +12 -1
- package/lib/readers/spencerBar.js +7 -1
- package/lib/readers/stanfordAton.d.ts +15 -0
- package/lib/readers/stanfordAton.js +9 -0
- package/lib/schema.json +10 -0
- package/lib/shared/utils.d.ts +12 -0
- package/lib/spec/context.json +4 -0
- package/lib/systems/ReproducingSystem.d.ts +46 -3
- package/lib/systems/TrackerBar.d.ts +45 -4
- package/lib/systems/TrackerBar.js +20 -3
- package/lib/systems/index.d.ts +9 -2
- package/lib/systems/index.js +9 -2
- package/lib/systems/velocity.d.ts +1 -0
- package/lib/systems/velocity.js +1 -0
- package/lib/systems/welte.d.ts +18 -3
- package/lib/systems/welte.js +9 -2
- package/lib/systems/welteLicensee/bar.d.ts +1 -0
- package/lib/systems/welteLicensee/bar.js +1 -0
- package/lib/systems/welteLicensee/system.d.ts +18 -0
- package/lib/systems/welteLicensee/system.js +17 -0
- package/lib/systems/welteT100/bar.d.ts +8 -0
- package/lib/systems/welteT100/bar.js +4 -0
- package/lib/systems/welteT100/system.d.ts +46 -5
- package/lib/systems/welteT100/system.js +29 -3
- package/lib/systems/welteT98/bar.d.ts +6 -0
- package/lib/systems/welteT98/bar.js +2 -0
- package/lib/systems/welteT98/system.d.ts +58 -5
- package/lib/systems/welteT98/system.js +42 -3
- package/lib/validate.d.ts +16 -0
- package/lib/validate.js +15 -0
- package/package.json +2 -1
package/lib/model/Edit.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Assumption } from "./Assumption.js";
|
|
2
2
|
import { AnySymbol } from "./Symbol.js";
|
|
3
3
|
import { WithId } from "../shared/utils.js";
|
|
4
|
+
/**
|
|
5
|
+
* The types of editorial change an edit may state.
|
|
6
|
+
* @category Vocabulary
|
|
7
|
+
*/
|
|
4
8
|
export declare const editTypes: readonly ['additional-accent', 'add-redundancy', 'remove-redundancy',
|
|
5
9
|
/**
|
|
6
10
|
* Carries the text into another reproducing system's coding: a
|
|
@@ -13,6 +17,7 @@ export declare const editTypes: readonly ['additional-accent', 'add-redundancy',
|
|
|
13
17
|
* The type of editorial change applied to a symbol or set of symbols.
|
|
14
18
|
* Classifies the nature of the edit, e.g. whether it corrects an error,
|
|
15
19
|
* adds an accent, shifts a note, or shortens/prolongs a perforation.
|
|
20
|
+
* @category Format types
|
|
16
21
|
*/
|
|
17
22
|
export type EditType = typeof editTypes[number];
|
|
18
23
|
/**
|
|
@@ -28,6 +33,7 @@ export type EditType = typeof editTypes[number];
|
|
|
28
33
|
* the axioms of reo.ttl; which of those dates bounds it closest is for
|
|
29
34
|
* a query to pick.
|
|
30
35
|
* @see reo:Edit
|
|
36
|
+
* @category Format types
|
|
31
37
|
*/
|
|
32
38
|
export interface Edit extends WithId, Assumption {
|
|
33
39
|
type: 'edit';
|
|
@@ -53,4 +59,8 @@ export interface Edit extends WithId, Assumption {
|
|
|
53
59
|
*/
|
|
54
60
|
delete?: string[];
|
|
55
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Whether the object is an edit.
|
|
64
|
+
* @category Lookups
|
|
65
|
+
*/
|
|
56
66
|
export declare const isEdit: (object: any) => object is Edit;
|
package/lib/model/Edit.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The types of editorial change an edit may state.
|
|
3
|
+
* @category Vocabulary
|
|
4
|
+
*/
|
|
1
5
|
export const editTypes = [
|
|
2
6
|
'additional-accent',
|
|
3
7
|
'add-redundancy',
|
|
@@ -14,6 +18,10 @@ export const editTypes = [
|
|
|
14
18
|
'shorten',
|
|
15
19
|
'prolong',
|
|
16
20
|
];
|
|
21
|
+
/**
|
|
22
|
+
* Whether the object is an edit.
|
|
23
|
+
* @category Lookups
|
|
24
|
+
*/
|
|
17
25
|
export const isEdit = (object) => {
|
|
18
26
|
return 'type' in object && object.type === 'edit';
|
|
19
27
|
};
|
package/lib/model/Edition.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Editor, Person, Place } from "./Agent.js";
|
|
|
6
6
|
* This type describes the creation of an edition,
|
|
7
7
|
* i.e. the editor, publisher, and publication date.
|
|
8
8
|
* @see lrmoo:F28 Expression Creation
|
|
9
|
+
* @category Format types
|
|
9
10
|
*/
|
|
10
11
|
export interface EditionCreation {
|
|
11
12
|
/**
|
|
@@ -33,6 +34,7 @@ export interface EditionCreation {
|
|
|
33
34
|
* the persons involved in the process (e.g. pianist),
|
|
34
35
|
* the place, and the date of the recording.
|
|
35
36
|
* @see lrmoo:F28 Expression Creation
|
|
37
|
+
* @category Format types
|
|
36
38
|
*/
|
|
37
39
|
export interface RecordingEvent {
|
|
38
40
|
/**
|
|
@@ -76,6 +78,7 @@ export interface RecordingEvent {
|
|
|
76
78
|
* The abstract concept of a roll, identified
|
|
77
79
|
* by its catalogue number.
|
|
78
80
|
* @see lrmoo:F1 Work
|
|
81
|
+
* @category Format types
|
|
79
82
|
*/
|
|
80
83
|
export interface Roll {
|
|
81
84
|
/**
|
|
@@ -92,6 +95,7 @@ export interface Roll {
|
|
|
92
95
|
/**
|
|
93
96
|
* Describes the specific digital edition of a piano roll.
|
|
94
97
|
* @see lrmoo:F2 Expression
|
|
98
|
+
* @category Format types
|
|
95
99
|
*/
|
|
96
100
|
export interface Edition {
|
|
97
101
|
/**
|
|
@@ -156,11 +160,18 @@ export interface Edition {
|
|
|
156
160
|
*/
|
|
157
161
|
versions: Version[];
|
|
158
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* What an edition states about itself rather than about the copies and
|
|
165
|
+
* versions of the roll: `base`, `title`, `license`, `version`,
|
|
166
|
+
* `creation` and the `roll` it edits.
|
|
167
|
+
* @category Format types
|
|
168
|
+
*/
|
|
159
169
|
export type EditionMetadata = Pick<Edition, 'base' | 'title' | 'license' | 'version' | 'creation' | 'roll'>;
|
|
160
170
|
/**
|
|
161
171
|
* The copy whose millimetres are the edition's axis: the one it names,
|
|
162
172
|
* or where it names none or one it no longer has, the first copy with
|
|
163
173
|
* features that is not aligned, which is how an edition stood before it
|
|
164
174
|
* named one.
|
|
175
|
+
* @category Lookups
|
|
165
176
|
*/
|
|
166
177
|
export declare const referenceCopyOf: (edition: Pick<Edition, 'copies' | 'referenceCopy'>) => RollCopy | undefined;
|
package/lib/model/Edition.js
CHANGED
|
@@ -4,6 +4,7 @@ import { featuresOf } from "./RollCopy.js";
|
|
|
4
4
|
* or where it names none or one it no longer has, the first copy with
|
|
5
5
|
* features that is not aligned, which is how an edition stood before it
|
|
6
6
|
* named one.
|
|
7
|
+
* @category Lookups
|
|
7
8
|
*/
|
|
8
9
|
export const referenceCopyOf = (edition) => edition.copies.find(copy => copy.id === edition.referenceCopy)
|
|
9
10
|
?? edition.copies.find(copy => !copy.measurements.alignment && featuresOf(copy).length > 0);
|
package/lib/model/Feature.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { Measure, Millimeters, Track } from "./Quantity.js";
|
|
|
8
8
|
* measured in millimeters from the beginning of the roll.
|
|
9
9
|
* The `from` value is the start position and `to` is the end position.
|
|
10
10
|
* @see crm:E54 Dimension
|
|
11
|
+
* @category Format types
|
|
11
12
|
*/
|
|
12
13
|
export interface HorizontalSpan {
|
|
13
14
|
/**
|
|
@@ -34,6 +35,7 @@ export interface HorizontalSpan {
|
|
|
34
35
|
* measured in track numbers. Track numbers correspond to
|
|
35
36
|
* positions on the tracker bar.
|
|
36
37
|
* @see crm:E54 Dimension
|
|
38
|
+
* @category Format types
|
|
37
39
|
*/
|
|
38
40
|
export interface VerticalSpan {
|
|
39
41
|
/**
|
|
@@ -53,14 +55,28 @@ export interface VerticalSpan {
|
|
|
53
55
|
*/
|
|
54
56
|
to?: Track;
|
|
55
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* The kinds of feature, a patch among them, each by the type that names
|
|
60
|
+
* it.
|
|
61
|
+
* @category Vocabulary
|
|
62
|
+
*/
|
|
56
63
|
export declare const featureTypes: readonly ['HoleChain', 'Writing', 'Mark', 'Patch'];
|
|
64
|
+
/**
|
|
65
|
+
* The type naming a kind of feature.
|
|
66
|
+
* @category Format types
|
|
67
|
+
*/
|
|
57
68
|
export type FeatureType = typeof featureTypes[number];
|
|
69
|
+
/**
|
|
70
|
+
* Whether the value names a kind of feature.
|
|
71
|
+
* @category Lookups
|
|
72
|
+
*/
|
|
58
73
|
export declare const isFeatureType: (value: unknown) => value is FeatureType;
|
|
59
74
|
/**
|
|
60
75
|
* A feature on the roll, e.g. a perforation, a writing, a mark or a
|
|
61
76
|
* patch, defined by its horizontal and vertical position and
|
|
62
77
|
* extent. Each kind of feature is a class of its own, which its type
|
|
63
78
|
* names.
|
|
79
|
+
* @category Format types
|
|
64
80
|
*/
|
|
65
81
|
export interface RollFeature<T extends FeatureType, DamageT extends string> extends WithId, WithType<T> {
|
|
66
82
|
/**
|
|
@@ -85,18 +101,26 @@ export interface RollFeature<T extends FeatureType, DamageT extends string> exte
|
|
|
85
101
|
*/
|
|
86
102
|
condition?: ObjectAssumption<ConditionState<DamageT>>;
|
|
87
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* The kinds of condition each kind of feature may be in.
|
|
106
|
+
* @category Vocabulary
|
|
107
|
+
*/
|
|
88
108
|
export declare const conditions: {
|
|
89
109
|
readonly HoleChain: readonly ["partially-torn", "missing-perforation"];
|
|
90
110
|
readonly Writing: readonly ["illegible"];
|
|
91
111
|
readonly Mark: readonly ["faded"];
|
|
92
112
|
readonly Patch: readonly ["detaching", "ripped"];
|
|
93
113
|
};
|
|
94
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* The kinds of condition a feature may be in, whichever kind of feature it is.
|
|
116
|
+
* @category Format types
|
|
117
|
+
*/
|
|
95
118
|
export type FeatureConditionType = typeof conditions[FeatureType][number];
|
|
96
119
|
/**
|
|
97
120
|
* A condition assigned to a feature, annotatable with a belief about
|
|
98
121
|
* its certainty. Which of the kinds a feature may be in depends on its
|
|
99
122
|
* own kind, which `conditions` states.
|
|
123
|
+
* @category Format types
|
|
100
124
|
*/
|
|
101
125
|
export type FeatureConditionAssignment = ObjectAssumption<ConditionState<FeatureConditionType>>;
|
|
102
126
|
/**
|
|
@@ -109,12 +133,14 @@ export type FeatureConditionAssignment = ObjectAssumption<ConditionState<Feature
|
|
|
109
133
|
* features on mechanical or digital carriers" among the features
|
|
110
134
|
* purposely created by human activity.
|
|
111
135
|
* @see reo:HoleChain
|
|
136
|
+
* @category Format types
|
|
112
137
|
*/
|
|
113
138
|
export interface HoleChain extends RollFeature<'HoleChain', typeof conditions.HoleChain[number]> {
|
|
114
139
|
}
|
|
115
140
|
/**
|
|
116
141
|
* Something that lies on a face of the paper rather than through it. A
|
|
117
142
|
* chain of holes is not one: it goes through, and is on both faces at once.
|
|
143
|
+
* @category Format types
|
|
118
144
|
*/
|
|
119
145
|
export interface OnAFace {
|
|
120
146
|
/**
|
|
@@ -124,15 +150,30 @@ export interface OnAFace {
|
|
|
124
150
|
*/
|
|
125
151
|
side?: 'recto' | 'verso';
|
|
126
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* The ways a trace may have been put on the paper.
|
|
155
|
+
* @category Vocabulary
|
|
156
|
+
*/
|
|
127
157
|
export declare const techniques: readonly ['print', 'handwriting', 'stamp'];
|
|
128
|
-
/**
|
|
158
|
+
/**
|
|
159
|
+
* How a trace was put on the paper.
|
|
160
|
+
* @category Format types
|
|
161
|
+
*/
|
|
129
162
|
export type Technique = typeof techniques[number];
|
|
163
|
+
/**
|
|
164
|
+
* What a trace may have been put on the paper with.
|
|
165
|
+
* @category Vocabulary
|
|
166
|
+
*/
|
|
130
167
|
export declare const media: readonly ['ink', 'pencil', 'crayon'];
|
|
131
|
-
/**
|
|
168
|
+
/**
|
|
169
|
+
* What a trace was put on with.
|
|
170
|
+
* @category Format types
|
|
171
|
+
*/
|
|
132
172
|
export type Medium = typeof media[number];
|
|
133
173
|
/**
|
|
134
174
|
* A trace is a visible mark or writing on the roll surface.
|
|
135
175
|
* Traces may fade over time.
|
|
176
|
+
* @category Format types
|
|
136
177
|
*/
|
|
137
178
|
export interface Trace<T extends FeatureType> extends RollFeature<T, typeof conditions[T][number]>, OnAFace {
|
|
138
179
|
/**
|
|
@@ -149,13 +190,17 @@ export interface Trace<T extends FeatureType> extends RollFeature<T, typeof cond
|
|
|
149
190
|
*/
|
|
150
191
|
medium?: Medium;
|
|
151
192
|
}
|
|
152
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* The text a writing carries. It names no carriers of its own, the writing being its carrier.
|
|
195
|
+
* @category Format types
|
|
196
|
+
*/
|
|
153
197
|
export type Transcription = Omit<Text, 'carriers'>;
|
|
154
198
|
/**
|
|
155
199
|
* A piece of writing found on the roll, such as a label,
|
|
156
200
|
* catalogue number, or annotation. Writings state how they were made
|
|
157
201
|
* and a transcription of their content.
|
|
158
202
|
* @see reo:Writing
|
|
203
|
+
* @category Format types
|
|
159
204
|
*/
|
|
160
205
|
export interface Writing extends Trace<'Writing'> {
|
|
161
206
|
/**
|
|
@@ -187,6 +232,7 @@ export interface Writing extends Trace<'Writing'> {
|
|
|
187
232
|
* reading of it (crminf:I16 Meaning Comprehension) rather than a
|
|
188
233
|
* property of the feature, so its shape is not stated here.
|
|
189
234
|
* @see reo:Mark
|
|
235
|
+
* @category Format types
|
|
190
236
|
*/
|
|
191
237
|
export interface Mark extends Trace<'Mark'> {
|
|
192
238
|
}
|
|
@@ -195,6 +241,7 @@ export interface Mark extends Trace<'Mark'> {
|
|
|
195
241
|
* strip covering perforations, or a patch reinforcing a tear. A patch
|
|
196
242
|
* may itself carry other features, such as writings or holes.
|
|
197
243
|
* @see reo:Patch
|
|
244
|
+
* @category Format types
|
|
198
245
|
*/
|
|
199
246
|
export interface Patch extends RollFeature<'Patch', typeof conditions.Patch[number]>, OnAFace {
|
|
200
247
|
/**
|
|
@@ -220,12 +267,14 @@ export interface Patch extends RollFeature<'Patch', typeof conditions.Patch[numb
|
|
|
220
267
|
* The features proper: a chain of holes, a writing and a mark are all
|
|
221
268
|
* human-made features, and each of them is borne by whatever it sits on.
|
|
222
269
|
* A patch is an object glued onto the paper and stands apart from them.
|
|
270
|
+
* @category Format types
|
|
223
271
|
*/
|
|
224
272
|
export type AnyFeature = HoleChain | Writing | Mark;
|
|
225
273
|
/**
|
|
226
274
|
* Anything found at a place of its own on the roll: a feature or a
|
|
227
275
|
* patch. E24 Physical Human-Made Thing is the class both fall under,
|
|
228
276
|
* E22 and E25 being its subclasses.
|
|
277
|
+
* @category Format types
|
|
229
278
|
*/
|
|
230
279
|
export type FeatureOrPatch = AnyFeature | Patch;
|
|
231
280
|
/**
|
|
@@ -236,14 +285,32 @@ type Unplaced<T> = T extends FeatureOrPatch ? PartialBy<T, 'horizontal' | 'verti
|
|
|
236
285
|
/**
|
|
237
286
|
* A feature borne by another feature. It states no place of its own,
|
|
238
287
|
* the feature bearing it standing in one.
|
|
288
|
+
* @category Format types
|
|
239
289
|
*/
|
|
240
290
|
export type NestedFeature = Unplaced<FeatureOrPatch>;
|
|
241
|
-
/**
|
|
291
|
+
/**
|
|
292
|
+
* Whether the feature states a place of its own, which one a patch bears does not.
|
|
293
|
+
* @category Lookups
|
|
294
|
+
*/
|
|
242
295
|
export declare const isPlaced: (feature: NestedFeature) => feature is FeatureOrPatch;
|
|
296
|
+
/**
|
|
297
|
+
* Whether the object is a feature or a patch, as its type says.
|
|
298
|
+
* @category Lookups
|
|
299
|
+
*/
|
|
243
300
|
export declare const isRollFeature: (obj: object) => obj is FeatureOrPatch;
|
|
301
|
+
/**
|
|
302
|
+
* Whether the feature is a patch.
|
|
303
|
+
* @category Lookups
|
|
304
|
+
*/
|
|
244
305
|
export declare const isPatch: <T extends NestedFeature>(feature: T) => feature is T & Patch;
|
|
245
|
-
/**
|
|
306
|
+
/**
|
|
307
|
+
* The features a feature bears: a patch those stated as parts of it, any other feature none.
|
|
308
|
+
* @category Lookups
|
|
309
|
+
*/
|
|
246
310
|
export declare const featuresBorneBy: (feature: NestedFeature) => NestedFeature[];
|
|
247
|
-
/**
|
|
311
|
+
/**
|
|
312
|
+
* The feature together with everything it bears, as deep as a patch on a patch goes.
|
|
313
|
+
* @category Lookups
|
|
314
|
+
*/
|
|
248
315
|
export declare const withBorneFeatures: (feature: NestedFeature) => NestedFeature[];
|
|
249
316
|
export {};
|
package/lib/model/Feature.js
CHANGED
|
@@ -1,20 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kinds of feature, a patch among them, each by the type that names
|
|
3
|
+
* it.
|
|
4
|
+
* @category Vocabulary
|
|
5
|
+
*/
|
|
1
6
|
export const featureTypes = ['HoleChain', 'Writing', 'Mark', 'Patch'];
|
|
7
|
+
/**
|
|
8
|
+
* Whether the value names a kind of feature.
|
|
9
|
+
* @category Lookups
|
|
10
|
+
*/
|
|
2
11
|
export const isFeatureType = (value) => featureTypes.includes(value);
|
|
12
|
+
/**
|
|
13
|
+
* The kinds of condition each kind of feature may be in.
|
|
14
|
+
* @category Vocabulary
|
|
15
|
+
*/
|
|
3
16
|
export const conditions = {
|
|
4
17
|
HoleChain: ['partially-torn', 'missing-perforation'],
|
|
5
18
|
Writing: ['illegible'],
|
|
6
19
|
Mark: ['faded'],
|
|
7
20
|
Patch: ['detaching', 'ripped']
|
|
8
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* The ways a trace may have been put on the paper.
|
|
24
|
+
* @category Vocabulary
|
|
25
|
+
*/
|
|
9
26
|
export const techniques = ['print', 'handwriting', 'stamp'];
|
|
27
|
+
/**
|
|
28
|
+
* What a trace may have been put on the paper with.
|
|
29
|
+
* @category Vocabulary
|
|
30
|
+
*/
|
|
10
31
|
export const media = ['ink', 'pencil', 'crayon'];
|
|
11
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Whether the feature states a place of its own, which one a patch bears does not.
|
|
34
|
+
* @category Lookups
|
|
35
|
+
*/
|
|
12
36
|
export const isPlaced = (feature) => feature.horizontal !== undefined && feature.vertical !== undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the object is a feature or a patch, as its type says.
|
|
39
|
+
* @category Lookups
|
|
40
|
+
*/
|
|
13
41
|
export const isRollFeature = (obj) => {
|
|
14
42
|
return 'type' in obj && isFeatureType(obj.type);
|
|
15
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Whether the feature is a patch.
|
|
46
|
+
* @category Lookups
|
|
47
|
+
*/
|
|
16
48
|
export const isPatch = (feature) => feature.type === 'Patch';
|
|
17
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* The features a feature bears: a patch those stated as parts of it, any other feature none.
|
|
51
|
+
* @category Lookups
|
|
52
|
+
*/
|
|
18
53
|
export const featuresBorneBy = (feature) => isPatch(feature) ? feature.features ?? [] : [];
|
|
19
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* The feature together with everything it bears, as deep as a patch on a patch goes.
|
|
56
|
+
* @category Lookups
|
|
57
|
+
*/
|
|
20
58
|
export const withBorneFeatures = (feature) => [feature, ...featuresBorneBy(feature).flatMap(withBorneFeatures)];
|
|
@@ -6,10 +6,19 @@ import { WithNote } from "../shared/utils.js";
|
|
|
6
6
|
* What a copy's features were read from. The kinds run from the paper
|
|
7
7
|
* itself, through files in which the roll has already been read into
|
|
8
8
|
* notes and commands, to a sound recording of the copy being played.
|
|
9
|
+
* @category Vocabulary
|
|
9
10
|
*/
|
|
10
11
|
export declare const sourceKinds: readonly ['roll', 'scan', 'analysis', 'reading', 'emulation', 'recording'];
|
|
12
|
+
/**
|
|
13
|
+
* A kind of source a copy's features can be read from, from the paper
|
|
14
|
+
* itself to a sound recording of the copy being played.
|
|
15
|
+
* @category Format types
|
|
16
|
+
*/
|
|
11
17
|
export type SourceKind = typeof sourceKinds[number];
|
|
12
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* How each kind of source is referred to in prose.
|
|
20
|
+
* @category Vocabulary
|
|
21
|
+
*/
|
|
13
22
|
export declare const sourceLabels: Record<SourceKind, string>;
|
|
14
23
|
/**
|
|
15
24
|
* Whether a source of this kind gives positions that were measured. A
|
|
@@ -17,12 +26,14 @@ export declare const sourceLabels: Record<SourceKind, string>;
|
|
|
17
26
|
* emulation and a recording give the reading somebody else made: the
|
|
18
27
|
* roll has been turned into notes and commands already, and turning
|
|
19
28
|
* those back into chains of holes reconstructs them.
|
|
29
|
+
* @category Lookups
|
|
20
30
|
*/
|
|
21
31
|
export declare const isMeasured: (kind: SourceKind) => boolean;
|
|
22
32
|
/**
|
|
23
33
|
* Whether a source of this kind bears witness to the paper. Punch
|
|
24
34
|
* diameter, hole separation, punching pattern, marks and writings can
|
|
25
35
|
* be observed on the roll and on an image of it, and on nothing else.
|
|
36
|
+
* @category Lookups
|
|
26
37
|
*/
|
|
27
38
|
export declare const bearsPhysicalEvidence: (kind: SourceKind) => boolean;
|
|
28
39
|
export type { Software } from "./Agent.js";
|
|
@@ -30,6 +41,7 @@ export type { Software } from "./Agent.js";
|
|
|
30
41
|
* An instrument a copy was played on to be recorded. How it was
|
|
31
42
|
* regulated, where that is known, is its condition.
|
|
32
43
|
* @see crm:E22 Human-Made Object
|
|
44
|
+
* @category Format types
|
|
33
45
|
*/
|
|
34
46
|
export interface Instrument extends Named {
|
|
35
47
|
/**
|
|
@@ -47,6 +59,7 @@ export interface Instrument extends Named {
|
|
|
47
59
|
* `reservationsAbout`, which works out what a copy cannot vouch for
|
|
48
60
|
* from what it states here.
|
|
49
61
|
* @see crm:E7 Activity
|
|
62
|
+
* @category Format types
|
|
50
63
|
*/
|
|
51
64
|
export interface FeatureSource extends WithNote {
|
|
52
65
|
/**
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* What a copy's features were read from. The kinds run from the paper
|
|
3
3
|
* itself, through files in which the roll has already been read into
|
|
4
4
|
* notes and commands, to a sound recording of the copy being played.
|
|
5
|
+
* @category Vocabulary
|
|
5
6
|
*/
|
|
6
7
|
export const sourceKinds = [
|
|
7
8
|
'roll',
|
|
@@ -11,7 +12,10 @@ export const sourceKinds = [
|
|
|
11
12
|
'emulation',
|
|
12
13
|
'recording'
|
|
13
14
|
];
|
|
14
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* How each kind of source is referred to in prose.
|
|
17
|
+
* @category Vocabulary
|
|
18
|
+
*/
|
|
15
19
|
export const sourceLabels = {
|
|
16
20
|
roll: 'the roll itself',
|
|
17
21
|
scan: 'a scan of the roll',
|
|
@@ -28,11 +32,13 @@ const physical = ['roll', 'scan'];
|
|
|
28
32
|
* emulation and a recording give the reading somebody else made: the
|
|
29
33
|
* roll has been turned into notes and commands already, and turning
|
|
30
34
|
* those back into chains of holes reconstructs them.
|
|
35
|
+
* @category Lookups
|
|
31
36
|
*/
|
|
32
37
|
export const isMeasured = (kind) => measured.includes(kind);
|
|
33
38
|
/**
|
|
34
39
|
* Whether a source of this kind bears witness to the paper. Punch
|
|
35
40
|
* diameter, hole separation, punching pattern, marks and writings can
|
|
36
41
|
* be observed on the roll and on an image of it, and on nothing else.
|
|
42
|
+
* @category Lookups
|
|
37
43
|
*/
|
|
38
44
|
export const bearsPhysicalEvidence = (kind) => physical.includes(kind);
|
|
@@ -10,6 +10,7 @@ import { WithId, WithType } from "../shared/utils.js";
|
|
|
10
10
|
* runs along the roll, and is another thing than the hole separation,
|
|
11
11
|
* which is the distance across the roll from one track to the next.
|
|
12
12
|
* @see crm:E54 Dimension
|
|
13
|
+
* @category Format types
|
|
13
14
|
*/
|
|
14
15
|
export interface ChainPitch extends Measure<'mm'> {
|
|
15
16
|
/**
|
|
@@ -35,6 +36,7 @@ export interface ChainPitch extends Measure<'mm'> {
|
|
|
35
36
|
* with a whole number of steps, so its lengths fall on a comb of this
|
|
36
37
|
* spacing.
|
|
37
38
|
* @see crm:E54 Dimension
|
|
39
|
+
* @category Format types
|
|
38
40
|
*/
|
|
39
41
|
export interface Advance extends Measure<'mm'> {
|
|
40
42
|
/**
|
|
@@ -57,6 +59,7 @@ export interface Advance extends Measure<'mm'> {
|
|
|
57
59
|
* perforations show it. No time is stated: how long a machine kept a
|
|
58
60
|
* setting is for a comparison across rolls to find out.
|
|
59
61
|
* @see crm:E3 Condition State
|
|
62
|
+
* @category Format types
|
|
60
63
|
*/
|
|
61
64
|
export interface PerforatorSetting extends ConditionState<'setting'> {
|
|
62
65
|
/**
|
|
@@ -81,6 +84,7 @@ export interface PerforatorSetting extends ConditionState<'setting'> {
|
|
|
81
84
|
* own. `ontology/types.ttl` defines them, and a test holds this list
|
|
82
85
|
* against it.
|
|
83
86
|
* @see crm:E55 Type
|
|
87
|
+
* @category Vocabulary
|
|
84
88
|
*/
|
|
85
89
|
export declare const drives: readonly [{
|
|
86
90
|
readonly id: 'https://w3id.org/reo/type/drive/ram-head';
|
|
@@ -89,10 +93,15 @@ export declare const drives: readonly [{
|
|
|
89
93
|
readonly id: 'https://w3id.org/reo/type/drive/asynchronous';
|
|
90
94
|
readonly name: 'asynchronous';
|
|
91
95
|
}];
|
|
96
|
+
/**
|
|
97
|
+
* The IRI of a drive the type vocabulary declares.
|
|
98
|
+
* @category Format types
|
|
99
|
+
*/
|
|
92
100
|
export type DriveId = typeof drives[number]['id'];
|
|
93
101
|
/**
|
|
94
102
|
* A drive, named by its IRI alone.
|
|
95
103
|
* @see crm:E55 Type
|
|
104
|
+
* @category Format types
|
|
96
105
|
*/
|
|
97
106
|
export interface Drive {
|
|
98
107
|
/** The IRI the type vocabulary gives the drive. */
|
|
@@ -103,6 +112,7 @@ export interface Drive {
|
|
|
103
112
|
* alone. Whether it is the one another copy was punched on is left to a
|
|
104
113
|
* statement of identity made about it elsewhere, which its id allows.
|
|
105
114
|
* @see crm:E22 Human-Made Object
|
|
115
|
+
* @category Format types
|
|
106
116
|
*/
|
|
107
117
|
export interface Perforator extends WithType<'Perforator'>, WithId {
|
|
108
118
|
/**
|
package/lib/model/Perforator.js
CHANGED