linked-rolls 0.69.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 +12 -1
  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 +13 -2
  100. package/lib/shared/utils.d.ts +12 -0
  101. package/lib/spec/context.json +8 -1
  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
@@ -9,6 +9,7 @@ import { Pixels, Track } from "./Quantity.js";
9
9
  *
10
10
  * column = offset + scannerTrack * separation
11
11
  * trackerBar = scannerTrack + shift
12
+ * @category Format types
12
13
  */
13
14
  export interface TrackCalibration {
14
15
  unit: 'px';
@@ -19,13 +20,20 @@ export interface TrackCalibration {
19
20
  /** Added to the scanning software's numbering to reach the tracker bar. */
20
21
  shift: Track;
21
22
  }
22
- /** Image column at the centre of a tracker bar track. */
23
+ /**
24
+ * Image column at the centre of a tracker bar track.
25
+ * @internal
26
+ */
23
27
  export declare const columnOf: (position: Track, calibration: TrackCalibration) => Pixels;
24
- /** Tracker bar track covering an image column, unrounded. */
28
+ /**
29
+ * Tracker bar track covering an image column, unrounded.
30
+ * @internal
31
+ */
25
32
  export declare const trackAt: (column: Pixels, calibration: TrackCalibration) => Track;
26
33
  /**
27
34
  * The columns covered by a run of tracks, from the outer edge of the
28
35
  * first to the outer edge of the last.
36
+ * @internal
29
37
  */
30
38
  export declare const columnsOf: (from: Track, to: Track, calibration: TrackCalibration) => {
31
39
  from: Pixels;
@@ -1,11 +1,18 @@
1
1
  import { px, subtract, track } from "./Quantity.js";
2
- /** Image column at the centre of a tracker bar track. */
2
+ /**
3
+ * Image column at the centre of a tracker bar track.
4
+ * @internal
5
+ */
3
6
  export const columnOf = (position, calibration) => px(calibration.offset + (position - calibration.shift) * calibration.separation);
4
- /** Tracker bar track covering an image column, unrounded. */
7
+ /**
8
+ * Tracker bar track covering an image column, unrounded.
9
+ * @internal
10
+ */
5
11
  export const trackAt = (column, calibration) => track((column - calibration.offset) / calibration.separation + calibration.shift);
6
12
  /**
7
13
  * The columns covered by a run of tracks, from the outer edge of the
8
14
  * first to the outer edge of the last.
15
+ * @internal
9
16
  */
10
17
  export const columnsOf = (from, to, calibration) => {
11
18
  const [lower, upper] = from <= to ? [from, to] : [to, from];
@@ -8,6 +8,7 @@ import { WithId, WithNote, WithType } from "../shared/utils.js";
8
8
  * A motivation provides a reason or rationale for an editorial change.
9
9
  * Motivations are defined at the version level and referenced by edits.
10
10
  * @see crm:E33 Linguistic Object
11
+ * @category Format types
11
12
  */
12
13
  export type Motivation = WithType<'motivation'> & WithId & WithNote;
13
14
  /**
@@ -16,6 +17,7 @@ export type Motivation = WithType<'motivation'> & WithId & WithNote;
16
17
  * put a symbol depends on what they are and on how their features were
17
18
  * obtained, so the tolerance can differ from derivation to derivation.
18
19
  * @see lrmoo:R76 is derivative of
20
+ * @category Format types
19
21
  */
20
22
  export type Derivation = ReferenceAssumption & {
21
23
  /**
@@ -31,13 +33,17 @@ export type Derivation = ReferenceAssumption & {
31
33
  */
32
34
  collationTolerance?: ObjectAssumption<CollationTolerance>;
33
35
  };
34
- /** The tolerance the derivation was collated at, or the default where it states none. */
36
+ /**
37
+ * The tolerance the derivation was collated at, or the default where it states none.
38
+ * @category Collation and alignment
39
+ */
35
40
  export declare const collationToleranceOf: (derivation: Readonly<Derivation>) => CollationTolerance;
36
41
  /**
37
42
  * How long a version's paper runs for a length of the paper of the
38
43
  * version it derives from: about 0.77 for a Licensee or green re-cut of
39
44
  * a red roll, cut for a slower paper speed.
40
45
  * @see crm:E54 Dimension
46
+ * @category Format types
41
47
  */
42
48
  export interface LengthRatio {
43
49
  /**
@@ -60,6 +66,7 @@ export interface LengthRatio {
60
66
  * the version's edits carry it out, so the mechanical part of a
61
67
  * transfer is stated once instead of being spelled out per note.
62
68
  * @see lrmoo:F28 Expression Creation
69
+ * @category Format types
63
70
  */
64
71
  export interface VersionCreation {
65
72
  /**
@@ -100,6 +107,7 @@ export interface VersionCreation {
100
107
  * sigla off the stemma, so that a label never outlives the arrangement
101
108
  * it describes.
102
109
  * @see lrmoo:F2 Expression
110
+ * @category Format types
103
111
  */
104
112
  export interface Version extends WithId {
105
113
  /**
@@ -145,15 +153,25 @@ export interface Version extends WithId {
145
153
  */
146
154
  motivations: Motivation[];
147
155
  }
148
- /** The edits the version states, none where it leaves its text unstated. */
156
+ /**
157
+ * The edits the version states, none where it leaves its text unstated.
158
+ * @category Versions and stemma
159
+ */
149
160
  export declare const editsOf: (version: Readonly<Version>) => Edit[];
150
- /** The symbols the version's edits insert. */
161
+ /**
162
+ * The symbols the version's edits insert.
163
+ * @category Versions and stemma
164
+ */
151
165
  export declare const insertedBy: (version: Readonly<Version>) => AnySymbol[];
152
- /** The ids of the symbols the version's edits delete. */
166
+ /**
167
+ * The ids of the symbols the version's edits delete.
168
+ * @category Versions and stemma
169
+ */
153
170
  export declare const deletedBy: (version: Readonly<Version>) => string[];
154
171
  /**
155
172
  * The parents the version names, in the order of `basedOn`, each with the
156
173
  * certainty its derivation is held with and the belief it rests on.
174
+ * @category Versions and stemma
157
175
  */
158
176
  export declare const derivationsOf: (version: Readonly<Version>) => {
159
177
  parent: string;
@@ -165,6 +183,7 @@ export declare const derivationsOf: (version: Readonly<Version>) => {
165
183
  * held most certain. One held unlikely or false is a rejected hypothesis
166
184
  * and gives no text. Lowering the certainty of the principal derivation
167
185
  * below another's reads the version's edits against another parent.
186
+ * @category Versions and stemma
168
187
  */
169
188
  export declare const principalDerivationOf: (version: Readonly<Version>) => Readonly<Derivation> | undefined;
170
189
  /**
@@ -173,5 +192,6 @@ export declare const principalDerivationOf: (version: Readonly<Version>) => Read
173
192
  * among them: a hypothesis held more certain becomes the principal one.
174
193
  * A version derives from itself in no statement, and a stemma that
175
194
  * loops is walked once round.
195
+ * @category Versions and stemma
176
196
  */
177
197
  export declare const derivesFrom: (versions: readonly Readonly<Version>[], versionId: string, ancestorId: string) => boolean;
@@ -1,16 +1,29 @@
1
1
  import { certainties, certaintyOf, idOf } from "./Assumption.js";
2
2
  import { defaultCollationTolerance } from "../collation/Collation.js";
3
- /** The tolerance the derivation was collated at, or the default where it states none. */
3
+ /**
4
+ * The tolerance the derivation was collated at, or the default where it states none.
5
+ * @category Collation and alignment
6
+ */
4
7
  export const collationToleranceOf = (derivation) => derivation.collationTolerance ?? defaultCollationTolerance;
5
- /** The edits the version states, none where it leaves its text unstated. */
8
+ /**
9
+ * The edits the version states, none where it leaves its text unstated.
10
+ * @category Versions and stemma
11
+ */
6
12
  export const editsOf = (version) => version.edits ?? [];
7
- /** The symbols the version's edits insert. */
13
+ /**
14
+ * The symbols the version's edits insert.
15
+ * @category Versions and stemma
16
+ */
8
17
  export const insertedBy = (version) => editsOf(version).flatMap(edit => edit.insert ?? []);
9
- /** The ids of the symbols the version's edits delete. */
18
+ /**
19
+ * The ids of the symbols the version's edits delete.
20
+ * @category Versions and stemma
21
+ */
10
22
  export const deletedBy = (version) => editsOf(version).flatMap(edit => edit.delete ?? []);
11
23
  /**
12
24
  * The parents the version names, in the order of `basedOn`, each with the
13
25
  * certainty its derivation is held with and the belief it rests on.
26
+ * @category Versions and stemma
14
27
  */
15
28
  export const derivationsOf = (version) => (version.basedOn ?? []).map(derivation => {
16
29
  const belief = derivation['@annotation']?.belief;
@@ -22,6 +35,7 @@ const rankOf = (derivation) => certainties.indexOf(certaintyOf(derivation));
22
35
  * held most certain. One held unlikely or false is a rejected hypothesis
23
36
  * and gives no text. Lowering the certainty of the principal derivation
24
37
  * below another's reads the version's edits against another parent.
38
+ * @category Versions and stemma
25
39
  */
26
40
  export const principalDerivationOf = (version) => (version.basedOn ?? [])
27
41
  .filter(derivation => rankOf(derivation) <= certainties.indexOf('possible'))
@@ -32,6 +46,7 @@ export const principalDerivationOf = (version) => (version.basedOn ?? [])
32
46
  * among them: a hypothesis held more certain becomes the principal one.
33
47
  * A version derives from itself in no statement, and a stemma that
34
48
  * loops is walked once round.
49
+ * @category Versions and stemma
35
50
  */
36
51
  export const derivesFrom = (versions, versionId, ancestorId) => {
37
52
  const byId = new Map(versions.map(version => [version.id, version]));
@@ -1,3 +1,9 @@
1
+ /**
2
+ * A piece of a note as it is shown: a stretch of text, or a reference
3
+ * to an entity by its id, with the words the note puts in its place
4
+ * where it gives any.
5
+ * @category Format types
6
+ */
1
7
  export type NotePart = {
2
8
  type: 'text';
3
9
  text: string;
@@ -6,14 +12,21 @@ export type NotePart = {
6
12
  id: string;
7
13
  label?: string;
8
14
  };
9
- /** The note in the pieces it is shown in: stretches of text and what they refer to. */
15
+ /**
16
+ * The note in the pieces it is shown in: stretches of text and what they refer to.
17
+ * @category Lookups
18
+ */
10
19
  export declare const partsOfNote: (note: string) => NotePart[];
11
- /** The ids a note refers to, in the order it names them. */
20
+ /**
21
+ * The ids a note refers to, in the order it names them.
22
+ * @category Lookups
23
+ */
12
24
  export declare const referencesInNote: (note: string) => string[];
13
25
  /**
14
26
  * The note as it reads, with every reference resolved to the name the
15
27
  * edition gives that entity, or to the words the note puts in its place.
16
28
  * A reference nothing answers to keeps its id, so that the gap is visible
17
29
  * rather than silent.
30
+ * @category Lookups
18
31
  */
19
32
  export declare const resolveNote: (note: string, nameOf: (id: string) => string | undefined) => string;
@@ -10,7 +10,10 @@
10
10
  * still follows the stemma and a written-out label cannot freeze it.
11
11
  */
12
12
  const reference = /\{\{\s*([^{}|\s]+)\s*(?:\|([^{}]*))?\}\}/g;
13
- /** The note in the pieces it is shown in: stretches of text and what they refer to. */
13
+ /**
14
+ * The note in the pieces it is shown in: stretches of text and what they refer to.
15
+ * @category Lookups
16
+ */
14
17
  export const partsOfNote = (note) => {
15
18
  const parts = [];
16
19
  let read = 0;
@@ -26,13 +29,17 @@ export const partsOfNote = (note) => {
26
29
  parts.push({ type: 'text', text: note.slice(read) });
27
30
  return parts;
28
31
  };
29
- /** The ids a note refers to, in the order it names them. */
32
+ /**
33
+ * The ids a note refers to, in the order it names them.
34
+ * @category Lookups
35
+ */
30
36
  export const referencesInNote = (note) => partsOfNote(note).flatMap(part => part.type === 'reference' ? [part.id] : []);
31
37
  /**
32
38
  * The note as it reads, with every reference resolved to the name the
33
39
  * edition gives that entity, or to the words the note puts in its place.
34
40
  * A reference nothing answers to keeps its id, so that the gap is visible
35
41
  * rather than silent.
42
+ * @category Lookups
36
43
  */
37
44
  export const resolveNote = (note, nameOf) => partsOfNote(note)
38
45
  .map(part => part.type === 'text' ? part.text : nameOf(part.id) ?? part.label ?? part.id)
@@ -8,7 +8,11 @@ import { Concept } from "./Agent.js";
8
8
  * `ontology/types.ttl` is the place a procedure is defined. A test holds
9
9
  * this list against it.
10
10
  * @see crm:E29 Design or Procedure
11
+ * @category Vocabulary
11
12
  */
12
13
  export declare const procedures: readonly Concept[];
13
- /** The procedure of that IRI, where the vocabulary declares one. */
14
+ /**
15
+ * The procedure of that IRI, where the vocabulary declares one.
16
+ * @category Vocabulary
17
+ */
14
18
  export declare const procedureOf: (id: string | undefined) => Concept | undefined;
@@ -8,6 +8,7 @@ const PROCEDURE_IRI = 'https://w3id.org/reo/type/procedure/';
8
8
  * `ontology/types.ttl` is the place a procedure is defined. A test holds
9
9
  * this list against it.
10
10
  * @see crm:E29 Design or Procedure
11
+ * @category Vocabulary
11
12
  */
12
13
  export const procedures = [
13
14
  {
@@ -26,5 +27,8 @@ export const procedures = [
26
27
  sameAs: []
27
28
  }
28
29
  ];
29
- /** The procedure of that IRI, where the vocabulary declares one. */
30
+ /**
31
+ * The procedure of that IRI, where the vocabulary declares one.
32
+ * @category Vocabulary
33
+ */
30
34
  export const procedureOf = (id) => procedures.find(procedure => procedure.id === id);
@@ -3,13 +3,18 @@ import { Concept } from "./Agent.js";
3
3
  * The concepts the type vocabulary declares, whatever kind they are:
4
4
  * the reproducing systems, the procedures and the drives of a
5
5
  * perforator. An edition names one of them by its IRI alone.
6
+ * @category Vocabulary
6
7
  */
7
8
  export declare const vocabulary: readonly Concept[];
8
- /** The concept of that IRI, where the vocabulary declares one. */
9
+ /**
10
+ * The concept of that IRI, where the vocabulary declares one.
11
+ * @category Vocabulary
12
+ */
9
13
  export declare const conceptOf: (id: string | undefined) => Concept | undefined;
10
14
  /**
11
15
  * What a concept is called: the name it states, else the one the
12
16
  * vocabulary gives it, else its IRI, so that a reader always has
13
17
  * something to show.
18
+ * @category Vocabulary
14
19
  */
15
20
  export declare const nameOf: (concept: Concept) => string;
@@ -6,17 +6,22 @@ import { trackerBars } from "../systems/index.js";
6
6
  * The concepts the type vocabulary declares, whatever kind they are:
7
7
  * the reproducing systems, the procedures and the drives of a
8
8
  * perforator. An edition names one of them by its IRI alone.
9
+ * @category Vocabulary
9
10
  */
10
11
  export const vocabulary = [
11
12
  ...trackerBars.map(systemOf),
12
13
  ...procedures,
13
14
  ...drives
14
15
  ];
15
- /** The concept of that IRI, where the vocabulary declares one. */
16
+ /**
17
+ * The concept of that IRI, where the vocabulary declares one.
18
+ * @category Vocabulary
19
+ */
16
20
  export const conceptOf = (id) => id === undefined ? undefined : vocabulary.find(concept => concept.id === id);
17
21
  /**
18
22
  * What a concept is called: the name it states, else the one the
19
23
  * vocabulary gives it, else its IRI, so that a reader always has
20
24
  * something to show.
25
+ * @category Vocabulary
21
26
  */
22
27
  export const nameOf = (concept) => concept.name ?? conceptOf(concept.id)?.name ?? concept.id ?? '';
@@ -1,9 +1,31 @@
1
1
  import { Path } from "../lookup/paths.js";
2
2
  import { AnyArgumentation, Certainty } from "../model/Assumption.js";
3
3
  import { EditionOp } from "./draft.js";
4
- /** Annotates the assumption at the path with a belief held true, for reasons to be added. */
4
+ /**
5
+ * Annotates the assumption at the path with a belief held true, for reasons to be added.
6
+ * @category Operations
7
+ */
5
8
  export declare const createBelief: (path: Path) => EditionOp;
9
+ /**
10
+ * Takes the belief off the assumption at the path, which leaves the
11
+ * statement stated plainly.
12
+ * @category Operations
13
+ */
6
14
  export declare const clearBelief: (path: Path) => EditionOp;
15
+ /**
16
+ * Sets the certainty the belief on the assumption at the path is held
17
+ * with.
18
+ * @category Operations
19
+ */
7
20
  export declare const setCertainty: (path: Path, certainty: Certainty) => EditionOp;
21
+ /**
22
+ * Adds a reason to the belief on the assumption at the path.
23
+ * @category Operations
24
+ */
8
25
  export declare const addReason: (path: Path, reason: AnyArgumentation) => EditionOp;
26
+ /**
27
+ * Takes the reason at the index off the belief on the assumption at the
28
+ * path.
29
+ * @category Operations
30
+ */
9
31
  export declare const removeReason: (path: Path, index: number) => EditionOp;
@@ -10,22 +10,44 @@ const onBeliefAt = (path, op) => onAssumptionAt(path, assumption => {
10
10
  if (belief)
11
11
  op(belief);
12
12
  });
13
- /** Annotates the assumption at the path with a belief held true, for reasons to be added. */
13
+ /**
14
+ * Annotates the assumption at the path with a belief held true, for reasons to be added.
15
+ * @category Operations
16
+ */
14
17
  export const createBelief = (path) => onAssumptionAt(path, assumption => {
15
18
  assumption['@annotation'] = {
16
19
  id: v4(),
17
20
  belief: { type: 'belief', id: v4(), certainty: 'true', reasons: [] }
18
21
  };
19
22
  });
23
+ /**
24
+ * Takes the belief off the assumption at the path, which leaves the
25
+ * statement stated plainly.
26
+ * @category Operations
27
+ */
20
28
  export const clearBelief = (path) => onAssumptionAt(path, assumption => {
21
29
  delete assumption['@annotation'];
22
30
  });
31
+ /**
32
+ * Sets the certainty the belief on the assumption at the path is held
33
+ * with.
34
+ * @category Operations
35
+ */
23
36
  export const setCertainty = (path, certainty) => onBeliefAt(path, belief => {
24
37
  belief.certainty = certainty;
25
38
  });
39
+ /**
40
+ * Adds a reason to the belief on the assumption at the path.
41
+ * @category Operations
42
+ */
26
43
  export const addReason = (path, reason) => onBeliefAt(path, belief => {
27
44
  belief.reasons.push(reason);
28
45
  });
46
+ /**
47
+ * Takes the reason at the index off the belief on the assumption at the
48
+ * path.
49
+ * @category Operations
50
+ */
29
51
  export const removeReason = (path, index) => onBeliefAt(path, belief => {
30
52
  belief.reasons.splice(index, 1);
31
53
  });
@@ -26,12 +26,14 @@ import { EditionOp } from "./draft.js";
26
26
  * A version is based on itself or on one of its own descendants in no
27
27
  * statement, since the stemma would loop; asked for that, nothing
28
28
  * changes.
29
+ * @category Operations
29
30
  */
30
31
  export declare const connectVersions: (childId: string, parentId: string, tolerance?: ObjectAssumption<CollationTolerance>) => EditionOp;
31
32
  /**
32
33
  * Folds the version's own symbols into those it inherits and collates
33
34
  * with: the carriers pass over, and the insertions go. Collates at the
34
35
  * tolerance of the derivation, where the caller names none.
36
+ * @category Operations
35
37
  */
36
38
  export declare const collateSymbols: (versionId: string, symbolIds: readonly string[], tolerance?: CollationTolerance) => EditionOp;
37
39
  /**
@@ -57,5 +59,6 @@ export declare const collateSymbols: (versionId: string, symbolIds: readonly str
57
59
  * and are passed over, so a reading somebody has separated by hand
58
60
  * keeps its identifier and the edit that speaks for it. Named symbols
59
61
  * narrow the act to those; naming none separates the whole reading.
62
+ * @category Operations
60
63
  */
61
64
  export declare const separateReadings: (versionId: string, copies: ReadonlySet<string>, symbolIds?: readonly string[]) => EditionOp;
@@ -60,6 +60,7 @@ const byExchange = (edits) => new Map(edits.map(edit => [exchangeKey((edit.inser
60
60
  * A version is based on itself or on one of its own descendants in no
61
61
  * statement, since the stemma would loop; asked for that, nothing
62
62
  * changes.
63
+ * @category Operations
63
64
  */
64
65
  export const connectVersions = (childId, parentId, tolerance = defaultCollationTolerance) => reading(edition => {
65
66
  if (childId === parentId || derivesFrom(edition.versions, parentId, childId))
@@ -132,6 +133,7 @@ export const connectVersions = (childId, parentId, tolerance = defaultCollationT
132
133
  * Folds the version's own symbols into those it inherits and collates
133
134
  * with: the carriers pass over, and the insertions go. Collates at the
134
135
  * tolerance of the derivation, where the caller names none.
136
+ * @category Operations
135
137
  */
136
138
  export const collateSymbols = (versionId, symbolIds, tolerance) => reading(edition => {
137
139
  const version = versionIn(edition, versionId);
@@ -201,6 +203,7 @@ const sharedWith = (edition, symbol, copies) => {
201
203
  * and are passed over, so a reading somebody has separated by hand
202
204
  * keeps its identifier and the edit that speaks for it. Named symbols
203
205
  * narrow the act to those; naming none separates the whole reading.
206
+ * @category Operations
204
207
  */
205
208
  export const separateReadings = (versionId, copies, symbolIds) => reading(edition => {
206
209
  const version = versionIn(edition, versionId);
@@ -1,8 +1,23 @@
1
1
  import { PlacementRelation } from "../model/Symbol.js";
2
2
  import { EditionOp } from "./draft.js";
3
- /** States how the follower is placed relative to the reference, in place of any earlier statement. */
3
+ /**
4
+ * States how the follower is placed relative to the reference, in place of any earlier statement.
5
+ * @category Operations
6
+ */
4
7
  export declare const placeCommand: (followerId: string, referenceId: string, relation: PlacementRelation) => EditionOp;
8
+ /**
9
+ * Withdraws the statement placing the command relative to another,
10
+ * whichever relation it states.
11
+ * @category Operations
12
+ */
5
13
  export declare const unplaceCommand: (followerId: string) => EditionOp;
6
- /** The pair is stated on `statingId` only, as the format asks. */
14
+ /**
15
+ * The pair is stated on `statingId` only, as the format asks.
16
+ * @category Operations
17
+ */
7
18
  export declare const pairCommands: (statingId: string, partnerId: string) => EditionOp;
19
+ /**
20
+ * Withdraws the pairing the command states.
21
+ * @category Operations
22
+ */
8
23
  export declare const unpairCommand: (statingId: string) => EditionOp;
@@ -14,16 +14,31 @@ const onCommand = (id, op) => reading(edition => draft => {
14
14
  op(symbol);
15
15
  });
16
16
  const clearPlacement = (command) => placementRelations.forEach(relation => { delete command[relation]; });
17
- /** States how the follower is placed relative to the reference, in place of any earlier statement. */
17
+ /**
18
+ * States how the follower is placed relative to the reference, in place of any earlier statement.
19
+ * @category Operations
20
+ */
18
21
  export const placeCommand = (followerId, referenceId, relation) => onCommand(followerId, command => {
19
22
  clearPlacement(command);
20
23
  command[relation] = assignReference(referenceId);
21
24
  });
25
+ /**
26
+ * Withdraws the statement placing the command relative to another,
27
+ * whichever relation it states.
28
+ * @category Operations
29
+ */
22
30
  export const unplaceCommand = (followerId) => onCommand(followerId, clearPlacement);
23
- /** The pair is stated on `statingId` only, as the format asks. */
31
+ /**
32
+ * The pair is stated on `statingId` only, as the format asks.
33
+ * @category Operations
34
+ */
24
35
  export const pairCommands = (statingId, partnerId) => onCommand(statingId, command => {
25
36
  command.pairedWith = assignReference(partnerId);
26
37
  });
38
+ /**
39
+ * Withdraws the pairing the command states.
40
+ * @category Operations
41
+ */
27
42
  export const unpairCommand = (statingId) => onCommand(statingId, command => {
28
43
  delete command.pairedWith;
29
44
  });
@@ -12,12 +12,14 @@ import { EditionOp } from "./draft.js";
12
12
  * inserts every symbol the copy's own tracker bar reads on it. The
13
13
  * version is a reading in that system's words, so it is coded for the
14
14
  * system the copy was cut for.
15
+ * @category Operations
15
16
  */
16
17
  export declare const createVersion: (copy: RollCopy) => EditionOp;
17
18
  /**
18
19
  * Puts the copy into the edition without a version of its own, as for a
19
20
  * copy whose features are not read into symbols: one known only from a
20
21
  * recording states instead which versions it carries.
22
+ * @category Operations
21
23
  */
22
24
  export declare const addCopy: (copy: RollCopy) => EditionOp;
23
25
  /**
@@ -26,6 +28,7 @@ export declare const addCopy: (copy: RollCopy) => EditionOp;
26
28
  * copy, or where the copy is the reference itself. The copy is read at
27
29
  * its own places whatever alignment it has, and through its own bar,
28
30
  * which is what lets a copy cut for another system be aligned at all.
31
+ * @category Operations
29
32
  */
30
33
  export declare const alignmentFor: (edition: Edition, copy: RollCopy, date?: Date) => Alignment | undefined;
31
34
  /**
@@ -34,12 +37,14 @@ export declare const alignmentFor: (edition: Edition, copy: RollCopy, date?: Dat
34
37
  * its features and tears onto the axis by them, in place of any
35
38
  * alignment it had. A copy that shares no run of notes with the
36
39
  * reference copy is left as it was.
40
+ * @category Operations
37
41
  */
38
42
  export declare const alignCopy: (copyId: string, date?: Date) => EditionOp;
39
43
  /**
40
44
  * Aligns every copy that has features with the reference copy, as
41
45
  * `alignCopy` does one. The reference copy itself is taken off any
42
46
  * alignment it had, its places being the axis.
47
+ * @category Operations
43
48
  */
44
49
  export declare const alignCopies: (date?: Date) => EditionOp;
45
50
  /**
@@ -47,27 +52,42 @@ export declare const alignCopies: (date?: Date) => EditionOp;
47
52
  * aligns every other copy onto it. Every place the edition gives along
48
53
  * the roll moves with this, which is why it is a choice and not
49
54
  * something worked out.
55
+ * @category Operations
50
56
  */
51
57
  export declare const chooseReferenceCopy: (copyId: string, date?: Date) => EditionOp;
52
58
  /**
53
59
  * Puts the copy's features back where they were measured, off the
54
60
  * axis. What the alignments say about the paper goes with it, since
55
61
  * that is worked out from them.
62
+ * @category Operations
56
63
  */
57
64
  export declare const unalignCopy: (copyId: string) => EditionOp;
58
65
  /**
59
66
  * Takes the extension a pneumatic reader adds off the ends of the
60
67
  * copy's chains of holes, and records how much was taken, so that their lengths
61
68
  * can be compared with a scanned copy's at all.
69
+ * @category Operations
62
70
  */
63
71
  export declare const shortenCopy: (copyId: string, extension: Millimeters, leaving?: ReadonlySet<string>) => EditionOp;
64
- /** Puts the reader's extension back on the copy's chains of holes. */
72
+ /**
73
+ * Puts the reader's extension back on the copy's chains of holes.
74
+ * @category Operations
75
+ */
65
76
  export declare const unshortenCopy: (copyId: string) => EditionOp;
66
- /** States what the copy's features were read from, in place of any earlier statement. */
77
+ /**
78
+ * States what the copy's features were read from, in place of any earlier statement.
79
+ * @category Operations
80
+ */
67
81
  export declare const stateSource: (copyId: string, source: FeatureSource) => EditionOp;
68
- /** Takes back the statement, leaving the copy silent about its source again. */
82
+ /**
83
+ * Takes back the statement, leaving the copy silent about its source again.
84
+ * @category Operations
85
+ */
69
86
  export declare const clearSource: (copyId: string) => EditionOp;
70
- /** Gives the copy the siglum it is referred to by, or takes it away where the siglum given is blank. */
87
+ /**
88
+ * Gives the copy the siglum it is referred to by, or takes it away where the siglum given is blank.
89
+ * @category Operations
90
+ */
71
91
  export declare const nameCopy: (copyId: string, siglum: string) => EditionOp;
72
92
  /** Takes out the copy's statements that match, and the list itself where none is left. */
73
93
  export declare const dropStatements: (copy: Draft<RollCopy>, matches: (statement: Readonly<ReferenceAssumption>) => boolean) => void;
@@ -77,15 +97,20 @@ export declare const dropStatements: (copy: Draft<RollCopy>, matches: (statement
77
97
  * one known only from a recording, and `carriageProblems` reports it
78
98
  * where features carry symbols already. A second statement about one
79
99
  * version is none.
100
+ * @category Operations
80
101
  */
81
102
  export declare const stateCarriage: (copyId: string, versionId: string, belief?: Belief) => EditionOp;
82
- /** Takes back the copy's statement that it carries the version. */
103
+ /**
104
+ * Takes back the copy's statement that it carries the version.
105
+ * @category Operations
106
+ */
83
107
  export declare const clearCarriage: (copyId: string, versionId: string) => EditionOp;
84
108
  /**
85
109
  * Adds a general condition to the copy, beside whatever is stated of it
86
110
  * already. A paper stretch is added the same way, where one was
87
111
  * measured; what the alignments say of the paper is worked out from
88
112
  * them and stated nowhere.
113
+ * @category Operations
89
114
  */
90
115
  export declare const addGeneralCondition: (copyId: string, condition: ObjectAssumption<GeneralRollCondition>) => EditionOp;
91
116
  /**
@@ -93,19 +118,25 @@ export declare const addGeneralCondition: (copyId: string, condition: ObjectAssu
93
118
  * what was stated before; given nothing, it takes the statement away. A
94
119
  * copy has one paper, so it has one such condition, which may give a
95
120
  * strain in either direction.
121
+ * @category Operations
96
122
  */
97
123
  export declare const statePaperStretch: (copyId: string, stretch?: ObjectAssumption<PaperStretch>) => EditionOp;
98
124
  /**
99
125
  * Adds a tear to the copy, beside whatever is stated of it already. The
100
126
  * tear is given on the axis, where the copy's features stand, and moves
101
127
  * with them from then on.
128
+ * @category Operations
102
129
  */
103
130
  export declare const addTear: (copyId: string, tear: ObjectAssumption<Tear>) => EditionOp;
104
- /** The symbols of the versions that no other copy carries. */
131
+ /**
132
+ * The symbols of the versions that no other copy carries.
133
+ * @category Operations
134
+ */
105
135
  export declare const symbolsCarriedOnlyBy: (edition: Edition, copyId: string) => AnySymbol[];
106
136
  /**
107
137
  * Takes the copy out of the edition together with the symbols only it
108
138
  * carries, and with every reference the versions and the argumentations
109
139
  * made to those symbols.
140
+ * @category Operations
110
141
  */
111
142
  export declare const removeCopy: (copyId: string) => EditionOp;