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/Quantity.d.ts
CHANGED
|
@@ -10,45 +10,133 @@ declare const unit: unique symbol;
|
|
|
10
10
|
/**
|
|
11
11
|
* The units a record may state. A `Measure` is limited to these, since
|
|
12
12
|
* they are what the `unit` field is allowed to say.
|
|
13
|
+
* @category Format types
|
|
13
14
|
*/
|
|
14
15
|
export type Unit = 'mm' | 'cm' | 'px' | 'track' | 's' | 'ms' | 'ft/min' | 'm/min' | 'px/in' | 'deg' | 'percent';
|
|
15
16
|
export type Quantity<U extends string> = number & {
|
|
16
17
|
readonly [unit]: U;
|
|
17
18
|
};
|
|
18
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* A place along the roll, or any length on the paper.
|
|
21
|
+
* @category Units
|
|
22
|
+
*/
|
|
19
23
|
export type Millimeters = Quantity<'mm'>;
|
|
24
|
+
/**
|
|
25
|
+
* A length in centimetres.
|
|
26
|
+
* @category Units
|
|
27
|
+
*/
|
|
20
28
|
export type Centimeters = Quantity<'cm'>;
|
|
21
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* A place in a scan. Comparable within one scan only, since the resolution is the scan's.
|
|
31
|
+
* @category Units
|
|
32
|
+
*/
|
|
22
33
|
export type Pixels = Quantity<'px'>;
|
|
23
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* A position across the roll, numbered as the tracker bar does.
|
|
36
|
+
* @category Units
|
|
37
|
+
*/
|
|
24
38
|
export type Track = Quantity<'track'>;
|
|
39
|
+
/**
|
|
40
|
+
* A time in seconds, such as the moment a performed event falls at.
|
|
41
|
+
* @category Units
|
|
42
|
+
*/
|
|
25
43
|
export type Seconds = Quantity<'s'>;
|
|
44
|
+
/**
|
|
45
|
+
* A time in milliseconds.
|
|
46
|
+
* @category Units
|
|
47
|
+
*/
|
|
26
48
|
export type Milliseconds = Quantity<'ms'>;
|
|
49
|
+
/**
|
|
50
|
+
* A paper speed in feet per minute.
|
|
51
|
+
* @category Units
|
|
52
|
+
*/
|
|
27
53
|
export type FeetPerMinute = Quantity<'ft/min'>;
|
|
54
|
+
/**
|
|
55
|
+
* A paper speed in metres per minute.
|
|
56
|
+
* @category Units
|
|
57
|
+
*/
|
|
28
58
|
export type MetersPerMinute = Quantity<'m/min'>;
|
|
29
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* How finely a scan was read: pixels of the image per inch of paper.
|
|
61
|
+
* @category Units
|
|
62
|
+
*/
|
|
30
63
|
export type Resolution = Quantity<'px/in'>;
|
|
31
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* An angle on the roll, turning from the line across the paper towards the end of the roll.
|
|
66
|
+
* @category Units
|
|
67
|
+
*/
|
|
32
68
|
export type Degrees = Quantity<'deg'>;
|
|
33
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* A share of a length, such as how far the paper has stretched: dimensionless, in hundredths.
|
|
71
|
+
* @category Units
|
|
72
|
+
*/
|
|
34
73
|
export type Percent = Quantity<'percent'>;
|
|
35
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Names a number in a unit. Partially apply it to make a constructor.
|
|
76
|
+
* @category Units
|
|
77
|
+
*/
|
|
36
78
|
export declare const quantity: <U extends string>(value: number) => Quantity<U>;
|
|
79
|
+
/**
|
|
80
|
+
* Names a number in millimetres.
|
|
81
|
+
* @category Units
|
|
82
|
+
*/
|
|
37
83
|
export declare const mm: (value: number) => Quantity<"mm">;
|
|
84
|
+
/**
|
|
85
|
+
* Names a number in centimetres.
|
|
86
|
+
* @category Units
|
|
87
|
+
*/
|
|
38
88
|
export declare const cm: (value: number) => Quantity<"cm">;
|
|
89
|
+
/**
|
|
90
|
+
* Names a number in pixels of a scan.
|
|
91
|
+
* @category Units
|
|
92
|
+
*/
|
|
39
93
|
export declare const px: (value: number) => Quantity<"px">;
|
|
94
|
+
/**
|
|
95
|
+
* Names a number as a position across the roll, as the tracker bar
|
|
96
|
+
* numbers it.
|
|
97
|
+
* @category Units
|
|
98
|
+
*/
|
|
40
99
|
export declare const track: (value: number) => Quantity<"track">;
|
|
100
|
+
/**
|
|
101
|
+
* Names a number in seconds.
|
|
102
|
+
* @category Units
|
|
103
|
+
*/
|
|
41
104
|
export declare const seconds: (value: number) => Quantity<"s">;
|
|
105
|
+
/**
|
|
106
|
+
* Names a number in milliseconds.
|
|
107
|
+
* @category Units
|
|
108
|
+
*/
|
|
42
109
|
export declare const milliseconds: (value: number) => Quantity<"ms">;
|
|
110
|
+
/**
|
|
111
|
+
* Names a number as a paper speed in feet per minute.
|
|
112
|
+
* @category Units
|
|
113
|
+
*/
|
|
43
114
|
export declare const feetPerMinute: (value: number) => Quantity<"ft/min">;
|
|
115
|
+
/**
|
|
116
|
+
* Names a number as a paper speed in metres per minute.
|
|
117
|
+
* @category Units
|
|
118
|
+
*/
|
|
44
119
|
export declare const metersPerMinute: (value: number) => Quantity<"m/min">;
|
|
120
|
+
/**
|
|
121
|
+
* Names a number as the resolution of a scan, in pixels per inch.
|
|
122
|
+
* @category Units
|
|
123
|
+
*/
|
|
45
124
|
export declare const pixelsPerInch: (value: number) => Quantity<"px/in">;
|
|
125
|
+
/**
|
|
126
|
+
* Names a number as an angle in degrees.
|
|
127
|
+
* @category Units
|
|
128
|
+
*/
|
|
46
129
|
export declare const degrees: (value: number) => Quantity<"deg">;
|
|
130
|
+
/**
|
|
131
|
+
* Names a number as a share in per cent.
|
|
132
|
+
* @category Units
|
|
133
|
+
*/
|
|
47
134
|
export declare const percent: (value: number) => Quantity<"percent">;
|
|
48
135
|
/**
|
|
49
136
|
* A value together with the unit it was measured in, as a record
|
|
50
137
|
* states it.
|
|
51
138
|
* @see crm:E54 Dimension
|
|
139
|
+
* @category Format types
|
|
52
140
|
*/
|
|
53
141
|
export interface Measure<U extends Unit> {
|
|
54
142
|
/**
|
|
@@ -62,26 +150,85 @@ export interface Measure<U extends Unit> {
|
|
|
62
150
|
*/
|
|
63
151
|
unit: U;
|
|
64
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* The sum of two quantities in one unit.
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
65
157
|
export declare const add: <U extends string>(a: Quantity<U>, b: Quantity<NoInfer<U>>) => Quantity<U>;
|
|
158
|
+
/**
|
|
159
|
+
* The first quantity less the second, in their unit.
|
|
160
|
+
* @internal
|
|
161
|
+
*/
|
|
66
162
|
export declare const subtract: <U extends string>(a: Quantity<U>, b: Quantity<NoInfer<U>>) => Quantity<U>;
|
|
163
|
+
/**
|
|
164
|
+
* How far apart two quantities in one unit lie, whichever is the
|
|
165
|
+
* larger.
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
67
168
|
export declare const distance: <U extends string>(a: Quantity<U>, b: Quantity<NoInfer<U>>) => Quantity<U>;
|
|
68
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* A quantity times a plain factor, such as a stretch.
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
69
173
|
export declare const scale: <U extends string>(a: Quantity<U>, factor: number) => Quantity<U>;
|
|
174
|
+
/**
|
|
175
|
+
* The smaller of two quantities in one unit.
|
|
176
|
+
* @internal
|
|
177
|
+
*/
|
|
70
178
|
export declare const min: <U extends string>(a: Quantity<U>, b: Quantity<NoInfer<U>>) => Quantity<U>;
|
|
179
|
+
/**
|
|
180
|
+
* The larger of two quantities in one unit.
|
|
181
|
+
* @internal
|
|
182
|
+
*/
|
|
71
183
|
export declare const max: <U extends string>(a: Quantity<U>, b: Quantity<NoInfer<U>>) => Quantity<U>;
|
|
72
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* The value brought inside the bounds, which must not be the wrong way round.
|
|
186
|
+
* @internal
|
|
187
|
+
*/
|
|
73
188
|
export declare const clamp: <U extends string>(value: Quantity<U>, low: Quantity<NoInfer<U>>, high: Quantity<NoInfer<U>>) => Quantity<U>;
|
|
189
|
+
/**
|
|
190
|
+
* The quantities added up, zero where there are none.
|
|
191
|
+
* @internal
|
|
192
|
+
*/
|
|
74
193
|
export declare const sum: <U extends string>(values: readonly Quantity<U>[]) => Quantity<U>;
|
|
194
|
+
/**
|
|
195
|
+
* The mean of the quantities.
|
|
196
|
+
* @internal
|
|
197
|
+
*/
|
|
75
198
|
export declare const mean: <U extends string>(values: readonly Quantity<U>[]) => Quantity<U>;
|
|
76
|
-
/**
|
|
199
|
+
/**
|
|
200
|
+
* A place in a scan taken at `dpi` dots per inch, on the paper.
|
|
201
|
+
* @internal
|
|
202
|
+
*/
|
|
77
203
|
export declare const inMillimeters: (place: Pixels, dpi: number) => Millimeters;
|
|
78
|
-
/**
|
|
204
|
+
/**
|
|
205
|
+
* A place on the paper, in a scan taken at `dpi` dots per inch.
|
|
206
|
+
* @internal
|
|
207
|
+
*/
|
|
79
208
|
export declare const inPixels: (place: Millimeters, dpi: number) => Pixels;
|
|
209
|
+
/**
|
|
210
|
+
* A length in millimetres, in centimetres.
|
|
211
|
+
* @internal
|
|
212
|
+
*/
|
|
80
213
|
export declare const inCentimeters: (length: Millimeters) => Centimeters;
|
|
214
|
+
/**
|
|
215
|
+
* A time in milliseconds, in seconds.
|
|
216
|
+
* @internal
|
|
217
|
+
*/
|
|
81
218
|
export declare const inSeconds: (time: Milliseconds) => Seconds;
|
|
219
|
+
/**
|
|
220
|
+
* A time in seconds, in milliseconds.
|
|
221
|
+
* @internal
|
|
222
|
+
*/
|
|
82
223
|
export declare const inMilliseconds: (time: Seconds) => Milliseconds;
|
|
83
|
-
/**
|
|
224
|
+
/**
|
|
225
|
+
* A speed as a record states it, in feet or metres per minute.
|
|
226
|
+
* @category Format types
|
|
227
|
+
*/
|
|
84
228
|
export type SpeedMeasure = Measure<'ft/min'> | Measure<'m/min'>;
|
|
85
|
-
/**
|
|
229
|
+
/**
|
|
230
|
+
* A speed in metres per minute, whichever unit it was stated in.
|
|
231
|
+
* @category Units
|
|
232
|
+
*/
|
|
86
233
|
export declare const inMetersPerMinute: (speed: SpeedMeasure) => MetersPerMinute;
|
|
87
234
|
export {};
|
package/lib/model/Quantity.js
CHANGED
|
@@ -1,42 +1,146 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Names a number in a unit. Partially apply it to make a constructor.
|
|
3
|
+
* @category Units
|
|
4
|
+
*/
|
|
2
5
|
export const quantity = (value) => value;
|
|
6
|
+
/**
|
|
7
|
+
* Names a number in millimetres.
|
|
8
|
+
* @category Units
|
|
9
|
+
*/
|
|
3
10
|
export const mm = quantity;
|
|
11
|
+
/**
|
|
12
|
+
* Names a number in centimetres.
|
|
13
|
+
* @category Units
|
|
14
|
+
*/
|
|
4
15
|
export const cm = quantity;
|
|
16
|
+
/**
|
|
17
|
+
* Names a number in pixels of a scan.
|
|
18
|
+
* @category Units
|
|
19
|
+
*/
|
|
5
20
|
export const px = quantity;
|
|
21
|
+
/**
|
|
22
|
+
* Names a number as a position across the roll, as the tracker bar
|
|
23
|
+
* numbers it.
|
|
24
|
+
* @category Units
|
|
25
|
+
*/
|
|
6
26
|
export const track = quantity;
|
|
27
|
+
/**
|
|
28
|
+
* Names a number in seconds.
|
|
29
|
+
* @category Units
|
|
30
|
+
*/
|
|
7
31
|
export const seconds = quantity;
|
|
32
|
+
/**
|
|
33
|
+
* Names a number in milliseconds.
|
|
34
|
+
* @category Units
|
|
35
|
+
*/
|
|
8
36
|
export const milliseconds = quantity;
|
|
37
|
+
/**
|
|
38
|
+
* Names a number as a paper speed in feet per minute.
|
|
39
|
+
* @category Units
|
|
40
|
+
*/
|
|
9
41
|
export const feetPerMinute = quantity;
|
|
42
|
+
/**
|
|
43
|
+
* Names a number as a paper speed in metres per minute.
|
|
44
|
+
* @category Units
|
|
45
|
+
*/
|
|
10
46
|
export const metersPerMinute = quantity;
|
|
47
|
+
/**
|
|
48
|
+
* Names a number as the resolution of a scan, in pixels per inch.
|
|
49
|
+
* @category Units
|
|
50
|
+
*/
|
|
11
51
|
export const pixelsPerInch = quantity;
|
|
52
|
+
/**
|
|
53
|
+
* Names a number as an angle in degrees.
|
|
54
|
+
* @category Units
|
|
55
|
+
*/
|
|
12
56
|
export const degrees = quantity;
|
|
57
|
+
/**
|
|
58
|
+
* Names a number as a share in per cent.
|
|
59
|
+
* @category Units
|
|
60
|
+
*/
|
|
13
61
|
export const percent = quantity;
|
|
14
62
|
// The second operand takes its unit from the first. Inferred from both,
|
|
15
63
|
// TypeScript would unite two units rather than reject them.
|
|
64
|
+
/**
|
|
65
|
+
* The sum of two quantities in one unit.
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
16
68
|
export const add = (a, b) => quantity(a + b);
|
|
69
|
+
/**
|
|
70
|
+
* The first quantity less the second, in their unit.
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
17
73
|
export const subtract = (a, b) => quantity(a - b);
|
|
74
|
+
/**
|
|
75
|
+
* How far apart two quantities in one unit lie, whichever is the
|
|
76
|
+
* larger.
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
18
79
|
export const distance = (a, b) => quantity(Math.abs(a - b));
|
|
19
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* A quantity times a plain factor, such as a stretch.
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
20
84
|
export const scale = (a, factor) => quantity(a * factor);
|
|
21
85
|
// Math.min and Math.max are declared over plain numbers, so a quantity
|
|
22
86
|
// passed through them comes back without its unit.
|
|
87
|
+
/**
|
|
88
|
+
* The smaller of two quantities in one unit.
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
23
91
|
export const min = (a, b) => quantity(Math.min(a, b));
|
|
92
|
+
/**
|
|
93
|
+
* The larger of two quantities in one unit.
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
24
96
|
export const max = (a, b) => quantity(Math.max(a, b));
|
|
25
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* The value brought inside the bounds, which must not be the wrong way round.
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
26
101
|
export const clamp = (value, low, high) => quantity(Math.min(high, Math.max(low, value)));
|
|
27
102
|
// A list is taken at its element type, so one that mixes units yields a
|
|
28
103
|
// union unit rather than an error; only the binary operations reject a mix.
|
|
104
|
+
/**
|
|
105
|
+
* The quantities added up, zero where there are none.
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
29
108
|
export const sum = (values) => quantity(values.reduce((total, value) => total + value, 0));
|
|
109
|
+
/**
|
|
110
|
+
* The mean of the quantities.
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
30
113
|
export const mean = (values) => quantity(sum(values) / values.length);
|
|
31
114
|
const MM_PER_INCH = 25.4;
|
|
32
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* A place in a scan taken at `dpi` dots per inch, on the paper.
|
|
117
|
+
* @internal
|
|
118
|
+
*/
|
|
33
119
|
export const inMillimeters = (place, dpi) => mm(place / dpi * MM_PER_INCH);
|
|
34
|
-
/**
|
|
120
|
+
/**
|
|
121
|
+
* A place on the paper, in a scan taken at `dpi` dots per inch.
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
35
124
|
export const inPixels = (place, dpi) => px(place / MM_PER_INCH * dpi);
|
|
125
|
+
/**
|
|
126
|
+
* A length in millimetres, in centimetres.
|
|
127
|
+
* @internal
|
|
128
|
+
*/
|
|
36
129
|
export const inCentimeters = (length) => cm(length / 10);
|
|
37
130
|
const MS_PER_SECOND = 1000;
|
|
131
|
+
/**
|
|
132
|
+
* A time in milliseconds, in seconds.
|
|
133
|
+
* @internal
|
|
134
|
+
*/
|
|
38
135
|
export const inSeconds = (time) => seconds(time / MS_PER_SECOND);
|
|
136
|
+
/**
|
|
137
|
+
* A time in seconds, in milliseconds.
|
|
138
|
+
* @internal
|
|
139
|
+
*/
|
|
39
140
|
export const inMilliseconds = (time) => milliseconds(time * MS_PER_SECOND);
|
|
40
141
|
const METERS_PER_FOOT = 0.3048;
|
|
41
|
-
/**
|
|
142
|
+
/**
|
|
143
|
+
* A speed in metres per minute, whichever unit it was stated in.
|
|
144
|
+
* @category Units
|
|
145
|
+
*/
|
|
42
146
|
export const inMetersPerMinute = (speed) => speed.unit === 'm/min' ? speed.value : metersPerMinute(speed.value * METERS_PER_FOOT);
|
package/lib/model/RollCopy.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { Perforator } from "./Perforator.js";
|
|
|
17
17
|
* tenths of one. It is taken in one direction, along the roll or across
|
|
18
18
|
* it, since machine-made paper does not stretch the same way in both.
|
|
19
19
|
* @see crm:E54 Dimension
|
|
20
|
+
* @category Format types
|
|
20
21
|
*/
|
|
21
22
|
export interface Strain extends Measure<'percent'> {
|
|
22
23
|
/**
|
|
@@ -35,6 +36,7 @@ export interface Strain extends Measure<'percent'> {
|
|
|
35
36
|
* stated here, so that a condition stands only where something was
|
|
36
37
|
* measured. A strain along the roll goes into that working out.
|
|
37
38
|
* @see crm:E3 Condition State
|
|
39
|
+
* @category Format types
|
|
38
40
|
*/
|
|
39
41
|
export interface PaperStretch extends ConditionState<'paper-stretch'> {
|
|
40
42
|
/**
|
|
@@ -53,6 +55,7 @@ export interface PaperStretch extends ConditionState<'paper-stretch'> {
|
|
|
53
55
|
* A general condition description for a roll copy, e.g.
|
|
54
56
|
* overall wear, discoloration, or other observations.
|
|
55
57
|
* @see crm:E3 Condition State
|
|
58
|
+
* @category Format types
|
|
56
59
|
*/
|
|
57
60
|
export interface GeneralRollCondition extends ConditionState<'general'> {
|
|
58
61
|
}
|
|
@@ -63,6 +66,7 @@ export interface GeneralRollCondition extends ConditionState<'general'> {
|
|
|
63
66
|
* that runs into a chain of holes damages the chain as well, which is
|
|
64
67
|
* then stated of the chain as `partially-torn`.
|
|
65
68
|
* @see crm:E3 Condition State
|
|
69
|
+
* @category Format types
|
|
66
70
|
*/
|
|
67
71
|
export interface Tear extends ConditionState<'torn'> {
|
|
68
72
|
/**
|
|
@@ -92,18 +96,25 @@ export interface Tear extends ConditionState<'torn'> {
|
|
|
92
96
|
/**
|
|
93
97
|
* An assignment of a condition (general, paper-stretch or a tear)
|
|
94
98
|
* to a roll copy, annotatable with a belief about its certainty.
|
|
99
|
+
* @category Format types
|
|
95
100
|
*/
|
|
96
101
|
export type RollConditionAssignment = ObjectAssumption<GeneralRollCondition | PaperStretch | Tear>;
|
|
97
102
|
/**
|
|
98
103
|
* The keeper a copy is held by, as an object assumption, so that the
|
|
99
104
|
* statement can carry the belief it rests on and the reasons for it.
|
|
105
|
+
* @category Format types
|
|
100
106
|
*/
|
|
101
107
|
export type KeeperAssignment = ObjectAssumption<Agent>;
|
|
108
|
+
/**
|
|
109
|
+
* The kinds of condition a copy may be stated to be in.
|
|
110
|
+
* @category Vocabulary
|
|
111
|
+
*/
|
|
102
112
|
export declare const rollConditions: readonly ['general', 'paper-stretch', 'torn'];
|
|
103
113
|
/**
|
|
104
114
|
* How far an alignment moves a copy's places before it scales them:
|
|
105
115
|
* along the roll, in the copy's own millimetres, and across it, in
|
|
106
116
|
* tracks.
|
|
117
|
+
* @category Format types
|
|
107
118
|
*/
|
|
108
119
|
export interface Shift {
|
|
109
120
|
/** Along the roll. */
|
|
@@ -128,6 +139,7 @@ export interface Shift {
|
|
|
128
139
|
* What the scale is put down to, the paper or the speed the copy was
|
|
129
140
|
* cut for, is worked out from all the alignments together (`paperOf`).
|
|
130
141
|
* Not exported to RDF.
|
|
142
|
+
* @category Format types
|
|
131
143
|
*/
|
|
132
144
|
export interface Alignment {
|
|
133
145
|
/**
|
|
@@ -165,6 +177,7 @@ export interface Alignment {
|
|
|
165
177
|
* The width and length of a roll copy's paper, as they were measured on
|
|
166
178
|
* it or on its scan.
|
|
167
179
|
* @see crm:E54 Dimension
|
|
180
|
+
* @category Format types
|
|
168
181
|
*/
|
|
169
182
|
export interface RollDimensions {
|
|
170
183
|
/**
|
|
@@ -183,7 +196,10 @@ export interface RollDimensions {
|
|
|
183
196
|
*/
|
|
184
197
|
unit: 'mm';
|
|
185
198
|
}
|
|
186
|
-
/**
|
|
199
|
+
/**
|
|
200
|
+
* The margins on the treble and bass sides of the roll, in the unit the scan was measured in.
|
|
201
|
+
* @category Format types
|
|
202
|
+
*/
|
|
187
203
|
export interface Margins<U extends 'px' | 'mm'> {
|
|
188
204
|
treble: Quantity<U>;
|
|
189
205
|
bass: Quantity<U>;
|
|
@@ -193,6 +209,7 @@ export interface Margins<U extends 'px' | 'mm'> {
|
|
|
193
209
|
* A paper speed, as a roll's label, its catalogue or its format
|
|
194
210
|
* states it.
|
|
195
211
|
* @see crm:E54 Dimension
|
|
212
|
+
* @category Format types
|
|
196
213
|
*/
|
|
197
214
|
export type PaperSpeed = Measure<'ft/min'> | Measure<'m/min'>;
|
|
198
215
|
/**
|
|
@@ -200,6 +217,7 @@ export type PaperSpeed = Measure<'ft/min'> | Measure<'m/min'>;
|
|
|
200
217
|
* the paper used, the date, and the system and paper speed the
|
|
201
218
|
* copy was cut for.
|
|
202
219
|
* @see lrmoo:F32 Item Production Event
|
|
220
|
+
* @category Format types
|
|
203
221
|
*/
|
|
204
222
|
export interface ProductionEvent {
|
|
205
223
|
/**
|
|
@@ -260,8 +278,15 @@ export interface ProductionEvent {
|
|
|
260
278
|
*/
|
|
261
279
|
produced?: AnyFeature[];
|
|
262
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* What a modification of a copy may have been for.
|
|
283
|
+
* @category Vocabulary
|
|
284
|
+
*/
|
|
263
285
|
export declare const modificationPurposes: readonly ['musical-improvement', 'technical-improvement', 'repair', 'labeling', 'control', 'dating', 'glossing'];
|
|
264
|
-
/**
|
|
286
|
+
/**
|
|
287
|
+
* What a modification of a copy was for, as far as it can be told.
|
|
288
|
+
* @category Format types
|
|
289
|
+
*/
|
|
265
290
|
export type ModificationPurpose = typeof modificationPurposes[number];
|
|
266
291
|
/**
|
|
267
292
|
* An identifiable act that changed the roll copy after it was punched.
|
|
@@ -271,6 +296,7 @@ export type ModificationPurpose = typeof modificationPurposes[number];
|
|
|
271
296
|
* is not: drawing, writing and punching bring a feature into being and
|
|
272
297
|
* are productions.
|
|
273
298
|
* @see crm:E79 Part Addition, crm:E80 Part Removal, crm:E12 Production
|
|
299
|
+
* @category Format types
|
|
274
300
|
*/
|
|
275
301
|
export type Modification = Partial<{
|
|
276
302
|
/**
|
|
@@ -329,6 +355,7 @@ export type Modification = Partial<{
|
|
|
329
355
|
* Multiple copies of the same roll may exist across different archives
|
|
330
356
|
* or collections.
|
|
331
357
|
* @see reo:RollCopy
|
|
358
|
+
* @category Format types
|
|
332
359
|
*/
|
|
333
360
|
export interface RollCopy extends WithType<'RollCopy'>, WithId {
|
|
334
361
|
/**
|
|
@@ -471,37 +498,69 @@ export interface RollCopy extends WithType<'RollCopy'>, WithId {
|
|
|
471
498
|
*/
|
|
472
499
|
carries?: ReferenceAssumption[];
|
|
473
500
|
}
|
|
474
|
-
/**
|
|
501
|
+
/**
|
|
502
|
+
* What an act brought onto the copy: what it produced or glued on, a removal nothing.
|
|
503
|
+
* @category Lookups
|
|
504
|
+
*/
|
|
475
505
|
export declare const featuresMadeBy: (modification: Modification) => FeatureOrPatch[];
|
|
476
|
-
/**
|
|
506
|
+
/**
|
|
507
|
+
* Whether the act is one that modified the copy, rather than the production that punched it.
|
|
508
|
+
* @category Lookups
|
|
509
|
+
*/
|
|
477
510
|
export declare const isModification: (act: ProductionEvent | Modification) => act is Modification;
|
|
478
|
-
/**
|
|
511
|
+
/**
|
|
512
|
+
* Whether the act is left stating nothing: it produced, added or removed nothing.
|
|
513
|
+
* @category Lookups
|
|
514
|
+
*/
|
|
479
515
|
export declare const statesNothing: (modification: Modification) => boolean;
|
|
480
516
|
/**
|
|
481
517
|
* The features of the copy act by act: what the punching produced
|
|
482
518
|
* first, then what each modification produced or glued on. A feature a
|
|
483
519
|
* patch bears states no place of its own and is not among them;
|
|
484
520
|
* `withBorneFeatures` reaches those.
|
|
521
|
+
* @category Lookups
|
|
485
522
|
*/
|
|
486
523
|
export declare const featuresByAct: (copy: Pick<RollCopy, 'production' | 'modifications'>) => FeatureOrPatch[][];
|
|
487
|
-
/**
|
|
524
|
+
/**
|
|
525
|
+
* Every feature the copy states at a place of its own, whichever act made it.
|
|
526
|
+
* @category Lookups
|
|
527
|
+
*/
|
|
488
528
|
export declare const featuresOf: (copy: Pick<RollCopy, 'production' | 'modifications'>) => FeatureOrPatch[];
|
|
489
|
-
/**
|
|
529
|
+
/**
|
|
530
|
+
* The programs the measurements of a copy name as having taken them, each once, as far as they name any.
|
|
531
|
+
* @category Lookups
|
|
532
|
+
*/
|
|
490
533
|
export declare const measuringSoftwareOf: (copy: Pick<RollCopy, 'measurements'>) => Software[];
|
|
491
|
-
/**
|
|
534
|
+
/**
|
|
535
|
+
* Whether the condition is the stretch or shrinkage of the paper, as measured on the copy.
|
|
536
|
+
* @category Lookups
|
|
537
|
+
*/
|
|
492
538
|
export declare const isPaperStretch: (condition: RollConditionAssignment) => condition is ObjectAssumption<PaperStretch>;
|
|
493
|
-
/**
|
|
539
|
+
/**
|
|
540
|
+
* What the copy's paper was measured to have done, where anything was measured.
|
|
541
|
+
* @category Lookups
|
|
542
|
+
*/
|
|
494
543
|
export declare const paperStretchOf: (copy: Pick<RollCopy, 'conditions'>) => ObjectAssumption<PaperStretch> | undefined;
|
|
495
|
-
/**
|
|
544
|
+
/**
|
|
545
|
+
* Whether the condition is a tear in the paper.
|
|
546
|
+
* @category Lookups
|
|
547
|
+
*/
|
|
496
548
|
export declare const isTear: (condition: RollConditionAssignment) => condition is ObjectAssumption<Tear>;
|
|
497
|
-
/**
|
|
549
|
+
/**
|
|
550
|
+
* The tears the copy is stated to have.
|
|
551
|
+
* @category Lookups
|
|
552
|
+
*/
|
|
498
553
|
export declare const tearsOf: (copy: Pick<RollCopy, 'conditions'>) => ObjectAssumption<Tear>[];
|
|
499
554
|
/**
|
|
500
555
|
* The bar a copy is read by, which is the one it was cut for. A copy
|
|
501
556
|
* that names no system falls back to `defaultTrackerBar`.
|
|
557
|
+
* @category Systems and emulation
|
|
502
558
|
*/
|
|
503
559
|
export declare const barOf: (copy: Pick<RollCopy, 'production'>) => TrackerBar;
|
|
504
|
-
/**
|
|
560
|
+
/**
|
|
561
|
+
* The diameter of the punch the copy was cut with, where the edition holds it true or likely.
|
|
562
|
+
* @category Lookups
|
|
563
|
+
*/
|
|
505
564
|
export declare const punchDiameterOf: (copy: Pick<RollCopy, 'production'>) => Millimeters | undefined;
|
|
506
565
|
/**
|
|
507
566
|
* Reads the features of a copy as the tracker bar would read them.
|
|
@@ -518,6 +577,7 @@ export declare const punchDiameterOf: (copy: Pick<RollCopy, 'production'>) => Mi
|
|
|
518
577
|
* would be 318 notes nobody played. The features stay on the copy,
|
|
519
578
|
* since they are really on the paper and are his calibration of his own
|
|
520
579
|
* scan; it is the reading that stops.
|
|
580
|
+
* @category Sources
|
|
521
581
|
*/
|
|
522
582
|
export declare function asSymbols(features: readonly FeatureOrPatch[], bar: TrackerBar): AnySymbol[];
|
|
523
583
|
/**
|
|
@@ -525,6 +585,7 @@ export declare function asSymbols(features: readonly FeatureOrPatch[], bar: Trac
|
|
|
525
585
|
* A non-empty result usually means the scan is calibrated wrongly. A chain
|
|
526
586
|
* lying across several positions is counted against each one the bar
|
|
527
587
|
* cannot read, and not at all where it reads them all.
|
|
588
|
+
* @category Sources
|
|
528
589
|
*/
|
|
529
590
|
export declare function unreadTracks(features: readonly FeatureOrPatch[], bar: TrackerBar): Map<Track, number>;
|
|
530
591
|
/**
|
|
@@ -536,5 +597,6 @@ export declare function unreadTracks(features: readonly FeatureOrPatch[], bar: T
|
|
|
536
597
|
* were laid out with, and on the rolls measured so far it comes within
|
|
537
598
|
* about a quarter of a track. It is kept for copies imported before the
|
|
538
599
|
* calibration was written down; anything read since carries its own.
|
|
600
|
+
* @internal
|
|
539
601
|
*/
|
|
540
602
|
export declare const calibrationOf: (copy: RollCopy) => TrackCalibration | undefined;
|