ochre-sdk 1.3.25 → 1.3.27

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 (97) hide show
  1. package/dist/categories.d.mts +56 -56
  2. package/dist/categories.mjs +39 -39
  3. package/dist/constants.d.mts +8 -8
  4. package/dist/constants.mjs +6 -6
  5. package/dist/errors.d.mts +12 -12
  6. package/dist/errors.mjs +22 -23
  7. package/dist/fetchers/container-items.d.mts +28 -28
  8. package/dist/fetchers/container-items.mjs +27 -27
  9. package/dist/fetchers/gallery.d.mts +13 -13
  10. package/dist/fetchers/gallery.mjs +2 -2
  11. package/dist/fetchers/item-children.d.mts +12 -12
  12. package/dist/fetchers/item-children.mjs +2 -2
  13. package/dist/fetchers/item-links.d.mts +10 -10
  14. package/dist/fetchers/item-links.mjs +6 -6
  15. package/dist/fetchers/item-locations.d.mts +20 -20
  16. package/dist/fetchers/item-locations.mjs +3 -3
  17. package/dist/fetchers/item-ocr-data.d.mts +23 -23
  18. package/dist/fetchers/item-ocr-data.mjs +44 -44
  19. package/dist/fetchers/item.d.mts +23 -18
  20. package/dist/fetchers/item.mjs +15 -15
  21. package/dist/fetchers/map-layers.d.mts +15 -15
  22. package/dist/fetchers/map-layers.mjs +12 -11
  23. package/dist/fetchers/request.d.mts +40 -40
  24. package/dist/fetchers/request.mjs +37 -37
  25. package/dist/fetchers/set/items.d.mts +15 -15
  26. package/dist/fetchers/set/items.mjs +1 -1
  27. package/dist/fetchers/set/property-values.d.mts +16 -16
  28. package/dist/fetchers/set/property-values.mjs +43 -43
  29. package/dist/fetchers/tree/items.d.mts +27 -27
  30. package/dist/fetchers/tree/items.mjs +1 -1
  31. package/dist/fetchers/website-metadata.d.mts +4 -4
  32. package/dist/fetchers/website-metadata.mjs +9 -9
  33. package/dist/fetchers/website.d.mts +10 -10
  34. package/dist/fetchers/website.mjs +12 -12
  35. package/dist/getters.d.mts +83 -83
  36. package/dist/getters.mjs +74 -74
  37. package/dist/helpers.d.mts +4 -4
  38. package/dist/helpers.mjs +7 -7
  39. package/dist/index.d.mts +3 -3
  40. package/dist/index.mjs +5 -5
  41. package/dist/languages.d.mts +58 -58
  42. package/dist/languages.mjs +21 -21
  43. package/dist/ocr.d.mts +27 -27
  44. package/dist/ocr.mjs +29 -29
  45. package/dist/parsers/helpers.d.mts +23 -23
  46. package/dist/parsers/helpers.mjs +8 -8
  47. package/dist/parsers/index.d.mts +2 -2
  48. package/dist/parsers/index.mjs +15 -15
  49. package/dist/parsers/languages.d.mts +49 -49
  50. package/dist/parsers/languages.mjs +49 -49
  51. package/dist/parsers/multilingual.d.mts +174 -174
  52. package/dist/parsers/multilingual.mjs +146 -146
  53. package/dist/parsers/partial-date.d.mts +12 -12
  54. package/dist/parsers/partial-date.mjs +11 -11
  55. package/dist/parsers/property-token.d.mts +20 -20
  56. package/dist/parsers/property-token.mjs +16 -16
  57. package/dist/parsers/string.d.mts +33 -33
  58. package/dist/parsers/string.mjs +62 -64
  59. package/dist/parsers/website/bounds.d.mts +6 -6
  60. package/dist/parsers/website/bounds.mjs +5 -5
  61. package/dist/parsers/website/components.d.mts +46 -31
  62. package/dist/parsers/website/components.mjs +84 -51
  63. package/dist/parsers/website/index.d.mts +2 -2
  64. package/dist/parsers/website/index.mjs +45 -48
  65. package/dist/parsers/website/links.d.mts +24 -24
  66. package/dist/parsers/website/links.mjs +18 -18
  67. package/dist/parsers/website/messages.d.mts +16 -16
  68. package/dist/parsers/website/messages.mjs +14 -14
  69. package/dist/parsers/website/options.d.mts +1 -1
  70. package/dist/parsers/website/properties.d.mts +17 -8
  71. package/dist/parsers/website/properties.mjs +31 -10
  72. package/dist/parsers/website/reader.d.mts +55 -47
  73. package/dist/parsers/website/reader.mjs +66 -51
  74. package/dist/parsers/website/slug.d.mts +50 -50
  75. package/dist/parsers/website/slug.mjs +36 -36
  76. package/dist/parsers/website/styles.d.mts +18 -18
  77. package/dist/parsers/website/styles.mjs +19 -19
  78. package/dist/parsers/website/walk.d.mts +46 -46
  79. package/dist/parsers/website/walk.mjs +34 -34
  80. package/dist/query.d.mts +63 -63
  81. package/dist/query.mjs +137 -140
  82. package/dist/reflection.d.mts +51 -51
  83. package/dist/reflection.mjs +45 -45
  84. package/dist/schemas.d.mts +44 -44
  85. package/dist/schemas.mjs +50 -50
  86. package/dist/types/index.d.mts +192 -192
  87. package/dist/types/utilities.d.mts +5 -5
  88. package/dist/types/website.d.mts +74 -62
  89. package/dist/xml/dates.d.mts +9 -9
  90. package/dist/xml/dates.mjs +9 -9
  91. package/dist/xml/metadata.d.mts +14 -14
  92. package/dist/xml/metadata.mjs +18 -18
  93. package/dist/xml/schemas.mjs +24 -24
  94. package/dist/xml/types.d.mts +9 -9
  95. package/dist/xquery.d.mts +49 -49
  96. package/dist/xquery.mjs +50 -50
  97. package/package.json +10 -10
@@ -2,31 +2,31 @@ import { MultilingualString } from "../parsers/multilingual.mjs";
2
2
  import { Prettify } from "./utilities.mjs";
3
3
  import { Style, Webpage } from "./website.mjs";
4
4
  /**
5
- * Language-code tuple or array used by OCHRE multilingual fields.
6
- *
7
- * Use the default when the consumer does not need to narrow a value to a
8
- * specific language tuple.
9
- */
5
+ Language-code tuple or array used by OCHRE multilingual fields.
6
+
7
+ Use the default when the consumer does not need to narrow a value to a
8
+ specific language tuple.
9
+ */
10
10
  export type LanguageCodes = ReadonlyArray<string>;
11
11
  /**
12
- * The category of an item in OCHRE
13
- */
12
+ The category of an item in OCHRE
13
+ */
14
14
  export type ItemCategory = "tree" | "bibliography" | "concept" | "spatialUnit" | "period" | "person" | "propertyVariable" | "propertyValue" | "resource" | "text" | "set";
15
15
  /**
16
- * OCHRE item categories that can contain other items in API payloads.
17
- */
16
+ OCHRE item categories that can contain other items in API payloads.
17
+ */
18
18
  export type ItemContainerCategory = Extract<ItemCategory, "tree" | "set">;
19
19
  /**
20
- * OCHRE item categories that expose recursive embedded item payloads.
21
- */
20
+ OCHRE item categories that expose recursive embedded item payloads.
21
+ */
22
22
  export type ItemCategoryWithEmbeddedItems = Extract<ItemCategory, "tree" | "bibliography" | "concept" | "spatialUnit" | "period" | "resource" | "set">;
23
23
  /**
24
- * The category of items in a Tree
25
- */
24
+ The category of items in a Tree
25
+ */
26
26
  export type TreeItemCategory = Exclude<ItemCategory, "tree">;
27
27
  /**
28
- * The category of items in a Set
29
- */
28
+ The category of items in a Set
29
+ */
30
30
  export type SetItemCategory = ItemCategory;
31
31
  export type ItemCategoryOption<U extends ItemCategory = ItemCategory> = U | ReadonlyArray<U>;
32
32
  export type ItemCategoryFromOption<U extends ItemCategoryOption | undefined = undefined> = U extends ReadonlyArray<infer V> ? Extract<V, ItemCategory> : U extends ItemCategory ? U : ItemCategory;
@@ -34,16 +34,16 @@ export type ContainedItemCategory<U extends ItemCategory = ItemCategory> = U ext
34
34
  export type ContainedItemCategoryOption<U extends ItemCategory = ItemCategory> = U extends "tree" ? TreeItemCategory : U extends "set" ? SetItemCategory | ReadonlyArray<SetItemCategory> : never;
35
35
  export type ContainedItemCategoryFromOption<U extends ItemCategory = ItemCategory, V extends ContainedItemCategoryOption<U> | undefined = undefined> = V extends ReadonlyArray<infer W> ? Extract<W, ContainedItemCategory<U>> : V extends ContainedItemCategory<U> ? V : ContainedItemCategory<U>;
36
36
  /**
37
- * The category of items in a heading
38
- */
37
+ The category of items in a heading
38
+ */
39
39
  export type HeadingItemCategory = Exclude<ItemCategory, "tree" | "bibliography" | "spatialUnit" | "concept" | "period">;
40
40
  /**
41
- * The category names that can appear in OCHRE context paths
42
- */
41
+ The category names that can appear in OCHRE context paths
42
+ */
43
43
  export type ContextItemCategory = Exclude<ItemCategory, "tree" | "person" | "set">;
44
44
  /**
45
- * Basic identification information
46
- */
45
+ Basic identification information
46
+ */
47
47
  export type Identification<T extends LanguageCodes = LanguageCodes> = {
48
48
  label: MultilingualString<T>;
49
49
  abbreviation: MultilingualString<T> | null;
@@ -52,8 +52,8 @@ export type Identification<T extends LanguageCodes = LanguageCodes> = {
52
52
  website: string | null;
53
53
  };
54
54
  /**
55
- * Metadata in OCHRE
56
- */
55
+ Metadata in OCHRE
56
+ */
57
57
  export type Metadata<T extends LanguageCodes = LanguageCodes> = {
58
58
  dataset: string;
59
59
  description: string;
@@ -90,11 +90,11 @@ export type BelongsTo = {
90
90
  abbreviation: string;
91
91
  };
92
92
  /**
93
- * Parsed item payload context.
94
- *
95
- * Direct children of standalone non-Tree items are shallow. Items parsed from
96
- * Trees still use "embedded" and can expose recursive descendants.
97
- */
93
+ Parsed item payload context.
94
+
95
+ Direct children of standalone non-Tree items are shallow. Items parsed from
96
+ Trees still use "embedded" and can expose recursive descendants.
97
+ */
98
98
  export type ItemPayloadKind = "topLevel" | "embedded" | "standaloneChild";
99
99
  type RecursiveChildPayloadKind<U extends ItemPayloadKind> = U extends "topLevel" ? "standaloneChild" : "embedded";
100
100
  type RecursiveItemChildren<U extends ItemPayloadKind, V> = U extends "standaloneChild" ? Array<never> : Array<V>;
@@ -108,15 +108,15 @@ type ItemEnvelopeFields<T extends LanguageCodes, U extends ItemPayloadKind> = U
108
108
  persistentUrl: null;
109
109
  };
110
110
  /**
111
- * License in OCHRE
112
- */
111
+ License in OCHRE
112
+ */
113
113
  export type License = {
114
114
  content: string;
115
115
  target: string | null;
116
116
  };
117
117
  /**
118
- * Context item in OCHRE
119
- */
118
+ Context item in OCHRE
119
+ */
120
120
  export type ContextItem = {
121
121
  uuid: string | null;
122
122
  publicationDateTime: Date | null;
@@ -124,35 +124,35 @@ export type ContextItem = {
124
124
  content: string;
125
125
  };
126
126
  /**
127
- * Context node in OCHRE
128
- */
127
+ Context node in OCHRE
128
+ */
129
129
  export type ContextNode<U extends ContextItemCategory = ContextItemCategory> = {
130
130
  tree: ContextItem;
131
131
  project: ContextItem;
132
132
  heading: Array<ContextItem>;
133
133
  } & Partial<Record<U, Array<ContextItem>>>;
134
134
  /**
135
- * Context in OCHRE
136
- */
135
+ Context in OCHRE
136
+ */
137
137
  export type Context<U extends ContextItemCategory = ContextItemCategory> = {
138
138
  nodes: Array<ContextNode<U>>;
139
139
  displayPath: string;
140
140
  };
141
141
  /**
142
- * Qualifier of a partial date, the EDTF `?`, `~` and `%`
143
- */
142
+ Qualifier of a partial date, the EDTF `?`, `~` and `%`
143
+ */
144
144
  export type PartialDateQualifier = "uncertain" | "approximate" | "uncertainAndApproximate";
145
145
  /**
146
- * Season of a partial date, the EDTF months 21 to 24
147
- */
146
+ Season of a partial date, the EDTF months 21 to 24
147
+ */
148
148
  export type PartialDateSeason = "spring" | "summer" | "autumn" | "winter";
149
149
  /**
150
- * Partial date in OCHRE
151
- *
152
- * `year` has four characters, each a digit or `X` for an unspecified digit,
153
- * as in `1941` or `194X`. A date has a month or a season, never both, and a
154
- * day only with a month.
155
- */
150
+ Partial date in OCHRE
151
+
152
+ `year` has four characters, each a digit or `X` for an unspecified digit,
153
+ as in `1941` or `194X`. A date has a month or a season, never both, and a
154
+ day only with a month.
155
+ */
156
156
  export type PartialDateValue = {
157
157
  year: string;
158
158
  month: number | null;
@@ -161,11 +161,11 @@ export type PartialDateValue = {
161
161
  qualifier: PartialDateQualifier | null;
162
162
  };
163
163
  /**
164
- * Start or end of a partial date range in OCHRE
165
- *
166
- * `oneOf` is a year field that lists alternative years, as in `1951/1952`.
167
- * `unparsed` keeps the fields as entered when they are not a partial date.
168
- */
164
+ Start or end of a partial date range in OCHRE
165
+
166
+ `oneOf` is a year field that lists alternative years, as in `1951/1952`.
167
+ `unparsed` keeps the fields as entered when they are not a partial date.
168
+ */
169
169
  export type PartialDateBound = {
170
170
  kind: "date";
171
171
  value: PartialDateValue;
@@ -179,19 +179,19 @@ export type PartialDateBound = {
179
179
  day: string | null;
180
180
  };
181
181
  /**
182
- * Partial dates of an event in OCHRE
183
- *
184
- * `edtf` is the range as an Extended Date/Time Format string, or `null` when
185
- * EDTF cannot express it
186
- */
182
+ Partial dates of an event in OCHRE
183
+
184
+ `edtf` is the range as an Extended Date/Time Format string, or `null` when
185
+ EDTF cannot express it
186
+ */
187
187
  export type PartialDate = {
188
188
  start: PartialDateBound | null;
189
189
  end: PartialDateBound | null;
190
190
  edtf: string | null;
191
191
  };
192
192
  /**
193
- * Event in OCHRE
194
- */
193
+ Event in OCHRE
194
+ */
195
195
  export type Event<T extends LanguageCodes = LanguageCodes> = {
196
196
  date: Date | {
197
197
  start: Date;
@@ -223,8 +223,8 @@ export type Event<T extends LanguageCodes = LanguageCodes> = {
223
223
  } | null;
224
224
  };
225
225
  /**
226
- * Source of coordinates in OCHRE
227
- */
226
+ Source of coordinates in OCHRE
227
+ */
228
228
  export type CoordinatesSource<T extends LanguageCodes = LanguageCodes> = {
229
229
  context: "self";
230
230
  uuid: string;
@@ -244,8 +244,8 @@ export type CoordinatesSource<T extends LanguageCodes = LanguageCodes> = {
244
244
  label: MultilingualString<T>;
245
245
  };
246
246
  /**
247
- * Coordinates in OCHRE
248
- */
247
+ Coordinates in OCHRE
248
+ */
249
249
  export type Coordinates<T extends LanguageCodes = LanguageCodes> = {
250
250
  type: "point";
251
251
  latitude: number;
@@ -271,8 +271,8 @@ export type Coordinates<T extends LanguageCodes = LanguageCodes> = {
271
271
  source: CoordinatesSource<T> | null;
272
272
  };
273
273
  /**
274
- * Image in OCHRE
275
- */
274
+ Image in OCHRE
275
+ */
276
276
  export type Image<T extends LanguageCodes = LanguageCodes> = {
277
277
  publicationDateTime: Date | null;
278
278
  identification: Identification<T> | null;
@@ -284,8 +284,8 @@ export type Image<T extends LanguageCodes = LanguageCodes> = {
284
284
  base64: string | null;
285
285
  };
286
286
  /**
287
- * Download option of an item in OCHRE
288
- */
287
+ Download option of an item in OCHRE
288
+ */
289
289
  export type DownloadOption = {
290
290
  type: "highQuality" | "iiifManifest" | "document" | "ocr" | "mets" | "alto";
291
291
  href: string;
@@ -293,8 +293,8 @@ export type DownloadOption = {
293
293
  fileSize: number | null;
294
294
  };
295
295
  /**
296
- * Area of an image map in OCHRE
297
- */
296
+ Area of an image map in OCHRE
297
+ */
298
298
  export type ImageMapArea = {
299
299
  uuid: string;
300
300
  publicationDateTime: Date | null;
@@ -323,30 +323,30 @@ export type ImageMapArea = {
323
323
  }>;
324
324
  };
325
325
  /**
326
- * Image map in OCHRE
327
- */
326
+ Image map in OCHRE
327
+ */
328
328
  export type ImageMap = {
329
329
  areas: Array<ImageMapArea>;
330
330
  width: number;
331
331
  height: number;
332
332
  };
333
333
  /**
334
- * Positioned OCR string in OCHRE
335
- *
336
- * OCHRE gives no guarantee about the node hierarchy inside a Resource's
337
- * `<ocr>` layer, so only its word nodes are parsed, at whatever depth they
338
- * occur. A word node is any element named `string` in any casing and any
339
- * namespace, and its text is read from the `CONTENT` attribute.
340
- *
341
- * `x` and `y` come from `HPOS` and `VPOS` and locate the top-left corner of
342
- * the word's box, while `vertices` comes from `VERTICES` and is its full
343
- * bounding polygon, which is not necessarily rectangular. Every geometry
344
- * attribute is optional in the source, so each one is null when absent or
345
- * unparseable, and `vertices` is then empty.
346
- *
347
- * `resourceUuid` is the Resource that owns the OCR layer, which differs from
348
- * the requested item when the OCR lives on a child Resource.
349
- */
334
+ Positioned OCR string in OCHRE
335
+
336
+ OCHRE gives no guarantee about the node hierarchy inside a Resource's
337
+ `<ocr>` layer, so only its word nodes are parsed, at whatever depth they
338
+ occur. A word node is any element named `string` in any casing and any
339
+ namespace, and its text is read from the `CONTENT` attribute.
340
+
341
+ `x` and `y` come from `HPOS` and `VPOS` and locate the top-left corner of
342
+ the word's box, while `vertices` comes from `VERTICES` and is its full
343
+ bounding polygon, which is not necessarily rectangular. Every geometry
344
+ attribute is optional in the source, so each one is null when absent or
345
+ unparseable, and `vertices` is then empty.
346
+
347
+ `resourceUuid` is the Resource that owns the OCR layer, which differs from
348
+ the requested item when the OCR lives on a child Resource.
349
+ */
350
350
  export type OcrString = {
351
351
  resourceUuid: string | null;
352
352
  content: string;
@@ -360,8 +360,8 @@ export type OcrString = {
360
360
  }>;
361
361
  };
362
362
  /**
363
- * Note in OCHRE
364
- */
363
+ Note in OCHRE
364
+ */
365
365
  export type Note<T extends LanguageCodes = LanguageCodes> = {
366
366
  number: number;
367
367
  title: MultilingualString<T> | null;
@@ -369,8 +369,8 @@ export type Note<T extends LanguageCodes = LanguageCodes> = {
369
369
  authors: Array<Person<T, "embedded">>;
370
370
  };
371
371
  /**
372
- * Property value content in OCHRE
373
- */
372
+ Property value content in OCHRE
373
+ */
374
374
  export type PropertyValueContent<T extends LanguageCodes = LanguageCodes> = Prettify<{
375
375
  hierarchy: {
376
376
  isLeaf: boolean;
@@ -399,8 +399,8 @@ export type PropertyValueContent<T extends LanguageCodes = LanguageCodes> = Pret
399
399
  content: boolean;
400
400
  })>;
401
401
  /**
402
- * Property in OCHRE
403
- */
402
+ Property in OCHRE
403
+ */
404
404
  export type Property<T extends LanguageCodes = LanguageCodes> = {
405
405
  variable: {
406
406
  uuid: string;
@@ -413,9 +413,9 @@ export type Property<T extends LanguageCodes = LanguageCodes> = {
413
413
  properties: Array<Property<T>>;
414
414
  };
415
415
  /**
416
- * Simplified property in OCHRE website payloads. Simplified property variables
417
- * expose scalar labels rather than multilingual labels.
418
- */
416
+ Simplified property in OCHRE website payloads. Simplified property variables
417
+ expose scalar labels rather than multilingual labels.
418
+ */
419
419
  export type SimplifiedProperty<T extends LanguageCodes = LanguageCodes> = {
420
420
  variable: {
421
421
  uuid: string;
@@ -428,8 +428,8 @@ export type SimplifiedProperty<T extends LanguageCodes = LanguageCodes> = {
428
428
  properties: Array<SimplifiedProperty<T>>;
429
429
  };
430
430
  /**
431
- * Property in a Set item. OCHRE exposes Set item properties as a flat list.
432
- */
431
+ Property in a Set item. OCHRE exposes Set item properties as a flat list.
432
+ */
433
433
  export type SetItemProperty<T extends LanguageCodes = LanguageCodes> = Omit<Property<T>, "properties">;
434
434
  export type SetItemSimplifiedProperty<T extends LanguageCodes = LanguageCodes> = Omit<SimplifiedProperty<T>, "properties">;
435
435
  export type PropertyLike<T extends LanguageCodes = LanguageCodes> = Property<T> | SetItemProperty<T> | SimplifiedProperty<T> | SetItemSimplifiedProperty<T>;
@@ -444,8 +444,8 @@ type WithSetItemProperties<U extends {
444
444
  properties: Array<SetItemProperty<T>>;
445
445
  }> : never;
446
446
  /**
447
- * Base item in OCHRE
448
- */
447
+ Base item in OCHRE
448
+ */
449
449
  export type BaseItem<U extends ItemCategory = ItemCategory, T extends LanguageCodes = LanguageCodes, V extends ItemPayloadKind = "topLevel"> = ItemEnvelopeFields<T, V> & {
450
450
  uuid: string;
451
451
  category: U;
@@ -462,8 +462,8 @@ export type BaseItem<U extends ItemCategory = ItemCategory, T extends LanguageCo
462
462
  };
463
463
  export type ItemLinkCategory = ItemCategory | "dictionaryUnit";
464
464
  /**
465
- * Base item data exposed by OCHRE link and reverse-link payloads.
466
- */
465
+ Base item data exposed by OCHRE link and reverse-link payloads.
466
+ */
467
467
  export type BaseItemLink<U extends ItemLinkCategory = ItemLinkCategory, T extends LanguageCodes = LanguageCodes> = {
468
468
  uuid: string;
469
469
  category: U;
@@ -558,28 +558,28 @@ export type TextItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<Bas
558
558
  }>;
559
559
  export type DictionaryUnitItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"dictionaryUnit", T>>;
560
560
  /**
561
- * An abridged item reference exposed inside OCHRE links and reverse links.
562
- */
561
+ An abridged item reference exposed inside OCHRE links and reverse links.
562
+ */
563
563
  export type ItemLink<U extends ItemLinkCategory = ItemLinkCategory, T extends LanguageCodes = LanguageCodes> = U extends ItemLinkCategory ? U extends "tree" ? TreeItemLink<T> : U extends "set" ? SetItemLink<T> : U extends "bibliography" ? BibliographyItemLink<T> : U extends "concept" ? ConceptItemLink<T> : U extends "spatialUnit" ? SpatialUnitItemLink<T> : U extends "period" ? PeriodItemLink<T> : U extends "person" ? PersonItemLink<T> : U extends "propertyVariable" ? PropertyVariableItemLink<T> : U extends "propertyValue" ? PropertyValueItemLink<T> : U extends "resource" ? ResourceItemLink<T> : U extends "text" ? TextItemLink<T> : U extends "dictionaryUnit" ? DictionaryUnitItemLink<T> : never : never;
564
564
  /**
565
- * An Item in OCHRE (can be a tree, set, bibliography, concept, spatial unit, period, person, property value, property variable, or resource)
566
- */
565
+ An Item in OCHRE (can be a tree, set, bibliography, concept, spatial unit, period, person, property value, property variable, or resource)
566
+ */
567
567
  export type Item<U extends ItemCategory = ItemCategory, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes, W extends ItemPayloadKind = "topLevel"> = U extends ItemCategory ? U extends "tree" ? Tree<Extract<V, TreeItemCategory>, T, W> : U extends "set" ? Set<Extract<V, SetItemCategory>, T, W> : U extends "bibliography" ? Bibliography<T, W> : U extends "concept" ? Concept<T, W> : U extends "spatialUnit" ? SpatialUnit<T, W> : U extends "period" ? Period<T, W> : U extends "person" ? Person<T, W> : U extends "propertyVariable" ? PropertyVariable<T, W> : U extends "propertyValue" ? PropertyValue<T, W> : U extends "resource" ? Resource<T, W> : U extends "text" ? Text<T, W> : never : never;
568
568
  /**
569
- * An item fetched without its embedded item hierarchy.
570
- */
569
+ An item fetched without its embedded item hierarchy.
570
+ */
571
571
  export type ItemWithoutEmbeddedItems<U extends ItemCategoryWithEmbeddedItems = ItemCategoryWithEmbeddedItems, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes, W extends ItemPayloadKind = "topLevel"> = U extends ItemCategoryWithEmbeddedItems ? U extends "tree" ? Prettify<Omit<Tree<Extract<V, TreeItemCategory>, T, W>, "items">> : U extends "set" ? Prettify<Omit<Set<Extract<V, SetItemCategory>, T, W>, "items">> : U extends "bibliography" ? Prettify<Omit<Bibliography<T, W>, "items">> : U extends "concept" ? Prettify<Omit<Concept<T, W>, "items">> : U extends "spatialUnit" ? Prettify<Omit<SpatialUnit<T, W>, "items">> : U extends "period" ? Prettify<Omit<Period<T, W>, "items">> : U extends "resource" ? Prettify<Omit<Resource<T, W>, "items">> : never : never;
572
572
  /**
573
- * Heading in OCHRE
574
- */
573
+ Heading in OCHRE
574
+ */
575
575
  export type Heading<U extends HeadingItemCategory = HeadingItemCategory, T extends LanguageCodes = LanguageCodes> = {
576
576
  name: string;
577
577
  headings: Array<Heading<U, T>>;
578
578
  items: Array<Item<U, never, T, "embedded">>;
579
579
  };
580
580
  /**
581
- * Tree in OCHRE
582
- */
581
+ Tree in OCHRE
582
+ */
583
583
  export type Tree<U extends TreeItemCategory = TreeItemCategory, T extends LanguageCodes = LanguageCodes, V extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"tree", T, V> & {
584
584
  type: string | null;
585
585
  containedItemCategory: U | null;
@@ -591,15 +591,15 @@ export type Tree<U extends TreeItemCategory = TreeItemCategory, T extends Langua
591
591
  items: U extends HeadingItemCategory ? Array<Heading<U, T> | Item<U, never, T, "embedded">> : Array<Item<U, never, T, "embedded">>;
592
592
  }>;
593
593
  /**
594
- * Property of a Set style in OCHRE, with the look its values take
595
- */
594
+ Property of a Set style in OCHRE, with the look its values take
595
+ */
596
596
  export type SetStyleProperty<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<Property<T>, "properties"> & {
597
597
  properties: Array<SetStyleProperty<T>>;
598
598
  styles: Array<Style>;
599
599
  }>;
600
600
  /**
601
- * Style of a Set in OCHRE
602
- */
601
+ Style of a Set in OCHRE
602
+ */
603
603
  export type SetStyle<T extends LanguageCodes = LanguageCodes> = {
604
604
  date: Date | null;
605
605
  title: MultilingualString<T> | null;
@@ -608,8 +608,8 @@ export type SetStyle<T extends LanguageCodes = LanguageCodes> = {
608
608
  properties: Array<SetStyleProperty<T>>;
609
609
  };
610
610
  /**
611
- * Set in OCHRE
612
- */
611
+ Set in OCHRE
612
+ */
613
613
  export type Set<U extends SetItemCategory = SetItemCategory, T extends LanguageCodes = LanguageCodes, V extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"set", T, V> & {
614
614
  containedItemCategories: Array<U>;
615
615
  isTabularStructure: boolean;
@@ -637,9 +637,9 @@ export type SetResource<T extends LanguageCodes = LanguageCodes> = Prettify<Omit
637
637
  export type SetTree<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<WithSetItemProperties<Tree<TreeItemCategory, T, "embedded">, T>, "items">>;
638
638
  export type SetItem<U extends SetItemCategory = SetItemCategory, T extends LanguageCodes = LanguageCodes> = U extends "tree" ? SetTree<T> : U extends "bibliography" ? SetBibliography<T> : U extends "concept" ? SetConcept<T> : U extends "spatialUnit" ? SetSpatialUnit<T> : U extends "period" ? SetPeriod<T> : U extends "person" ? WithSetItemProperties<Person<T, "embedded">, T> : U extends "propertyVariable" ? PropertyVariable<T, "embedded"> : U extends "propertyValue" ? WithSetItemProperties<PropertyValue<T, "embedded">, T> : U extends "resource" ? SetResource<T> : U extends "text" ? Text<T, "embedded"> : U extends "set" ? Omit<WithSetItemProperties<Set<SetItemCategory, T, "embedded">, T>, "items"> : never;
639
639
  /**
640
- * The location of a Set item, without its properties, for drawing and ordering
641
- * every match of a query at once
642
- */
640
+ The location of a Set item, without its properties, for drawing and ordering
641
+ every match of a query at once
642
+ */
643
643
  export type ItemLocation<T extends LanguageCodes = LanguageCodes> = {
644
644
  uuid: string;
645
645
  category: SetItemCategory;
@@ -655,9 +655,9 @@ export type ItemLocation<T extends LanguageCodes = LanguageCodes> = {
655
655
  }>;
656
656
  };
657
657
  /**
658
- * A layer a map draws, from a Set or Tree of OCHRE items or from a geospatial
659
- * web service linked as a webpage Resource
660
- */
658
+ A layer a map draws, from a Set or Tree of OCHRE items or from a geospatial
659
+ web service linked as a webpage Resource
660
+ */
661
661
  export type MapLayer<T extends LanguageCodes = LanguageCodes> = {
662
662
  type: "ochre-set" | "ochre-tree";
663
663
  uuid: string;
@@ -676,8 +676,8 @@ export type MapLayer<T extends LanguageCodes = LanguageCodes> = {
676
676
  portalUrl: string;
677
677
  };
678
678
  /**
679
- * Person in OCHRE
680
- */
679
+ Person in OCHRE
680
+ */
681
681
  export type Person<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"person", T, U> & {
682
682
  type: string;
683
683
  image: Image<T> | null;
@@ -697,8 +697,8 @@ export type Person<T extends LanguageCodes = LanguageCodes, U extends ItemPayloa
697
697
  bibliographies: Array<Bibliography<T, "embedded">>;
698
698
  }>;
699
699
  /**
700
- * Period in OCHRE
701
- */
700
+ Period in OCHRE
701
+ */
702
702
  export type Period<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"period", T, U> & {
703
703
  type: string | null;
704
704
  coordinates: Array<Coordinates<T>>;
@@ -710,8 +710,8 @@ export type Period<T extends LanguageCodes = LanguageCodes, U extends ItemPayloa
710
710
  items: RecursiveItemChildren<U, Period<T, RecursiveChildPayloadKind<U>>>;
711
711
  }>;
712
712
  /**
713
- * Bibliography in OCHRE
714
- */
713
+ Bibliography in OCHRE
714
+ */
715
715
  export type Bibliography<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"bibliography", T, U> & {
716
716
  citationDetails: string | null;
717
717
  citationFormat: MultilingualString<T> | null;
@@ -742,8 +742,8 @@ export type Bibliography<T extends LanguageCodes = LanguageCodes, U extends Item
742
742
  type: string | null;
743
743
  })>;
744
744
  /**
745
- * Concept in OCHRE
746
- */
745
+ Concept in OCHRE
746
+ */
747
747
  export type Concept<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"concept", T, U> & {
748
748
  image: Image<T> | null;
749
749
  interpretations: Array<Interpretation<T>>;
@@ -751,8 +751,8 @@ export type Concept<T extends LanguageCodes = LanguageCodes, U extends ItemPaylo
751
751
  items: RecursiveItemChildren<U, Concept<T, RecursiveChildPayloadKind<U>>>;
752
752
  }>;
753
753
  /**
754
- * Interpretation in OCHRE
755
- */
754
+ Interpretation in OCHRE
755
+ */
756
756
  export type Interpretation<T extends LanguageCodes = LanguageCodes> = {
757
757
  number: number;
758
758
  date: Date | null;
@@ -765,8 +765,8 @@ export type Interpretation<T extends LanguageCodes = LanguageCodes> = {
765
765
  bibliographies: Array<Bibliography<T, "embedded">>;
766
766
  };
767
767
  /**
768
- * Spatial unit in OCHRE
769
- */
768
+ Spatial unit in OCHRE
769
+ */
770
770
  export type SpatialUnit<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"spatialUnit", T, U> & {
771
771
  image: Image<T> | null;
772
772
  coordinates: Array<Coordinates<T>>;
@@ -781,8 +781,8 @@ export type SpatialUnit<T extends LanguageCodes = LanguageCodes, U extends ItemP
781
781
  items: RecursiveItemChildren<U, SpatialUnit<T, RecursiveChildPayloadKind<U>>>;
782
782
  }>;
783
783
  /**
784
- * Observation in OCHRE
785
- */
784
+ Observation in OCHRE
785
+ */
786
786
  export type Observation<T extends LanguageCodes = LanguageCodes> = {
787
787
  number: number;
788
788
  date: Date | null;
@@ -796,8 +796,8 @@ export type Observation<T extends LanguageCodes = LanguageCodes> = {
796
796
  bibliographies: Array<Bibliography<T, "embedded">>;
797
797
  };
798
798
  /**
799
- * Property variable in OCHRE
800
- */
799
+ Property variable in OCHRE
800
+ */
801
801
  export type PropertyVariable<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"propertyVariable", T, U> & {
802
802
  type: string | null;
803
803
  coordinates: Array<Coordinates<T>>;
@@ -807,8 +807,8 @@ export type PropertyVariable<T extends LanguageCodes = LanguageCodes, U extends
807
807
  bibliographies: Array<Bibliography<T, "embedded">>;
808
808
  }>;
809
809
  /**
810
- * Property value in OCHRE
811
- */
810
+ Property value in OCHRE
811
+ */
812
812
  export type PropertyValue<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"propertyValue", T, U> & {
813
813
  coordinates: Array<Coordinates<T>>;
814
814
  links: ItemLinks<T>;
@@ -818,8 +818,8 @@ export type PropertyValue<T extends LanguageCodes = LanguageCodes, U extends Ite
818
818
  bibliographies: Array<Bibliography<T, "embedded">>;
819
819
  }>;
820
820
  /**
821
- * Resource in OCHRE
822
- */
821
+ Resource in OCHRE
822
+ */
823
823
  export type Resource<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"resource", T, U> & {
824
824
  language: string | null;
825
825
  type: string;
@@ -845,8 +845,8 @@ export type Resource<T extends LanguageCodes = LanguageCodes, U extends ItemPayl
845
845
  view: Webpage<T> | null;
846
846
  } : unknown)>;
847
847
  /**
848
- * Text in OCHRE
849
- */
848
+ Text in OCHRE
849
+ */
850
850
  export type Text<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"text", T, U> & {
851
851
  type: string;
852
852
  text: string | null;
@@ -862,8 +862,8 @@ export type Text<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadK
862
862
  editions: Array<Person<T, "embedded">>;
863
863
  }>;
864
864
  /**
865
- * Section in OCHRE
866
- */
865
+ Section in OCHRE
866
+ */
867
867
  export type Section<T extends LanguageCodes = LanguageCodes> = {
868
868
  uuid: string;
869
869
  publicationDateTime: Date | null;
@@ -873,8 +873,8 @@ export type Section<T extends LanguageCodes = LanguageCodes> = {
873
873
  } | null;
874
874
  };
875
875
  /**
876
- * Represents a gallery with its identification, project identification, resources and max length
877
- */
876
+ Represents a gallery with its identification, project identification, resources and max length
877
+ */
878
878
  export type Gallery<T extends LanguageCodes = LanguageCodes> = {
879
879
  identification: Identification<T>;
880
880
  projectIdentification: Identification<T>;
@@ -882,8 +882,8 @@ export type Gallery<T extends LanguageCodes = LanguageCodes> = {
882
882
  maxLength: number;
883
883
  };
884
884
  /**
885
- * Represents a property query item with its UUID, raw value, count, and content
886
- */
885
+ Represents a property query item with its UUID, raw value, count, and content
886
+ */
887
887
  export type PropertyValueQueryItem = {
888
888
  uuid: string | null;
889
889
  count: number;
@@ -892,23 +892,23 @@ export type PropertyValueQueryItem = {
892
892
  label: MultilingualString | null;
893
893
  };
894
894
  /**
895
- * Represents a grouped Set attribute value query item
896
- *
897
- * `content` is the label in the requested language, which facet queries match
898
- * on; `label` carries the label in every language for display.
899
- */
895
+ Represents a grouped Set attribute value query item
896
+
897
+ `content` is the label in the requested language, which facet queries match
898
+ on; `label` carries the label in every language for display.
899
+ */
900
900
  export type SetAttributeValueQueryItem = {
901
901
  count: number;
902
902
  content: string;
903
903
  label: MultilingualString | null;
904
904
  };
905
905
  /**
906
- * Represents sorting direction for Set items
907
- */
906
+ Represents sorting direction for Set items
907
+ */
908
908
  export type SetItemsSortDirection = "asc" | "desc";
909
909
  /**
910
- * Represents sorting options for Set items
911
- */
910
+ Represents sorting options for Set items
911
+ */
912
912
  export type SetItemsSort = {
913
913
  target: "none";
914
914
  } | {
@@ -917,10 +917,10 @@ export type SetItemsSort = {
917
917
  language?: string;
918
918
  } |
919
919
  /**
920
- * Sort on the item's own date, falling back to its first interpretation's
921
- * date. A Concept carries no date of its own and dates its interpretations
922
- * instead, so the two together are the one date an item has.
923
- */
920
+ Sort on the item's own date, falling back to its first interpretation's
921
+ date. A Concept carries no date of its own and dates its interpretations
922
+ instead, so the two together are the one date an item has.
923
+ */
924
924
  {
925
925
  target: "date";
926
926
  direction?: SetItemsSortDirection;
@@ -932,9 +932,9 @@ export type SetItemsSort = {
932
932
  language?: string;
933
933
  } |
934
934
  /**
935
- * Sort on the distance from a point, using an item's first point or, failing
936
- * that, the center of its first plane. Items without coordinates sort last.
937
- */
935
+ Sort on the distance from a point, using an item's first point or, failing
936
+ that, the center of its first plane. Items without coordinates sort last.
937
+ */
938
938
  {
939
939
  target: "distance";
940
940
  latitude: number;
@@ -942,25 +942,25 @@ export type SetItemsSort = {
942
942
  direction?: SetItemsSortDirection;
943
943
  };
944
944
  /**
945
- * Represents a leaf query for Set items
946
- *
947
- * The `ocr` target matches the OCR text layer of Resource items. Set item
948
- * projections do not carry `<ocr>`, so it is resolved by a document join rather
949
- * than by a CTS term, and it composes with `and`, `or`, and `isNegated` at the
950
- * cost of one extra search per distinct OCR value. Each `<string>` in that
951
- * layer holds a single OCR word, so `includes` matches every search term as its
952
- * own word and `exact` matches the terms as an adjacent run of whole words. OCR
953
- * text carries no language, so `ocr` leaves take no `language`.
954
- *
955
- * An `IDREF` property leaf matches by identity under `exact`, where `value` is
956
- * the UUID of the linked item, and by the linked item's displayed name under
957
- * `includes`, which OCHRE copies into the value's `content`. The `all` data
958
- * type searches the text of every value, linked names included.
959
- *
960
- * `fallbackLanguage` searches a field in that language only when the field has
961
- * no content in `language`, so a match follows the text a reader of `language`
962
- * is shown. Leave it unset to search `language` alone.
963
- */
945
+ Represents a leaf query for Set items
946
+
947
+ The `ocr` target matches the OCR text layer of Resource items. Set item
948
+ projections do not carry `<ocr>`, so it is resolved by a document join rather
949
+ than by a CTS term, and it composes with `and`, `or`, and `isNegated` at the
950
+ cost of one extra search per distinct OCR value. Each `<string>` in that
951
+ layer holds a single OCR word, so `includes` matches every search term as its
952
+ own word and `exact` matches the terms as an adjacent run of whole words. OCR
953
+ text carries no language, so `ocr` leaves take no `language`.
954
+
955
+ An `IDREF` property leaf matches by identity under `exact`, where `value` is
956
+ the UUID of the linked item, and by the linked item's displayed name under
957
+ `includes`, which OCHRE copies into the value's `content`. The `all` data
958
+ type searches the text of every value, linked names included.
959
+
960
+ `fallbackLanguage` searches a field in that language only when the field has
961
+ no content in `language`, so a match follows the text a reader of `language`
962
+ is shown. Leave it unset to search `language` alone.
963
+ */
964
964
  export type QueryLeaf = {
965
965
  target: "property";
966
966
  propertyVariable?: string;
@@ -1048,16 +1048,16 @@ export type QueryLeaf = {
1048
1048
  isNegated?: boolean;
1049
1049
  };
1050
1050
  /**
1051
- * Represents a boolean query group for Set items
1052
- */
1051
+ Represents a boolean query group for Set items
1052
+ */
1053
1053
  export type QueryGroup = {
1054
1054
  and: Array<Query>;
1055
1055
  } | {
1056
1056
  or: Array<Query>;
1057
1057
  };
1058
1058
  /**
1059
- * Represents a query for Set items
1060
- */
1059
+ Represents a query for Set items
1060
+ */
1061
1061
  export type Query = QueryLeaf | QueryGroup;
1062
1062
  export type AnyBibliography<T extends LanguageCodes = LanguageCodes> = Bibliography<T, ItemPayloadKind>;
1063
1063
  export type AnyConcept<T extends LanguageCodes = LanguageCodes> = Concept<T, ItemPayloadKind>;
@@ -1085,8 +1085,8 @@ export type EmbeddedText<T extends LanguageCodes = LanguageCodes> = Text<T, "emb
1085
1085
  export type EmbeddedTree<U extends TreeItemCategory = TreeItemCategory, T extends LanguageCodes = LanguageCodes> = Tree<U, T, "embedded">;
1086
1086
  export type ItemProperty<T extends LanguageCodes = LanguageCodes> = Property<T> | SetItemProperty<T>;
1087
1087
  /**
1088
- * The category of items that expose recursive subitem structures.
1089
- */
1088
+ The category of items that expose recursive subitem structures.
1089
+ */
1090
1090
  export type RecursiveItemCategory = Exclude<ItemCategory, "tree" | "person" | "propertyVariable" | "propertyValue" | "set">;
1091
1091
  export type TopLevelItem<U extends ItemCategory = ItemCategory, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes> = Item<U, V, T, "topLevel">;
1092
1092
  export {};