ochre-sdk 1.0.12 → 1.0.14

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 (52) hide show
  1. package/README.md +3 -1
  2. package/dist/constants.d.mts +17 -0
  3. package/dist/constants.mjs +85 -0
  4. package/dist/fetchers/gallery.d.mts +38 -0
  5. package/dist/fetchers/gallery.mjs +91 -0
  6. package/dist/fetchers/item-links.d.mts +32 -0
  7. package/dist/fetchers/item-links.mjs +120 -0
  8. package/dist/fetchers/item.d.mts +74 -0
  9. package/dist/fetchers/item.mjs +146 -0
  10. package/dist/fetchers/set/items.d.mts +48 -0
  11. package/dist/fetchers/set/items.mjs +268 -0
  12. package/dist/fetchers/set/property-values.d.mts +46 -0
  13. package/dist/fetchers/set/property-values.mjs +514 -0
  14. package/dist/fetchers/website.d.mts +25 -0
  15. package/dist/fetchers/website.mjs +38 -0
  16. package/dist/getters.d.mts +193 -0
  17. package/dist/getters.mjs +341 -0
  18. package/dist/helpers.d.mts +18 -0
  19. package/dist/helpers.mjs +33 -0
  20. package/dist/index.d.mts +12 -1966
  21. package/dist/index.mjs +9 -7201
  22. package/dist/parsers/helpers.d.mts +27 -0
  23. package/dist/parsers/helpers.mjs +53 -0
  24. package/dist/parsers/index.d.mts +65 -0
  25. package/dist/parsers/index.mjs +1338 -0
  26. package/dist/parsers/mdx.d.mts +4 -0
  27. package/dist/parsers/mdx.mjs +9 -0
  28. package/dist/parsers/multilingual.d.mts +189 -0
  29. package/dist/parsers/multilingual.mjs +410 -0
  30. package/dist/parsers/string.d.mts +29 -0
  31. package/dist/parsers/string.mjs +477 -0
  32. package/dist/parsers/website/index.d.mts +20 -0
  33. package/dist/parsers/website/index.mjs +1245 -0
  34. package/dist/parsers/website/reader.d.mts +29 -0
  35. package/dist/parsers/website/reader.mjs +75 -0
  36. package/dist/query.d.mts +13 -0
  37. package/dist/query.mjs +827 -0
  38. package/dist/schemas.d.mts +84 -0
  39. package/dist/schemas.mjs +232 -0
  40. package/dist/types/index.d.mts +840 -0
  41. package/dist/types/index.mjs +1 -0
  42. package/dist/types/website.d.mts +501 -0
  43. package/dist/types/website.mjs +1 -0
  44. package/dist/utils.d.mts +34 -0
  45. package/dist/utils.mjs +172 -0
  46. package/dist/xml/metadata.d.mts +5 -0
  47. package/dist/xml/metadata.mjs +30 -0
  48. package/dist/xml/schemas.d.mts +13 -0
  49. package/dist/xml/schemas.mjs +849 -0
  50. package/dist/xml/types.d.mts +901 -0
  51. package/dist/xml/types.mjs +1 -0
  52. package/package.json +19 -17
package/dist/index.d.mts CHANGED
@@ -1,1966 +1,12 @@
1
- //#region src/parsers/multilingual.d.ts
2
- /**
3
- * One text entry for a language. When OCHRE exposes multiple entries for the
4
- * same language, the first one is primary.
5
- */
6
- type MultilingualStringEntry = {
7
- text: string;
8
- richText: string;
9
- isPrimary: boolean;
10
- };
11
- type MultilingualStringText = {
12
- text: string;
13
- richText: string;
14
- };
15
- type MultilingualStringInput = string | {
16
- text: string;
17
- richText?: string;
18
- };
19
- type MultilingualStringJSON<T extends ReadonlyArray<string> = ReadonlyArray<string>> = {
20
- content: Partial<Record<T[number], Array<MultilingualStringEntry>>>;
21
- aliases: Array<string>;
22
- };
23
- type MultilingualStringObject<T extends ReadonlyArray<string> = ReadonlyArray<string>> = Partial<Record<T[number], MultilingualStringInput>>;
24
- type MultilingualStringEntries<T extends ReadonlyArray<string> = ReadonlyArray<string>> = Partial<Record<T[number], ReadonlyArray<MultilingualStringInput>>>;
25
- /**
26
- * Options for creating and working with multilingual strings
27
- */
28
- type MultilingualOptions = {
29
- /** Default language to use for fallbacks */defaultLanguage?: string; /** Available languages for this string */
30
- availableLanguages?: ReadonlyArray<string>; /** Alias values carried by OCHRE as zxx content */
31
- aliases?: ReadonlyArray<string>;
32
- };
33
- type MultilingualContent<T extends ReadonlyArray<string>> = Partial<Record<T[number], ReadonlyArray<MultilingualStringEntry>>>;
34
- declare const MULTILINGUAL_STRING_INTERNAL_INIT: unique symbol;
35
- type MultilingualStringInternalInit<T extends ReadonlyArray<string>> = {
36
- readonly [MULTILINGUAL_STRING_INTERNAL_INIT]: true;
37
- content: MultilingualContent<T>;
38
- options: Required<MultilingualOptions>;
39
- availableLanguages: ReadonlyArray<T[number]>;
40
- };
41
- /**
42
- * Multilingual string
43
- */
44
- declare class MultilingualString<T extends ReadonlyArray<string> = ReadonlyArray<string>> {
45
- private readonly _content;
46
- private readonly _options;
47
- private readonly _availableLanguages;
48
- private readonly _aliases;
49
- /**
50
- * Create a new multilingual string from an object of language codes to text.
51
- */
52
- /** @internal */
53
- constructor(init: MultilingualStringInternalInit<T>);
54
- constructor(content: MultilingualStringObject<T>, languages: T, options?: MultilingualOptions);
55
- constructor(content?: Partial<Record<string, MultilingualStringInput>>, languages?: undefined, options?: MultilingualOptions);
56
- private static fromNormalized;
57
- /**
58
- * Create a new multilingual string from an object of language codes to text
59
- */
60
- static fromObject<U extends ReadonlyArray<string>>(content: MultilingualStringObject<U>, languages: U, options?: MultilingualOptions): MultilingualString<U>;
61
- static fromObject(content: Partial<Record<string, MultilingualStringInput>>, languages?: undefined, options?: MultilingualOptions): MultilingualString<ReadonlyArray<string>>;
62
- /**
63
- * Create a new multilingual string from language entries.
64
- */
65
- static fromEntries<U extends ReadonlyArray<string>>(content: MultilingualStringEntries<U>, languages: U, options?: MultilingualOptions): MultilingualString<U>;
66
- static fromEntries(content: Partial<Record<string, ReadonlyArray<MultilingualStringInput>>>, languages?: undefined, options?: MultilingualOptions): MultilingualString<ReadonlyArray<string>>;
67
- /**
68
- * Create a new multilingual string for a single language
69
- */
70
- static create<U extends ReadonlyArray<string>>(language: U[number], text: MultilingualStringInput, languages: U, options?: MultilingualOptions): MultilingualString<U>;
71
- static create(language: string, text: MultilingualStringInput, languages?: undefined, options?: MultilingualOptions): MultilingualString<ReadonlyArray<string>>;
72
- /**
73
- * Create an empty multilingual string
74
- */
75
- static empty<U extends ReadonlyArray<string>>(languages: U, options?: MultilingualOptions): MultilingualString<U>;
76
- static empty(languages?: undefined, options?: MultilingualOptions): MultilingualString<ReadonlyArray<string>>;
77
- /**
78
- * Recreate a multilingual string from its JSON representation.
79
- */
80
- static fromJSON<U extends ReadonlyArray<string>>(json: MultilingualStringJSON<U>, languages: U, options?: Omit<MultilingualOptions, "aliases">): MultilingualString<U>;
81
- static fromJSON(json: MultilingualStringJSON, languages?: undefined, options?: Omit<MultilingualOptions, "aliases">): MultilingualString<ReadonlyArray<string>>;
82
- private getPrimaryEntry;
83
- /**
84
- * Get text in a specific language with automatic fallback
85
- */
86
- getText(language?: T[number]): string;
87
- /**
88
- * Get rich text in a specific language with automatic fallback
89
- */
90
- getRichText(language?: T[number]): string;
91
- /**
92
- * Get primary text in a specific language without fallback
93
- */
94
- getExactText(language: T[number]): string | null;
95
- /**
96
- * Get primary rich text in a specific language without fallback
97
- */
98
- getExactRichText(language: T[number]): string | null;
99
- /**
100
- * Get all text entries in a specific language without fallback
101
- */
102
- getExactTexts(language: T[number]): Array<string>;
103
- /**
104
- * Get all rich text entries in a specific language without fallback
105
- */
106
- getExactRichTexts(language: T[number]): Array<string>;
107
- /**
108
- * Get all text entries in a specific language with fallback
109
- */
110
- getTexts(language?: T[number]): Array<string>;
111
- /**
112
- * Get all rich text entries in a specific language with fallback
113
- */
114
- getRichTexts(language?: T[number]): Array<string>;
115
- /**
116
- * Get all entries in a specific language without fallback
117
- */
118
- getExactEntries(language: T[number]): Array<MultilingualStringEntry>;
119
- /**
120
- * Get all entries in a specific language with fallback
121
- */
122
- getEntries(language?: T[number]): Array<MultilingualStringEntry>;
123
- /**
124
- * Get aliases carried by OCHRE as zxx content
125
- */
126
- getAliases(): Array<string>;
127
- /**
128
- * Check if text exists for a specific language
129
- */
130
- hasLanguage(language: T[number]): boolean;
131
- /**
132
- * Check if aliases exist
133
- */
134
- hasAliases(): boolean;
135
- /**
136
- * Get all available languages
137
- */
138
- getAvailableLanguages(): ReadonlyArray<T[number]>;
139
- /**
140
- * Get all supported languages (the full language array passed to constructor)
141
- */
142
- getSupportedLanguages(): T;
143
- /**
144
- * Check if the multilingual string is empty (no content in any language)
145
- */
146
- isEmpty(): boolean;
147
- /**
148
- * Check if the multilingual string has any content
149
- */
150
- hasContent(): boolean;
151
- /**
152
- * Get the default language
153
- */
154
- getDefaultLanguage(): T[number];
155
- /**
156
- * Add or update the primary text for a language (returns new instance)
157
- */
158
- withText(language: T[number], text: MultilingualStringInput): MultilingualString<T>;
159
- /**
160
- * Add another text entry for a language (returns new instance)
161
- */
162
- withEntry(language: T[number], text: MultilingualStringInput): MultilingualString<T>;
163
- /**
164
- * Replace aliases (returns new instance)
165
- */
166
- withAliases(aliases: ReadonlyArray<string>): MultilingualString<T>;
167
- /**
168
- * Remove text for a language (returns new instance)
169
- */
170
- withoutLanguage(language: T[number]): MultilingualString<T>;
171
- /**
172
- * Transform all language versions (returns new instance)
173
- */
174
- map(fn: (text: string, language: T[number]) => string): MultilingualString<T>;
175
- /**
176
- * Filter languages based on predicate (returns new instance)
177
- */
178
- filter(predicate: (text: string, language: T[number]) => boolean): MultilingualString<T>;
179
- /**
180
- * Get the string representation (uses default language)
181
- */
182
- toString(): string;
183
- /**
184
- * Get JSON representation
185
- */
186
- toJSON(): MultilingualStringJSON<T>;
187
- }
188
- //#endregion
189
- //#region src/types/website.d.ts
190
- type WebsitePropertyValueDataType = QueryablePropertyValueDataType;
191
- /**
192
- * Represents a context tree level item with a variable and value
193
- */
194
- type ContextTreeLevelItem = {
195
- variableUuid: string;
196
- valueUuid: string | null;
197
- };
198
- /**
199
- * Represents a context tree level with a context item
200
- */
201
- type ContextTreeLevel<T extends LanguageCodes = LanguageCodes> = {
202
- context: Array<ContextTreeLevelItem>;
203
- identification: Identification<T>;
204
- type: string;
205
- };
206
- /**
207
- * Represents a filter context tree level with a context item
208
- */
209
- type ContextTreeFilterLevel<T extends LanguageCodes = LanguageCodes> = {
210
- context: Array<ContextTreeLevelItem>;
211
- identification: Identification<T>;
212
- type: string;
213
- filterType: "property" | "coordinates" | "bibliography" | "period";
214
- isInlineDisplayed: boolean;
215
- isSidebarDisplayed: boolean;
216
- isSidebarOpen: boolean;
217
- };
218
- /**
219
- * Represents a context tree with levels grouped by behavior
220
- */
221
- type ContextTree<T extends LanguageCodes = LanguageCodes> = {
222
- flatten: Array<ContextTreeLevel<T>>;
223
- suppress: Array<ContextTreeLevel<T>>;
224
- filter: Array<ContextTreeFilterLevel<T>>;
225
- sort: Array<ContextTreeLevel<T>>;
226
- detail: Array<ContextTreeLevel<T>>;
227
- download: Array<ContextTreeLevel<T>>;
228
- label: Array<ContextTreeLevel<T>>;
229
- prominent: Array<ContextTreeLevel<T>>;
230
- };
231
- /**
232
- * Represents a scope with its UUID, type and identification
233
- */
234
- type Scope<T extends LanguageCodes = LanguageCodes> = {
235
- uuid: string;
236
- type: string;
237
- identification: Identification<T>;
238
- };
239
- /**
240
- * Represents a stylesheet item with its UUID and category
241
- */
242
- type StylesheetCategory = Extract<ItemCategory, "propertyVariable" | "propertyValue">;
243
- type StylesheetItem = {
244
- uuid: string;
245
- category: "propertyVariable";
246
- icon: string | null;
247
- styles: {
248
- default: Array<Style>;
249
- tablet: Array<Style>;
250
- mobile: Array<Style>;
251
- };
252
- } | {
253
- uuid: string;
254
- category: "propertyValue";
255
- variableUuid: string;
256
- icon: string | null;
257
- styles: {
258
- default: Array<Style>;
259
- tablet: Array<Style>;
260
- mobile: Array<Style>;
261
- };
262
- };
263
- type WebsitePropertyQueryNode<T extends LanguageCodes = LanguageCodes> = {
264
- target: "property";
265
- propertyVariable: string;
266
- dataType: WebsitePropertyValueDataType;
267
- matchMode: "includes" | "exact";
268
- isCaseSensitive: boolean;
269
- language: T[number];
270
- };
271
- type WebsitePropertyQuery<T extends LanguageCodes = LanguageCodes> = WebsitePropertyQueryNode<T> | {
272
- and: Array<WebsitePropertyQuery<T>>;
273
- } | {
274
- or: Array<WebsitePropertyQuery<T>>;
275
- };
276
- /**
277
- * Represents the OCHRE website type
278
- */
279
- type WebsiteType = "traditional" | "digital-collection" | "plum" | "cedar" | "elm" | "maple" | "oak" | "palm";
280
- /**
281
- * Represents a website with its properties and elements
282
- */
283
- type Website<T extends LanguageCodes = LanguageCodes> = {
284
- uuid: string;
285
- type: "website" | "segment";
286
- belongsTo: {
287
- uuid: string;
288
- abbreviation: string;
289
- } | null;
290
- metadata: Metadata<T>;
291
- publicationDateTime: Date | null;
292
- identification: Identification<T>;
293
- creators: Array<Person<T, "embedded">>;
294
- license: License | null;
295
- items: Array<Webpage<T>>;
296
- properties: {
297
- type: WebsiteType;
298
- status: "development" | "preview" | "production";
299
- versionLabel: "experimental" | "alpha" | "beta" | "test" | "staging" | "pre-release" | "release";
300
- privacy: "public" | "password" | "private";
301
- contact: {
302
- name: string;
303
- email: string | null;
304
- } | null;
305
- loadingVariant: "spinner" | "skeleton" | "animation" | "none";
306
- theme: {
307
- isThemeToggleDisplayed: boolean;
308
- defaultTheme: "light" | "dark" | "system";
309
- };
310
- icon: {
311
- logoUuid: string | null;
312
- faviconUuid: string | null;
313
- appleTouchIconUuid: string | null;
314
- };
315
- navbar: {
316
- isDisplayed: boolean;
317
- variant: "default" | "floating" | "inline";
318
- alignment: "start" | "center" | "end";
319
- isProjectDisplayed: boolean;
320
- searchBarBoundElementUuid: string | null;
321
- items: Array<WebElement<T> | WebBlock<T>> | null;
322
- };
323
- footer: {
324
- isDisplayed: boolean;
325
- logoUuid: string | null;
326
- items: Array<WebElement<T> | WebBlock<T>> | null;
327
- };
328
- sidebar: {
329
- isDisplayed: boolean;
330
- items: Array<WebElement<T> | WebBlock<T>>;
331
- title: WebTitle<T>;
332
- layout: "start" | "end";
333
- mobileLayout: "default" | "inline";
334
- cssStyles: {
335
- default: Array<Style>;
336
- tablet: Array<Style>;
337
- mobile: Array<Style>;
338
- };
339
- } | null;
340
- itemPage: {
341
- isMainContentDisplayed: boolean;
342
- isDescriptionDisplayed: boolean;
343
- isDocumentDisplayed: boolean;
344
- isNotesDisplayed: boolean;
345
- isEventsDisplayed: boolean;
346
- isPeriodsDisplayed: boolean;
347
- isPropertiesDisplayed: boolean;
348
- isBibliographyDisplayed: boolean;
349
- isPropertyValuesGrouped: boolean;
350
- isPublicationDateTimeDisplayed: boolean;
351
- isPersistentIdentifierDisplayed: boolean;
352
- iiifViewer: "universal-viewer" | "clover";
353
- };
354
- options: {
355
- contextTree: ContextTree<T> | null;
356
- scopes: Array<Scope<T>> | null;
357
- labels: {
358
- title: MultilingualString<T> | null;
359
- };
360
- stylesheets: {
361
- properties: Array<StylesheetItem>;
362
- };
363
- };
364
- };
365
- };
366
- type WebsiteSegment<T extends LanguageCodes = LanguageCodes> = Website<T> & {
367
- type: "segment";
368
- };
369
- /**
370
- * Represents a webpage with its title, slug, properties, items and subpages
371
- */
372
- type Webpage<T extends LanguageCodes = LanguageCodes> = {
373
- uuid: string;
374
- type: "page";
375
- title: MultilingualString<T>;
376
- slug: string;
377
- publicationDateTime: Date | null;
378
- items: Array<WebElement<T> | WebBlock<T>>;
379
- segments: Array<WebsiteSegment<T>>;
380
- properties: {
381
- width: "full" | "large" | "narrow" | "default";
382
- variant: "default" | "no-background";
383
- isBreadcrumbsDisplayed: boolean;
384
- isSidebarDisplayed: boolean;
385
- isDisplayedInNavbar: boolean;
386
- isNavbarSearchBarDisplayed: boolean;
387
- backgroundImage: WebImage<T> | null;
388
- cssStyles: {
389
- default: Array<Style>;
390
- tablet: Array<Style>;
391
- mobile: Array<Style>;
392
- };
393
- };
394
- webpages: Array<Webpage<T>>;
395
- };
396
- /**
397
- * Represents a title with its label and variant
398
- */
399
- type WebTitle<T extends LanguageCodes = LanguageCodes> = {
400
- label: MultilingualString<T>;
401
- variant: "default" | "simple";
402
- properties: {
403
- isNameDisplayed: boolean;
404
- isDescriptionDisplayed: boolean;
405
- isDateDisplayed: boolean;
406
- isCreatorsDisplayed: boolean;
407
- isCountDisplayed: boolean;
408
- };
409
- };
410
- /**
411
- * Base properties for web elements
412
- */
413
- type WebElement<T extends LanguageCodes = LanguageCodes> = {
414
- uuid: string;
415
- type: "element";
416
- title: WebTitle<T>;
417
- cssStyles: {
418
- default: Array<Style>;
419
- tablet: Array<Style>;
420
- mobile: Array<Style>;
421
- };
422
- } & WebElementComponent<T>;
423
- /**
424
- * Union type of all possible web element components
425
- */
426
- type WebElementComponent<T extends LanguageCodes = LanguageCodes> = {
427
- component: "3d-viewer";
428
- linkUuid: string;
429
- fileSize: number | null;
430
- isInteractive: boolean;
431
- isControlsDisplayed: boolean;
432
- } | {
433
- component: "advanced-search";
434
- boundElementUuid: string | null;
435
- href: string | null;
436
- } | {
437
- component: "annotated-document";
438
- linkUuid: string;
439
- } | {
440
- component: "annotated-image";
441
- linkUuid: string;
442
- isFilterInputDisplayed: boolean;
443
- isOptionsDisplayed: boolean;
444
- isAnnotationHighlightsDisplayed: boolean;
445
- isAnnotationTooltipsDisplayed: boolean;
446
- } | {
447
- component: "audio-player";
448
- linkUuid: string;
449
- isSpeedControlsDisplayed: boolean;
450
- isVolumeControlsDisplayed: boolean;
451
- isSeekBarDisplayed: boolean;
452
- } | {
453
- component: "bibliography";
454
- linkUuids: Array<string>;
455
- bibliographies: Array<Bibliography<T, "embedded">>;
456
- layout: "long" | "short";
457
- isSourceDocumentDisplayed: boolean;
458
- } | {
459
- component: "entries";
460
- linkUuid: string;
461
- variant: "entry" | "item";
462
- isFilterInputDisplayed: boolean;
463
- } | {
464
- component: "button";
465
- variant: "default" | "transparent" | "link";
466
- href: string;
467
- isExternal: boolean;
468
- label: MultilingualString<T> | null;
469
- startIcon: string | null;
470
- endIcon: string | null;
471
- image: WebImage<T> | null;
472
- } | {
473
- component: "collection";
474
- linkUuids: Array<string>;
475
- displayedProperties: Array<{
476
- uuid: string;
477
- label: MultilingualString<T> | null;
478
- }> | null;
479
- variant: "slide" | "table" | "card" | "tile" | "showcase";
480
- paginationVariant: "default" | "numeric";
481
- loadingVariant: "spinner" | "skeleton" | "animation" | "none";
482
- imageLayout: "top" | "bottom" | "start" | "end" | null;
483
- expectedItemCount: number | null;
484
- isSortDisplayed: boolean;
485
- isUsingQueryParams: boolean;
486
- filter: {
487
- isSidebarDisplayed: boolean;
488
- isResultsBarDisplayed: boolean;
489
- isInputDisplayed: boolean;
490
- isLimitedToInputFilter: boolean;
491
- isLimitedToLeafPropertyValues: boolean;
492
- sidebarSort: "default" | "alphabetical";
493
- };
494
- options: {
495
- scopes: Array<Scope<T>> | null;
496
- contextTree: ContextTree<T> | null;
497
- labels: {
498
- title: MultilingualString<T> | null;
499
- };
500
- };
501
- } | {
502
- component: "empty-space";
503
- height: string | null;
504
- width: string | null;
505
- } | {
506
- component: "iframe";
507
- href: string;
508
- height: string | null;
509
- width: string | null;
510
- } | {
511
- component: "iiif-viewer";
512
- linkUuid: string;
513
- variant: "universal-viewer" | "clover";
514
- } | {
515
- component: "image";
516
- images: Array<WebImage<T>>;
517
- variant: "default" | "carousel" | "grid" | "hero";
518
- width: number | null;
519
- height: number | null;
520
- isFullWidth: boolean;
521
- isFullHeight: boolean;
522
- imageQuality: "high" | "low";
523
- captionSource: "name" | "abbreviation" | "description";
524
- captionLayout: "top" | "bottom" | "inset" | "suppress";
525
- altTextSource: "name" | "abbreviation" | "description";
526
- isTransparentBackground: boolean;
527
- isCover: boolean;
528
- carouselOptions: {
529
- secondsPerImage: number;
530
- } | null;
531
- heroOptions: {
532
- isBackgroundImageDisplayed: boolean;
533
- isDocumentDisplayed: boolean;
534
- } | null;
535
- } | {
536
- component: "image-gallery";
537
- linkUuid: string;
538
- isFilterInputDisplayed: boolean;
539
- } | {
540
- component: "map";
541
- linkUuid: string;
542
- customBasemap: string | null;
543
- initialBounds: [[number, number], [number, number]] | null;
544
- maximumBounds: [[number, number], [number, number]] | null;
545
- isControlsDisplayed: boolean;
546
- isInteractive: boolean;
547
- isClustered: boolean;
548
- isUsingPins: boolean;
549
- isFullHeight: boolean;
550
- } | {
551
- component: "query";
552
- linkUuids: Array<string>;
553
- items: Array<{
554
- label: MultilingualString<T>;
555
- queries: Array<WebsitePropertyQuery<T>>;
556
- startIcon: string | null;
557
- endIcon: string | null;
558
- }>;
559
- options: {
560
- scopes: Array<Scope<T>> | null;
561
- contextTree: ContextTree<T> | null;
562
- labels: {
563
- title: MultilingualString<T> | null;
564
- };
565
- };
566
- collectionProperties: {
567
- displayedProperties: Extract<WebElementComponent<T>, {
568
- component: "collection";
569
- }>["displayedProperties"];
570
- variant: Extract<WebElementComponent<T>, {
571
- component: "collection";
572
- }>["variant"];
573
- paginationVariant: Extract<WebElementComponent<T>, {
574
- component: "collection";
575
- }>["paginationVariant"];
576
- loadingVariant: Extract<WebElementComponent<T>, {
577
- component: "collection";
578
- }>["loadingVariant"];
579
- imageLayout: Extract<WebElementComponent<T>, {
580
- component: "collection";
581
- }>["imageLayout"];
582
- };
583
- } | {
584
- component: "search-bar";
585
- queryVariant: "submit" | "change";
586
- placeholder: MultilingualString<T> | null;
587
- baseFilterQueries: string | null;
588
- boundElementUuid: string | null;
589
- href: string | null;
590
- } | {
591
- component: "table";
592
- linkUuid: string;
593
- } | {
594
- component: "text";
595
- variant: {
596
- name: "title" | "block" | "banner";
597
- } | {
598
- name: "paragraph";
599
- size: "xs" | "sm" | "md" | "lg";
600
- } | {
601
- name: "label";
602
- size: "xs" | "sm" | "md" | "lg" | "xl";
603
- } | {
604
- name: "heading";
605
- size: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
606
- } | {
607
- name: "display";
608
- size: "xs" | "sm" | "md" | "lg";
609
- };
610
- headingLevel: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
611
- content: MultilingualString<T>;
612
- } | {
613
- component: "timeline";
614
- linkUuid: string;
615
- } | {
616
- component: "video";
617
- linkUuid: string;
618
- isChaptersDisplayed: boolean;
619
- };
620
- type WebElementComponentName = WebElementComponent["component"];
621
- type WebElementComponentOf<U extends WebElementComponentName, T extends LanguageCodes = LanguageCodes> = Extract<WebElementComponent<T>, {
622
- component: U;
623
- }>;
624
- type WebElementOf<U extends WebElementComponentName, T extends LanguageCodes = LanguageCodes> = Extract<WebElement<T>, {
625
- component: U;
626
- }>;
627
- /**
628
- * Represents an image used in web elements
629
- */
630
- type WebImage<T extends LanguageCodes = LanguageCodes> = {
631
- uuid: string | null;
632
- label: MultilingualString<T> | null;
633
- description: MultilingualString<T> | null;
634
- width: number;
635
- height: number;
636
- quality: "low" | "high";
637
- };
638
- /**
639
- * Represents a CSS style with label and value
640
- */
641
- type Style = {
642
- label: string;
643
- value: string;
644
- };
645
- type WebBlockLayout = "vertical" | "horizontal" | "grid" | "vertical-flex" | "horizontal-flex" | "accordion";
646
- /**
647
- * Represents a block of vertical or horizontal content alignment
648
- */
649
- type WebBlock<T extends LanguageCodes = LanguageCodes, U extends WebBlockLayout = WebBlockLayout> = {
650
- uuid: string;
651
- type: "block";
652
- title: WebTitle<T>;
653
- items: U extends "accordion" ? Array<Extract<WebElement<T>, {
654
- component: "text";
655
- }> & {
656
- items: Array<WebElement<T> | WebBlock<T>>;
657
- }> : Array<WebElement<T> | WebBlock<T>>;
658
- properties: {
659
- default: {
660
- layout: U;
661
- wrap: "nowrap" | "wrap" | "wrap-reverse";
662
- /**
663
- * valid `gridTemplateColumns` or `gridTemplateRows` CSS property value
664
- */
665
- spacing: string | null;
666
- /**
667
- * `gap` CSS property value
668
- */
669
- gap: string | null;
670
- isAccordionEnabled: U extends "accordion" ? boolean : never;
671
- isAccordionExpandedByDefault: U extends "accordion" ? boolean : never;
672
- isAccordionSidebarDisplayed: U extends "accordion" ? boolean : never;
673
- };
674
- tablet: Partial<WebBlock<T>["properties"]["default"]> | null;
675
- mobile: Partial<WebBlock<T>["properties"]["default"]> | null;
676
- };
677
- cssStyles: {
678
- default: Array<Style>;
679
- tablet: Array<Style>;
680
- mobile: Array<Style>;
681
- };
682
- };
683
- type WebBlockByLayout<U extends WebBlockLayout = WebBlockLayout, T extends LanguageCodes = LanguageCodes> = WebBlock<T, U>;
684
- type AccordionWebBlock<T extends LanguageCodes = LanguageCodes> = WebBlock<T, "accordion">;
685
- //#endregion
686
- //#region src/types/index.d.ts
687
- type Prettify<T> = { [K in keyof T]: T[K] } & {};
688
- /**
689
- * Language-code tuple or array used by OCHRE multilingual fields.
690
- *
691
- * Use the default when the consumer does not need to narrow a value to a
692
- * specific language tuple.
693
- */
694
- type LanguageCodes = ReadonlyArray<string>;
695
- /**
696
- * The category of an item in OCHRE
697
- */
698
- type ItemCategory = "tree" | "bibliography" | "concept" | "spatialUnit" | "period" | "person" | "propertyVariable" | "propertyValue" | "resource" | "text" | "set";
699
- /**
700
- * OCHRE item categories that can contain other items in API payloads.
701
- */
702
- type ItemContainerCategory = Extract<ItemCategory, "tree" | "set">;
703
- /**
704
- * The category of items in a Tree
705
- */
706
- type TreeItemCategory = Exclude<ItemCategory, "tree">;
707
- /**
708
- * The category of items in a Set
709
- */
710
- type SetItemCategory = ItemCategory;
711
- type ContainedItemCategory<U extends ItemCategory = ItemCategory> = U extends "tree" ? TreeItemCategory : U extends "set" ? SetItemCategory : never;
712
- type ContainedItemCategoryOption<U extends ItemCategory = ItemCategory> = U extends "tree" ? TreeItemCategory : U extends "set" ? SetItemCategory | ReadonlyArray<SetItemCategory> : never;
713
- 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>;
714
- /**
715
- * The category of items in a heading
716
- */
717
- type HeadingItemCategory = Exclude<ItemCategory, "tree" | "bibliography" | "spatialUnit" | "concept" | "period">;
718
- /**
719
- * The category of items that expose recursive subitem structures.
720
- */
721
- type RecursiveItemCategory = Exclude<ItemCategory, "tree" | "person" | "propertyVariable" | "propertyValue" | "set">;
722
- /**
723
- * The category names that can appear in OCHRE context paths
724
- */
725
- type ContextItemCategory = Exclude<ItemCategory, "tree" | "person" | "set">;
726
- /**
727
- * Basic identification information
728
- */
729
- type Identification<T extends LanguageCodes = LanguageCodes> = {
730
- label: MultilingualString<T>;
731
- abbreviation: MultilingualString<T> | null;
732
- code: string | null;
733
- email: string | null;
734
- website: string | null;
735
- };
736
- /**
737
- * Metadata in OCHRE
738
- */
739
- type Metadata<T extends LanguageCodes = LanguageCodes> = {
740
- dataset: string;
741
- description: string;
742
- publisher: string;
743
- identifier: string;
744
- project: {
745
- uuid: string;
746
- identification: Identification<T>;
747
- website: string | null;
748
- dateFormat: string | null;
749
- page: "item" | "entry" | null;
750
- } | null;
751
- collection: {
752
- uuid: string;
753
- identification: Identification<T>;
754
- page: "item" | "entry";
755
- } | null;
756
- publication: {
757
- uuid: string;
758
- identification: Identification<T>;
759
- page: "item" | "entry";
760
- } | null;
761
- item: {
762
- identification: Identification<T>;
763
- category: string;
764
- type: string;
765
- maxLength: number | null;
766
- } | null;
767
- defaultLanguage: T[number];
768
- languages: T;
769
- };
770
- type BelongsTo = {
771
- uuid: string;
772
- abbreviation: string;
773
- };
774
- type ItemPayloadKind = "topLevel" | "embedded";
775
- type ItemEnvelopeFields<T extends LanguageCodes, U extends ItemPayloadKind> = U extends "topLevel" ? {
776
- belongsTo: BelongsTo;
777
- metadata: Metadata<T>;
778
- persistentUrl: string | null;
779
- } : {
780
- belongsTo: null;
781
- metadata: null;
782
- persistentUrl: null;
783
- };
784
- /**
785
- * License in OCHRE
786
- */
787
- type License = {
788
- content: string;
789
- target: string | null;
790
- };
791
- /**
792
- * Context item in OCHRE
793
- */
794
- type ContextItem = {
795
- uuid: string | null;
796
- publicationDateTime: Date | null;
797
- index: number;
798
- content: string;
799
- };
800
- /**
801
- * Context node in OCHRE
802
- */
803
- type ContextNode<U extends ContextItemCategory = ContextItemCategory> = {
804
- tree: ContextItem;
805
- project: ContextItem;
806
- heading: Array<ContextItem>;
807
- } & Partial<Record<U, Array<ContextItem>>>;
808
- /**
809
- * Context in OCHRE
810
- */
811
- type Context<U extends ContextItemCategory = ContextItemCategory> = {
812
- nodes: Array<ContextNode<U>>;
813
- displayPath: string;
814
- };
815
- /**
816
- * Event in OCHRE
817
- */
818
- type Event<T extends LanguageCodes = LanguageCodes> = {
819
- date: Date | {
820
- start: Date;
821
- end: Date;
822
- } | null;
823
- label: MultilingualString<T>;
824
- comment: MultilingualString<T> | null;
825
- agent: {
826
- uuid: string;
827
- label: MultilingualString<T>;
828
- publicationDateTime: Date | null;
829
- } | null;
830
- location: {
831
- uuid: string;
832
- label: MultilingualString<T>;
833
- publicationDateTime: Date | null;
834
- } | null;
835
- other: {
836
- uuid: string | null;
837
- category: string | null;
838
- label: MultilingualString<T>;
839
- } | null;
840
- };
841
- /**
842
- * Source of coordinates in OCHRE
843
- */
844
- type CoordinatesSource<T extends LanguageCodes = LanguageCodes> = {
845
- context: "self";
846
- uuid: string;
847
- label: MultilingualString<T>;
848
- } | {
849
- context: "related";
850
- uuid: string;
851
- label: MultilingualString<T>;
852
- value: MultilingualString<T>;
853
- } | {
854
- context: "inherited";
855
- item: {
856
- uuid: string | null;
857
- label: MultilingualString<T>;
858
- };
859
- uuid: string;
860
- label: MultilingualString<T>;
861
- };
862
- /**
863
- * Coordinates in OCHRE
864
- */
865
- type Coordinates<T extends LanguageCodes = LanguageCodes> = {
866
- type: "point";
867
- latitude: number;
868
- longitude: number;
869
- altitude: number | null;
870
- source: CoordinatesSource<T> | null;
871
- } | {
872
- type: "plane";
873
- minimum: {
874
- latitude: number;
875
- longitude: number;
876
- };
877
- maximum: {
878
- latitude: number;
879
- longitude: number;
880
- };
881
- source: CoordinatesSource<T> | null;
882
- };
883
- /**
884
- * Image in OCHRE
885
- */
886
- type Image<T extends LanguageCodes = LanguageCodes> = {
887
- publicationDateTime: Date | null;
888
- identification: Identification<T> | null;
889
- href: string | null;
890
- htmlImgSrcPrefix: string | null;
891
- height: number | null;
892
- width: number | null;
893
- fileSize: number | null;
894
- base64: string | null;
895
- };
896
- /**
897
- * Area of an image map in OCHRE
898
- */
899
- type ImageMapArea = {
900
- uuid: string;
901
- publicationDateTime: Date | null;
902
- type: string;
903
- title: string;
904
- slug: string | null;
905
- items: Array<{
906
- shape: "rectangle";
907
- coords: [number, number, number, number];
908
- } | {
909
- shape: "circle";
910
- center: {
911
- x: number;
912
- y: number;
913
- };
914
- radius: number;
915
- } | {
916
- shape: "polygon";
917
- coords: Array<number>;
918
- }>;
919
- };
920
- /**
921
- * Image map in OCHRE
922
- */
923
- type ImageMap = {
924
- areas: Array<ImageMapArea>;
925
- width: number;
926
- height: number;
927
- };
928
- /**
929
- * Note in OCHRE
930
- */
931
- type Note<T extends LanguageCodes = LanguageCodes> = {
932
- number: number;
933
- title: MultilingualString<T> | null;
934
- content: MultilingualString<T>;
935
- authors: Array<Person<T, "embedded">>;
936
- };
937
- /**
938
- * Property value content in OCHRE
939
- */
940
- type PropertyValueContent<T extends LanguageCodes = LanguageCodes> = Prettify<{
941
- hierarchy: {
942
- isLeaf: boolean;
943
- level: number | null;
944
- };
945
- label: MultilingualString<T> | null;
946
- isUncertain: boolean;
947
- category: string | null;
948
- type: string | null;
949
- uuid: string | null;
950
- publicationDateTime: Date | null;
951
- unit: string | null;
952
- href: string | null;
953
- height: number | null;
954
- width: number | null;
955
- fileSize: number | null;
956
- slug: string | null;
957
- } & ({
958
- dataType: "string" | "coordinate" | "IDREF" | "date" | "dateTime";
959
- content: string;
960
- } | {
961
- dataType: "integer" | "decimal" | "time";
962
- content: number;
963
- } | {
964
- dataType: "boolean";
965
- content: boolean;
966
- })>;
967
- /**
968
- * Property in OCHRE
969
- */
970
- type Property<T extends LanguageCodes = LanguageCodes> = {
971
- variable: {
972
- uuid: string;
973
- label: MultilingualString<T>;
974
- publicationDateTime: Date | null;
975
- };
976
- values: Array<PropertyValueContent<T>>;
977
- comment: MultilingualString<T> | null;
978
- properties: Array<Property<T>>;
979
- };
980
- /**
981
- * Simplified property in OCHRE website payloads. Simplified property variables
982
- * expose scalar labels rather than multilingual labels.
983
- */
984
- type SimplifiedProperty<T extends LanguageCodes = LanguageCodes> = {
985
- variable: {
986
- uuid: string;
987
- label: string;
988
- publicationDateTime: Date | null;
989
- };
990
- values: Array<PropertyValueContent<T>>;
991
- comment: MultilingualString<T> | null;
992
- properties: Array<SimplifiedProperty<T>>;
993
- };
994
- /**
995
- * Property in a Set item. OCHRE exposes Set item properties as a flat list.
996
- */
997
- type SetItemProperty<T extends LanguageCodes = LanguageCodes> = Omit<Property<T>, "properties">;
998
- type SetItemSimplifiedProperty<T extends LanguageCodes = LanguageCodes> = Omit<SimplifiedProperty<T>, "properties">;
999
- type PropertyLike<T extends LanguageCodes = LanguageCodes> = Property<T> | SetItemProperty<T> | SimplifiedProperty<T> | SetItemSimplifiedProperty<T>;
1000
- type ItemProperty<T extends LanguageCodes = LanguageCodes> = Property<T> | SetItemProperty<T>;
1001
- type PropertyValueDataType = PropertyValueContent["dataType"];
1002
- type QueryablePropertyValueDataType = Exclude<PropertyValueDataType, "coordinate">;
1003
- type WithSetItemProperties<U extends {
1004
- properties: Array<Property<T>>;
1005
- }, T extends LanguageCodes> = U extends {
1006
- properties: Array<Property<T>>;
1007
- } ? Prettify<Omit<U, "properties"> & {
1008
- properties: Array<SetItemProperty<T>>;
1009
- }> : never;
1010
- /**
1011
- * Base item in OCHRE
1012
- */
1013
- type BaseItem<U extends ItemCategory = ItemCategory, T extends LanguageCodes = LanguageCodes, V extends ItemPayloadKind = "topLevel"> = ItemEnvelopeFields<T, V> & {
1014
- uuid: string;
1015
- category: U;
1016
- publicationDateTime: Date | null;
1017
- context: Context<ContextItemCategory> | null;
1018
- date: Date | null;
1019
- license: License | null;
1020
- copyright: MultilingualString<T> | null;
1021
- watermark: MultilingualString<T> | null;
1022
- identification: Identification<T>;
1023
- creators: Array<Person<T, "embedded">>;
1024
- description: MultilingualString<T> | null;
1025
- events: Array<Event<T>>;
1026
- };
1027
- type ItemLinkCategory = ItemCategory | "dictionaryUnit";
1028
- /**
1029
- * Base item data exposed by OCHRE link and reverse-link payloads.
1030
- */
1031
- type BaseItemLink<U extends ItemLinkCategory = ItemLinkCategory, T extends LanguageCodes = LanguageCodes> = {
1032
- uuid: string;
1033
- category: U;
1034
- publicationDateTime: Date | null;
1035
- context: Context<ContextItemCategory> | null;
1036
- date: Date | null;
1037
- identification: Identification<T>;
1038
- description: MultilingualString<T> | null;
1039
- };
1040
- type BibliographySourceDocument = {
1041
- uuid: string;
1042
- content: string;
1043
- href: string | null;
1044
- publicationDateTime: Date | null;
1045
- };
1046
- type BibliographyEntryInfo = {
1047
- content: string | null;
1048
- startIssue: string;
1049
- startVolume: string;
1050
- startPage: string;
1051
- endPage: string;
1052
- };
1053
- type ItemLinks<T extends LanguageCodes = LanguageCodes> = Array<ItemLink<ItemLinkCategory, T>>;
1054
- type TreeItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"tree", T> & {
1055
- type: string | null;
1056
- containedItemCategory: TreeItemCategory | null;
1057
- }>;
1058
- type SetItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"set", T> & {
1059
- type: string | null;
1060
- containedItemCategories: Array<SetItemCategory> | null;
1061
- }>;
1062
- type BibliographyItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"bibliography", T> & {
1063
- type: string | null;
1064
- zoteroId: string | null;
1065
- citationDetails: string | null;
1066
- citationFormat: MultilingualString<T> | null;
1067
- citationFormatSpan: string | null;
1068
- referenceFormatDiv: string | null;
1069
- image: Image<T> | null;
1070
- sourceDocument: BibliographySourceDocument | null;
1071
- publicationInfo: {
1072
- publishers: Array<ItemLink<"person", T>>;
1073
- startDate: Date | null;
1074
- } | null;
1075
- entryInfo: BibliographyEntryInfo | null;
1076
- source: ItemLink<TreeItemCategory, T> | null;
1077
- authors: Array<ItemLink<"person", T>>;
1078
- periods: Array<ItemLink<"period", T>>;
1079
- properties: Array<Property<T>>;
1080
- }>;
1081
- type ConceptItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"concept", T> & {
1082
- image: Image<T> | null;
1083
- coordinates: Array<Coordinates<T>>;
1084
- }>;
1085
- type SpatialUnitItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"spatialUnit", T> & {
1086
- image: Image<T> | null;
1087
- coordinates: Array<Coordinates<T>>;
1088
- }>;
1089
- type PeriodItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"period", T> & {
1090
- type: string | null;
1091
- coordinates: Array<Coordinates<T>>;
1092
- }>;
1093
- type PersonItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"person", T> & {
1094
- type: string | null;
1095
- coordinates: Array<Coordinates<T>>;
1096
- }>;
1097
- type PropertyVariableItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"propertyVariable", T> & {
1098
- type: string | null;
1099
- coordinates: Array<Coordinates<T>>;
1100
- }>;
1101
- type PropertyValueItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"propertyValue", T> & {
1102
- coordinates: Array<Coordinates<T>>;
1103
- }>;
1104
- type ResourceItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"resource", T> & {
1105
- type: string | null;
1106
- href: string | null;
1107
- fileFormat: string | null;
1108
- fileSize: number | null;
1109
- isInline: boolean;
1110
- isPrimary: boolean;
1111
- height: number | null;
1112
- width: number | null;
1113
- image: Image<T> | null;
1114
- coordinates: Array<Coordinates<T>>;
1115
- }>;
1116
- type TextItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"text", T> & {
1117
- type: string | null;
1118
- text: string | null;
1119
- language: string | null;
1120
- image: Image<T> | null;
1121
- coordinates: Array<Coordinates<T>>;
1122
- }>;
1123
- type DictionaryUnitItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"dictionaryUnit", T>>;
1124
- /**
1125
- * An abridged item reference exposed inside OCHRE links and reverse links.
1126
- */
1127
- 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;
1128
- /**
1129
- * An Item in OCHRE (can be a tree, set, bibliography, concept, spatial unit, period, person, property value, property variable, or resource)
1130
- */
1131
- 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;
1132
- type TopLevelItem<U extends ItemCategory = ItemCategory, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes> = Item<U, V, T, "topLevel">;
1133
- type EmbeddedItem<U extends ItemCategory = ItemCategory, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes> = Item<U, V, T, "embedded">;
1134
- type AnyItem<U extends ItemCategory = ItemCategory, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes> = Item<U, V, T, ItemPayloadKind>;
1135
- /**
1136
- * Heading in OCHRE
1137
- */
1138
- type Heading<U extends HeadingItemCategory = HeadingItemCategory, T extends LanguageCodes = LanguageCodes> = {
1139
- name: string;
1140
- headings: Array<Heading<U, T>>;
1141
- items: Array<Item<U, never, T, "embedded">>;
1142
- };
1143
- /**
1144
- * Tree in OCHRE
1145
- */
1146
- type Tree<U extends TreeItemCategory = TreeItemCategory, T extends LanguageCodes = LanguageCodes, V extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"tree", T, V> & {
1147
- type: string | null;
1148
- containedItemCategory: U | null;
1149
- links: ItemLinks<T>;
1150
- notes: Array<Note<T>>;
1151
- properties: Array<Property<T>>;
1152
- bibliographies: Array<Bibliography<T, "embedded">>;
1153
- items: U extends HeadingItemCategory ? Array<Heading<U, T> | Item<U, never, T, "embedded">> : Array<Item<U, never, T, "embedded">>;
1154
- }>;
1155
- /**
1156
- * Set in OCHRE
1157
- */
1158
- type Set<U extends SetItemCategory = SetItemCategory, T extends LanguageCodes = LanguageCodes, V extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"set", T, V> & {
1159
- containedItemCategories: Array<U>;
1160
- isTabularStructure: boolean;
1161
- isSuppressingBlanks: boolean;
1162
- links: ItemLinks<T>;
1163
- notes: Array<Note<T>>;
1164
- properties: Array<Property<T>>;
1165
- items: Array<SetItem<U, T>>;
1166
- }>;
1167
- type SetBibliography<T extends LanguageCodes = LanguageCodes> = Bibliography<T, "embedded"> extends infer U ? U extends {
1168
- properties: Array<Property<T>>;
1169
- } ? Prettify<Omit<U, "properties" | "items"> & {
1170
- properties: Array<SetItemProperty<T>>;
1171
- }> : never : never;
1172
- type SetConcept<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<Concept<T, "embedded">, "interpretations" | "items"> & {
1173
- properties: Array<SetItemProperty<T>>;
1174
- }>;
1175
- type SetSpatialUnit<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<SpatialUnit<T, "embedded">, "observations" | "items"> & {
1176
- properties: Array<SetItemProperty<T>>;
1177
- }>;
1178
- type SetPeriod<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<WithSetItemProperties<Period<T, "embedded">, T>, "items">>;
1179
- type SetResource<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<WithSetItemProperties<Resource<T, "embedded">, T>, "items">>;
1180
- type SetTree<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<WithSetItemProperties<Tree<TreeItemCategory, T, "embedded">, T>, "items">>;
1181
- 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;
1182
- /**
1183
- * Person in OCHRE
1184
- */
1185
- type Person<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"person", T, U> & {
1186
- type: string;
1187
- image: Image<T> | null;
1188
- address: {
1189
- country: string | null;
1190
- city: string | null;
1191
- state: string | null;
1192
- postalCode: string | null;
1193
- } | null;
1194
- coordinates: Array<Coordinates<T>>;
1195
- content: MultilingualString<T> | null;
1196
- periods: Array<Period<T, "embedded">>;
1197
- links: ItemLinks<T>;
1198
- notes: Array<Note<T>>;
1199
- properties: Array<Property<T>>;
1200
- }>;
1201
- /**
1202
- * Period in OCHRE
1203
- */
1204
- type Period<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"period", T, U> & {
1205
- type: string | null;
1206
- coordinates: Array<Coordinates<T>>;
1207
- links: ItemLinks<T>;
1208
- notes: Array<Note<T>>;
1209
- properties: Array<Property<T>>;
1210
- bibliographies: Array<Bibliography<T, "embedded">>;
1211
- items: Array<Period<T, "embedded">>;
1212
- }>;
1213
- /**
1214
- * Bibliography in OCHRE
1215
- */
1216
- type Bibliography<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"bibliography", T, U> & {
1217
- citationDetails: string | null;
1218
- citationFormat: MultilingualString<T> | null;
1219
- citationFormatSpan: string | null;
1220
- referenceFormatDiv: string | null;
1221
- image: Image<T> | null;
1222
- sourceDocument: BibliographySourceDocument | null;
1223
- publicationInfo: {
1224
- publishers: Array<Person<T, "embedded">>;
1225
- startDate: Date | null;
1226
- } | null;
1227
- entryInfo: BibliographyEntryInfo | null;
1228
- source: ItemLink<TreeItemCategory, T> | null;
1229
- authors: Array<Person<T, "embedded">>;
1230
- periods: Array<Period<T, "embedded">>;
1231
- links: ItemLinks<T>;
1232
- notes: Array<Note<T>>;
1233
- properties: Array<Property<T>>;
1234
- bibliographies: Array<Bibliography<T, "embedded">>;
1235
- items: Array<Bibliography<T, "embedded">>;
1236
- } & ({
1237
- type: "zotero";
1238
- zoteroId: string;
1239
- uuid: string | null;
1240
- } | {
1241
- type: string | null;
1242
- })>;
1243
- /**
1244
- * Concept in OCHRE
1245
- */
1246
- type Concept<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"concept", T, U> & {
1247
- image: Image<T> | null;
1248
- interpretations: Array<Interpretation<T>>;
1249
- coordinates: Array<Coordinates<T>>;
1250
- items: Array<Concept<T, "embedded">>;
1251
- }>;
1252
- /**
1253
- * Interpretation in OCHRE
1254
- */
1255
- type Interpretation<T extends LanguageCodes = LanguageCodes> = {
1256
- number: number;
1257
- date: Date | null;
1258
- observers: Array<Person<T, "embedded">>;
1259
- periods: Array<Period<T, "embedded">>;
1260
- links: ItemLinks<T>;
1261
- notes: Array<Note<T>>;
1262
- properties: Array<Property<T>>;
1263
- bibliographies: Array<Bibliography<T, "embedded">>;
1264
- };
1265
- /**
1266
- * Spatial unit in OCHRE
1267
- */
1268
- type SpatialUnit<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"spatialUnit", T, U> & {
1269
- image: Image<T> | null;
1270
- coordinates: Array<Coordinates<T>>;
1271
- mapData: {
1272
- geoJSON: {
1273
- multiPolygon: string;
1274
- EPSG: number;
1275
- };
1276
- } | null;
1277
- observations: Array<Observation<T>>;
1278
- bibliographies: Array<Bibliography<T, "embedded">>;
1279
- items: Array<SpatialUnit<T, "embedded">>;
1280
- }>;
1281
- /**
1282
- * Observation in OCHRE
1283
- */
1284
- type Observation<T extends LanguageCodes = LanguageCodes> = {
1285
- number: number;
1286
- date: Date | null;
1287
- observers: Array<string> | Array<Person<T, "embedded">>;
1288
- periods: Array<Period<T, "embedded">>;
1289
- links: ItemLinks<T>;
1290
- notes: Array<Note<T>>;
1291
- properties: Array<Property<T>>;
1292
- bibliographies: Array<Bibliography<T, "embedded">>;
1293
- };
1294
- /**
1295
- * Property variable in OCHRE
1296
- */
1297
- type PropertyVariable<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"propertyVariable", T, U> & {
1298
- type: string | null;
1299
- coordinates: Array<Coordinates<T>>;
1300
- links: ItemLinks<T>;
1301
- notes: Array<Note<T>>;
1302
- bibliographies: Array<Bibliography<T, "embedded">>;
1303
- }>;
1304
- /**
1305
- * Property value in OCHRE
1306
- */
1307
- type PropertyValue<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"propertyValue", T, U> & {
1308
- coordinates: Array<Coordinates<T>>;
1309
- links: ItemLinks<T>;
1310
- notes: Array<Note<T>>;
1311
- properties: Array<Property<T>>;
1312
- bibliographies: Array<Bibliography<T, "embedded">>;
1313
- }>;
1314
- /**
1315
- * Resource in OCHRE
1316
- */
1317
- type Resource<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"resource", T, U> & {
1318
- type: string;
1319
- href: string | null;
1320
- fileFormat: string | null;
1321
- fileSize: number | null;
1322
- isInline: boolean;
1323
- height: number | null;
1324
- width: number | null;
1325
- image: Image<T> | null;
1326
- document: MultilingualString<T> | null;
1327
- imageMap: ImageMap | null;
1328
- coordinates: Array<Coordinates<T>>;
1329
- periods: Array<Period<T, "embedded">>;
1330
- links: ItemLinks<T>;
1331
- reverseLinks: ItemLinks<T>;
1332
- notes: Array<Note<T>>;
1333
- properties: Array<Property<T>>;
1334
- bibliographies: Array<Bibliography<T, "embedded">>;
1335
- items: Array<Resource<T, "embedded">>;
1336
- } & (U extends "topLevel" ? {
1337
- view: Webpage<T> | null;
1338
- } : unknown)>;
1339
- /**
1340
- * Text in OCHRE
1341
- */
1342
- type Text<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"text", T, U> & {
1343
- type: string;
1344
- text: string | null;
1345
- language: string | null;
1346
- image: Image<T> | null;
1347
- coordinates: Array<Coordinates<T>>;
1348
- links: ItemLinks<T>;
1349
- reverseLinks: ItemLinks<T>;
1350
- notes: Array<Note<T>>;
1351
- sections: Array<Section<T>>;
1352
- periods: Array<Period<T, "embedded">>;
1353
- creators: Array<Person<T, "embedded">>;
1354
- editions: Array<Person<T, "embedded">>;
1355
- }>;
1356
- /**
1357
- * Section in OCHRE
1358
- */
1359
- type Section<T extends LanguageCodes = LanguageCodes> = {
1360
- uuid: string;
1361
- publicationDateTime: Date | null;
1362
- identification: Identification<T>;
1363
- project: {
1364
- identification: Identification<T>;
1365
- } | null;
1366
- };
1367
- type EmbeddedTree<U extends TreeItemCategory = TreeItemCategory, T extends LanguageCodes = LanguageCodes> = Tree<U, T, "embedded">;
1368
- type AnyTree<U extends TreeItemCategory = TreeItemCategory, T extends LanguageCodes = LanguageCodes> = Tree<U, T, ItemPayloadKind>;
1369
- type EmbeddedSet<U extends SetItemCategory = SetItemCategory, T extends LanguageCodes = LanguageCodes> = Set<U, T, "embedded">;
1370
- type AnySet<U extends SetItemCategory = SetItemCategory, T extends LanguageCodes = LanguageCodes> = Set<U, T, ItemPayloadKind>;
1371
- type EmbeddedBibliography<T extends LanguageCodes = LanguageCodes> = Bibliography<T, "embedded">;
1372
- type AnyBibliography<T extends LanguageCodes = LanguageCodes> = Bibliography<T, ItemPayloadKind>;
1373
- type EmbeddedConcept<T extends LanguageCodes = LanguageCodes> = Concept<T, "embedded">;
1374
- type AnyConcept<T extends LanguageCodes = LanguageCodes> = Concept<T, ItemPayloadKind>;
1375
- type EmbeddedSpatialUnit<T extends LanguageCodes = LanguageCodes> = SpatialUnit<T, "embedded">;
1376
- type AnySpatialUnit<T extends LanguageCodes = LanguageCodes> = SpatialUnit<T, ItemPayloadKind>;
1377
- type EmbeddedPeriod<T extends LanguageCodes = LanguageCodes> = Period<T, "embedded">;
1378
- type AnyPeriod<T extends LanguageCodes = LanguageCodes> = Period<T, ItemPayloadKind>;
1379
- type EmbeddedPerson<T extends LanguageCodes = LanguageCodes> = Person<T, "embedded">;
1380
- type AnyPerson<T extends LanguageCodes = LanguageCodes> = Person<T, ItemPayloadKind>;
1381
- type EmbeddedPropertyVariable<T extends LanguageCodes = LanguageCodes> = PropertyVariable<T, "embedded">;
1382
- type AnyPropertyVariable<T extends LanguageCodes = LanguageCodes> = PropertyVariable<T, ItemPayloadKind>;
1383
- type EmbeddedPropertyValue<T extends LanguageCodes = LanguageCodes> = PropertyValue<T, "embedded">;
1384
- type AnyPropertyValue<T extends LanguageCodes = LanguageCodes> = PropertyValue<T, ItemPayloadKind>;
1385
- type EmbeddedResource<T extends LanguageCodes = LanguageCodes> = Resource<T, "embedded">;
1386
- type AnyResource<T extends LanguageCodes = LanguageCodes> = Resource<T, ItemPayloadKind>;
1387
- type EmbeddedText<T extends LanguageCodes = LanguageCodes> = Text<T, "embedded">;
1388
- type AnyText<T extends LanguageCodes = LanguageCodes> = Text<T, ItemPayloadKind>;
1389
- /**
1390
- * Represents a gallery with its identification, project identification, resources and max length
1391
- */
1392
- type Gallery<T extends LanguageCodes = LanguageCodes> = {
1393
- identification: Identification<T>;
1394
- projectIdentification: Identification<T>;
1395
- resources: Array<Resource<T, "embedded">>;
1396
- maxLength: number;
1397
- };
1398
- /**
1399
- * Represents a property query item with its UUID, raw value, count, and content
1400
- */
1401
- type PropertyValueQueryItem = {
1402
- count: number;
1403
- dataType: QueryablePropertyValueDataType;
1404
- content: string | number | boolean | null;
1405
- label: MultilingualString | null;
1406
- };
1407
- /**
1408
- * Represents a grouped Set attribute value query item
1409
- */
1410
- type SetAttributeValueQueryItem = {
1411
- count: number;
1412
- content: string;
1413
- };
1414
- /**
1415
- * Represents sorting direction for Set items
1416
- */
1417
- type SetItemsSortDirection = "asc" | "desc";
1418
- /**
1419
- * Represents sorting options for Set items
1420
- */
1421
- type SetItemsSort = {
1422
- target: "none";
1423
- } | {
1424
- target: "title";
1425
- direction?: SetItemsSortDirection;
1426
- language?: string;
1427
- } | {
1428
- target: "propertyValue";
1429
- propertyVariableUuid: string;
1430
- dataType: QueryablePropertyValueDataType;
1431
- direction?: SetItemsSortDirection;
1432
- language?: string;
1433
- };
1434
- /**
1435
- * Represents a leaf query for Set items
1436
- */
1437
- type QueryLeaf = {
1438
- target: "property";
1439
- propertyVariable?: string;
1440
- dataType: Exclude<QueryablePropertyValueDataType, "date" | "dateTime">;
1441
- value?: string;
1442
- from?: never;
1443
- to?: never;
1444
- matchMode: "includes" | "exact";
1445
- isCaseSensitive: boolean;
1446
- language: string;
1447
- isNegated?: boolean;
1448
- } | {
1449
- target: "property";
1450
- propertyVariable: string;
1451
- dataType: "date" | "dateTime";
1452
- value: string;
1453
- from?: never;
1454
- to?: never;
1455
- matchMode: "includes" | "exact";
1456
- isCaseSensitive: boolean;
1457
- language: string;
1458
- isNegated?: boolean;
1459
- } | {
1460
- target: "property";
1461
- propertyVariable: string;
1462
- dataType: "date" | "dateTime";
1463
- value?: never;
1464
- from: string;
1465
- to?: string;
1466
- matchMode: "includes" | "exact";
1467
- isCaseSensitive: boolean;
1468
- language: string;
1469
- isNegated?: boolean;
1470
- } | {
1471
- target: "property";
1472
- propertyVariable: string;
1473
- dataType: "date" | "dateTime";
1474
- value?: never;
1475
- from?: string;
1476
- to: string;
1477
- matchMode: "includes" | "exact";
1478
- isCaseSensitive: boolean;
1479
- language: string;
1480
- isNegated?: boolean;
1481
- } | {
1482
- target: "property";
1483
- propertyVariable?: string;
1484
- dataType: "all";
1485
- value: string;
1486
- matchMode: "includes" | "exact";
1487
- isCaseSensitive: boolean;
1488
- language: string;
1489
- isNegated?: boolean;
1490
- } | {
1491
- target: "string";
1492
- value: string;
1493
- matchMode: "includes" | "exact";
1494
- isCaseSensitive: boolean;
1495
- language: string;
1496
- isNegated?: boolean;
1497
- } | {
1498
- target: "title" | "description" | "image" | "periods" | "bibliography" | "notes";
1499
- value: string;
1500
- matchMode: "includes" | "exact";
1501
- isCaseSensitive: boolean;
1502
- language: string;
1503
- isNegated?: boolean;
1504
- };
1505
- /**
1506
- * Represents a boolean query group for Set items
1507
- */
1508
- type QueryGroup = {
1509
- and: Array<Query>;
1510
- } | {
1511
- or: Array<Query>;
1512
- };
1513
- /**
1514
- * Represents a query for Set items
1515
- */
1516
- type Query = QueryLeaf | QueryGroup;
1517
- //#endregion
1518
- //#region src/fetchers/gallery.d.ts
1519
- type FetchFunction$4 = (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
1520
- type FetchGalleryBaseOptions<TLanguages extends ReadonlyArray<string> | undefined = undefined> = {
1521
- languages?: TLanguages;
1522
- fetch?: FetchFunction$4;
1523
- };
1524
- type FetchGalleryLanguages<TLanguages extends ReadonlyArray<string> | undefined> = TLanguages extends readonly [] ? ReadonlyArray<string> : TLanguages extends ReadonlyArray<string> ? TLanguages : ReadonlyArray<string>;
1525
- /**
1526
- * Fetches and parses a gallery from the OCHRE API
1527
- *
1528
- * @param params - The parameters for the fetch
1529
- * @param params.uuid - The UUID of the gallery
1530
- * @param params.filter - The filter to apply to the gallery
1531
- * @param params.page - The page number to fetch
1532
- * @param params.perPage - The number of items per page
1533
- * @param options - The options for the fetch
1534
- * @param options.languages - Language codes to parse. Inline arrays preserve literal types automatically.
1535
- * @param options.fetch - The fetch function to use
1536
- * @returns The parsed gallery or an error message if the fetch/parse fails
1537
- */
1538
- declare function fetchGallery<const TLanguages extends ReadonlyArray<string> | undefined = undefined>(params: {
1539
- uuid: string;
1540
- filter?: string;
1541
- page: number;
1542
- perPage: number;
1543
- }, options?: FetchGalleryBaseOptions<TLanguages>): Promise<{
1544
- gallery: Gallery<FetchGalleryLanguages<TLanguages>>;
1545
- error: null;
1546
- detailedError: null;
1547
- } | {
1548
- gallery: null;
1549
- error: string;
1550
- detailedError: string;
1551
- }>;
1552
- //#endregion
1553
- //#region src/fetchers/item-links.d.ts
1554
- type FetchFunction$3 = (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
1555
- type FetchItemLinksBaseOptions<TLanguages extends ReadonlyArray<string> | undefined = undefined> = {
1556
- languages?: TLanguages;
1557
- fetch?: FetchFunction$3;
1558
- };
1559
- type FetchItemLinksLanguages<TLanguages extends ReadonlyArray<string> | undefined> = TLanguages extends readonly [] ? ReadonlyArray<string> : TLanguages extends ReadonlyArray<string> ? TLanguages : ReadonlyArray<string>;
1560
- /**
1561
- * Fetches linked OCHRE items by source-item UUID.
1562
- *
1563
- * @param uuid - The UUID of the OCHRE item whose linked items should be fetched
1564
- * @param options - Fetch and parser options
1565
- * @param options.containedItemCategory - The category of items inside linked Trees/Sets to parse. Tree accepts one category; Set accepts one category or an array.
1566
- * @param options.languages - Language codes to parse. Inline arrays preserve literal types automatically.
1567
- * @param options.fetch - Custom fetch function to use instead of the default fetch
1568
- * @returns An object containing parsed linked items
1569
- */
1570
- declare function fetchItemLinks<const TContainedItemCategory extends ContainedItemCategoryOption<ItemContainerCategory> | undefined = undefined, const TLanguages extends ReadonlyArray<string> | undefined = undefined>(uuid: string, options?: FetchItemLinksBaseOptions<TLanguages> & {
1571
- containedItemCategory?: TContainedItemCategory;
1572
- }): Promise<{
1573
- items: Array<Item<ItemCategory, ContainedItemCategoryFromOption<ItemCategory, TContainedItemCategory>, FetchItemLinksLanguages<TLanguages>, "embedded">>;
1574
- error: null;
1575
- detailedError: null;
1576
- } | {
1577
- items: null;
1578
- error: string;
1579
- detailedError: string;
1580
- }>;
1581
- //#endregion
1582
- //#region src/fetchers/item.d.ts
1583
- type FetchFunction$2 = (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
1584
- type FetchItemBaseOptions<TLanguages extends ReadonlyArray<string> | undefined = undefined> = {
1585
- languages?: TLanguages;
1586
- fetch?: FetchFunction$2;
1587
- };
1588
- type FetchItemLanguages<TLanguages extends ReadonlyArray<string> | undefined> = TLanguages extends readonly [] ? ReadonlyArray<string> : TLanguages extends ReadonlyArray<string> ? TLanguages : ReadonlyArray<string>;
1589
- /**
1590
- * Defines a reusable languages tuple with validation and literal type inference.
1591
- *
1592
- * Inline arrays can be passed directly to fetchItem:
1593
- * `fetchItem(uuid, { languages: ["eng", "spa"] })`.
1594
- *
1595
- * Use this helper when the language set is stored separately:
1596
- * `const languages = defineLanguages("eng", "spa")`.
1597
- */
1598
- declare function defineLanguages<const TLanguages extends ReadonlyArray<string>>(...languages: TLanguages): TLanguages;
1599
- /**
1600
- * @deprecated Pass inline language arrays directly to fetchItem, or use
1601
- * defineLanguages("eng", "spa") for reusable language tuples.
1602
- */
1603
- declare function withLanguages<const TLanguages extends ReadonlyArray<string>>(languages: TLanguages): TLanguages;
1604
- /**
1605
- * Fetches an OCHRE item by UUID from the OCHRE API
1606
- *
1607
- * @param uuid - The UUID of the OCHRE item to fetch
1608
- * @param options - Required options object
1609
- * @param options.category - The category of the OCHRE item to fetch
1610
- * @param options.containedItemCategory - The category of items inside the OCHRE item to fetch. Only valid for Trees and Sets. Tree accepts one category; Set accepts one category or an array.
1611
- * @param options.languages - Language codes to parse. Inline arrays preserve literal types automatically.
1612
- * @param options.fetch - Custom fetch function to use instead of the default fetch
1613
- * @returns An object containing the parsed item
1614
- */
1615
- declare function fetchItem<const TContainedItemCategory extends ContainedItemCategoryOption<ItemContainerCategory> | undefined = undefined, const TLanguages extends ReadonlyArray<string> | undefined = undefined>(uuid: string, options?: FetchItemBaseOptions<TLanguages> & {
1616
- category?: undefined;
1617
- containedItemCategory?: TContainedItemCategory;
1618
- }): Promise<{
1619
- item: Item<ItemCategory, ContainedItemCategoryFromOption<ItemCategory, TContainedItemCategory>, FetchItemLanguages<TLanguages>>;
1620
- error: null;
1621
- detailedError: null;
1622
- } | {
1623
- item: null;
1624
- error: string;
1625
- detailedError: string;
1626
- }>;
1627
- declare function fetchItem<const TCategory extends ItemContainerCategory, const TContainedItemCategory extends ContainedItemCategoryOption<TCategory> | undefined = undefined, const TLanguages extends ReadonlyArray<string> | undefined = undefined>(uuid: string, options: FetchItemBaseOptions<TLanguages> & {
1628
- category: TCategory;
1629
- containedItemCategory?: TContainedItemCategory;
1630
- }): Promise<{
1631
- item: Item<TCategory, ContainedItemCategoryFromOption<TCategory, TContainedItemCategory>, FetchItemLanguages<TLanguages>>;
1632
- error: null;
1633
- detailedError: null;
1634
- } | {
1635
- item: null;
1636
- error: string;
1637
- detailedError: string;
1638
- }>;
1639
- declare function fetchItem<const TCategory extends ItemCategory, const TLanguages extends ReadonlyArray<string> | undefined = undefined>(uuid: string, options: FetchItemBaseOptions<TLanguages> & {
1640
- category: TCategory;
1641
- containedItemCategory?: never;
1642
- }): Promise<{
1643
- item: Item<TCategory, ContainedItemCategory<TCategory>, FetchItemLanguages<TLanguages>>;
1644
- error: null;
1645
- detailedError: null;
1646
- } | {
1647
- item: null;
1648
- error: string;
1649
- detailedError: string;
1650
- }>;
1651
- //#endregion
1652
- //#region src/fetchers/set/items.d.ts
1653
- type FetchFunction$1 = (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
1654
- type FetchSetItemsBaseOptions<TLanguages extends ReadonlyArray<string> | undefined = undefined> = {
1655
- languages?: TLanguages;
1656
- fetch?: FetchFunction$1;
1657
- };
1658
- type FetchSetItemsLanguages<TLanguages extends ReadonlyArray<string> | undefined> = TLanguages extends readonly [] ? ReadonlyArray<string> : TLanguages extends ReadonlyArray<string> ? TLanguages : ReadonlyArray<string>;
1659
- type FetchSetItemsCategory<TContainedItemCategories extends ReadonlyArray<SetItemCategory> | undefined> = TContainedItemCategories extends ReadonlyArray<infer U> ? Extract<U, SetItemCategory> : SetItemCategory;
1660
- /**
1661
- * Fetches and parses Set items from the OCHRE API
1662
- *
1663
- * @param params - The parameters for the fetch
1664
- * @param params.setScopeUuids - The Set scope UUIDs to filter by
1665
- * @param params.queries - Recursive query tree used to filter matching items
1666
- * @param params.sort - Optional sorting configuration applied before pagination.
1667
- * For propertyValue sorting, dataType is required and the sort key uses the first valid leaf value (value[not(@i)]).
1668
- * @param params.page - The page number (1-indexed)
1669
- * @param params.pageSize - The number of items per page
1670
- * @param containedItemCategories - The categories of the items to fetch
1671
- * @param options - Options for the fetch
1672
- * @param options.fetch - The fetch function to use
1673
- * @returns The parsed Set items or null if the fetch/parse fails
1674
- */
1675
- declare function fetchSetItems<const TContainedItemCategories extends ReadonlyArray<SetItemCategory> | undefined = undefined, const TLanguages extends ReadonlyArray<string> | undefined = undefined>(params: {
1676
- setScopeUuids: Array<string>;
1677
- queries?: Query | null;
1678
- sort?: SetItemsSort;
1679
- page: number;
1680
- pageSize?: number;
1681
- }, containedItemCategories?: TContainedItemCategories, options?: FetchSetItemsBaseOptions<TLanguages>): Promise<{
1682
- totalCount: number;
1683
- page: number;
1684
- pageSize: number;
1685
- items: Array<SetItem<FetchSetItemsCategory<TContainedItemCategories>, FetchSetItemsLanguages<TLanguages>>>;
1686
- error: null;
1687
- detailedError: null;
1688
- } | {
1689
- totalCount: null;
1690
- page: null;
1691
- pageSize: null;
1692
- items: null;
1693
- error: string;
1694
- detailedError: string;
1695
- }>;
1696
- //#endregion
1697
- //#region src/fetchers/set/property-values.d.ts
1698
- /**
1699
- * Fetches and parses Set property values from the OCHRE API
1700
- *
1701
- * @param params - The parameters for the fetch
1702
- * @param params.setScopeUuids - An array of set scope UUIDs to filter by
1703
- * @param params.queries - Recursive query tree used to filter matching items
1704
- * @param params.attributes - Whether to return values for bibliographies and periods
1705
- * @param params.attributes.bibliographies - Whether to return values for bibliographies
1706
- * @param params.attributes.periods - Whether to return values for periods
1707
- * @param params.isLimitedToLeafPropertyValues - Whether to limit the property values to leaf property values
1708
- * @param options - Options for the fetch
1709
- * @param options.fetch - The fetch function to use
1710
- * @returns Parsed Set property values and requested attribute values.
1711
- * Returns empty arrays/objects when no matches are found, and null outputs on fetch/parse errors.
1712
- */
1713
- declare function fetchSetPropertyValues(params: {
1714
- setScopeUuids: Array<string>;
1715
- queries?: Query | null;
1716
- attributes?: {
1717
- bibliographies: boolean;
1718
- periods: boolean;
1719
- };
1720
- isLimitedToLeafPropertyValues?: boolean;
1721
- }, options?: {
1722
- fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
1723
- }): Promise<{
1724
- propertyValues: Array<PropertyValueQueryItem>;
1725
- propertyValuesByPropertyVariableUuid: Record<string, Array<PropertyValueQueryItem>>;
1726
- attributeValues: {
1727
- bibliographies: Array<SetAttributeValueQueryItem> | null;
1728
- periods: Array<SetAttributeValueQueryItem> | null;
1729
- };
1730
- error: null;
1731
- detailedError: null;
1732
- } | {
1733
- propertyValues: null;
1734
- propertyValuesByPropertyVariableUuid: null;
1735
- attributeValues: null;
1736
- error: string;
1737
- detailedError: string;
1738
- }>;
1739
- //#endregion
1740
- //#region src/fetchers/website.d.ts
1741
- type FetchFunction = (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
1742
- /**
1743
- * Fetches and parses a website configuration from the OCHRE API
1744
- *
1745
- * @param abbreviation - The abbreviation identifier for the website
1746
- * @returns The parsed website configuration or null if the fetch/parse fails
1747
- */
1748
- declare function fetchWebsite<const T extends LanguageCodes = LanguageCodes>(abbreviation: string, options?: {
1749
- fetch?: FetchFunction;
1750
- languages?: T;
1751
- }): Promise<{
1752
- website: Website<T>;
1753
- error: null;
1754
- detailedError: null;
1755
- } | {
1756
- website: null;
1757
- error: string;
1758
- detailedError: string;
1759
- }>;
1760
- //#endregion
1761
- //#region src/getters.d.ts
1762
- /**
1763
- * Options for property search operations.
1764
- */
1765
- type PropertyOptions = {
1766
- /** Whether to recursively search through nested properties. */includeNestedProperties?: boolean; /** Whether to limit property values to leaf values. */
1767
- limitToLeafPropertyValues?: boolean;
1768
- };
1769
- type PropertyContent<T extends LanguageCodes> = PropertyValueContent<T>["content"];
1770
- type SearchableProperty<T extends LanguageCodes> = PropertyLike<T>;
1771
- /**
1772
- * Finds a property by its variable UUID in an array of properties.
1773
- *
1774
- * @param properties - Array of properties to search through
1775
- * @param variableUuid - The property variable UUID to search for
1776
- * @param options - Search options, including whether to include nested properties
1777
- * @returns The matching Property object, or null if not found
1778
- */
1779
- declare function getPropertyByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, variableUuid: string, options?: PropertyOptions): Property<T> | null;
1780
- declare function getPropertyByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, variableUuid: string, options?: PropertyOptions): SetItemProperty<T> | null;
1781
- declare function getPropertyByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, variableUuid: string, options?: PropertyOptions): SimplifiedProperty<T> | null;
1782
- declare function getPropertyByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, variableUuid: string, options?: PropertyOptions): SetItemSimplifiedProperty<T> | null;
1783
- /**
1784
- * Retrieves all values for a property with the given variable UUID.
1785
- *
1786
- * @param properties - Array of properties to search through
1787
- * @param variableUuid - The property variable UUID to search for
1788
- * @param options - Search options, including whether to include nested properties
1789
- * @returns Array of property values, or null if property not found
1790
- */
1791
- declare function getPropertyValuesByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SearchableProperty<T>>, variableUuid: string, options?: PropertyOptions): Array<PropertyValueContent<T>> | null;
1792
- /**
1793
- * Retrieves all value contents for a property with the given variable UUID.
1794
- *
1795
- * @param properties - Array of properties to search through
1796
- * @param variableUuid - The property variable UUID to search for
1797
- * @param options - Search options, including whether to include nested properties
1798
- * @returns Array of property value contents, or null if property not found
1799
- */
1800
- declare function getPropertyValueContentsByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SearchableProperty<T>>, variableUuid: string, options?: PropertyOptions): Array<PropertyContent<T>> | null;
1801
- /**
1802
- * Gets the first value of a property with the given variable UUID.
1803
- *
1804
- * @param properties - Array of properties to search through
1805
- * @param variableUuid - The property variable UUID to search for
1806
- * @param options - Search options, including whether to include nested properties
1807
- * @returns The first property value, or null if property not found
1808
- */
1809
- declare function getPropertyValueByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SearchableProperty<T>>, variableUuid: string, options?: PropertyOptions): PropertyValueContent<T> | null;
1810
- /**
1811
- * Gets the first value content of a property with the given variable UUID.
1812
- *
1813
- * @param properties - Array of properties to search through
1814
- * @param variableUuid - The property variable UUID to search for
1815
- * @param options - Search options, including whether to include nested properties
1816
- * @returns The first property value content, or null if property not found
1817
- */
1818
- declare function getPropertyValueContentByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SearchableProperty<T>>, variableUuid: string, options?: PropertyOptions): PropertyContent<T> | null;
1819
- /**
1820
- * Finds a property by its variable label in an array of properties.
1821
- *
1822
- * @param properties - Array of properties to search through
1823
- * @param variableLabel - The property variable label to search for
1824
- * @param options - Search options, including whether to include nested properties
1825
- * @returns The matching Property object, or null if not found
1826
- */
1827
- declare function getPropertyByVariableLabel<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, variableLabel: string, options?: PropertyOptions): Property<T> | null;
1828
- declare function getPropertyByVariableLabel<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, variableLabel: string, options?: PropertyOptions): SetItemProperty<T> | null;
1829
- declare function getPropertyByVariableLabel<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, variableLabel: string, options?: PropertyOptions): SimplifiedProperty<T> | null;
1830
- declare function getPropertyByVariableLabel<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, variableLabel: string, options?: PropertyOptions): SetItemSimplifiedProperty<T> | null;
1831
- /**
1832
- * Finds a property by its variable label and all values.
1833
- *
1834
- * @param properties - Array of properties to search through
1835
- * @param variableLabel - The property variable label to search for
1836
- * @param values - The property values to search for
1837
- * @param options - Search options, including whether to include nested properties
1838
- * @returns The matching Property object, or null if not found or all values do not match
1839
- */
1840
- declare function getPropertyByVariableLabelAndValues<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, variableLabel: string, values: ReadonlyArray<PropertyValueContent<T>>, options?: PropertyOptions): Property<T> | null;
1841
- declare function getPropertyByVariableLabelAndValues<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, variableLabel: string, values: ReadonlyArray<PropertyValueContent<T>>, options?: PropertyOptions): SetItemProperty<T> | null;
1842
- declare function getPropertyByVariableLabelAndValues<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, variableLabel: string, values: ReadonlyArray<PropertyValueContent<T>>, options?: PropertyOptions): SimplifiedProperty<T> | null;
1843
- declare function getPropertyByVariableLabelAndValues<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, variableLabel: string, values: ReadonlyArray<PropertyValueContent<T>>, options?: PropertyOptions): SetItemSimplifiedProperty<T> | null;
1844
- /**
1845
- * Finds a property by its variable label and all value contents.
1846
- *
1847
- * @param properties - Array of properties to search through
1848
- * @param variableLabel - The property variable label to search for
1849
- * @param valueContents - The value contents to search for
1850
- * @param options - Search options, including whether to include nested properties
1851
- * @returns The matching Property object, or null if not found or all value contents do not match
1852
- */
1853
- declare function getPropertyByVariableLabelAndValueContents<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, variableLabel: string, valueContents: ReadonlyArray<PropertyContent<T>>, options?: PropertyOptions): Property<T> | null;
1854
- declare function getPropertyByVariableLabelAndValueContents<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, variableLabel: string, valueContents: ReadonlyArray<PropertyContent<T>>, options?: PropertyOptions): SetItemProperty<T> | null;
1855
- declare function getPropertyByVariableLabelAndValueContents<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, variableLabel: string, valueContents: ReadonlyArray<PropertyContent<T>>, options?: PropertyOptions): SimplifiedProperty<T> | null;
1856
- declare function getPropertyByVariableLabelAndValueContents<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, variableLabel: string, valueContents: ReadonlyArray<PropertyContent<T>>, options?: PropertyOptions): SetItemSimplifiedProperty<T> | null;
1857
- /**
1858
- * Finds a property by its variable label and one value.
1859
- *
1860
- * @param properties - Array of properties to search through
1861
- * @param variableLabel - The property variable label to search for
1862
- * @param value - The property value to search for
1863
- * @param options - Search options, including whether to include nested properties
1864
- * @returns The matching Property object, or null if not found or value does not match
1865
- */
1866
- declare function getPropertyByVariableLabelAndValue<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, variableLabel: string, value: PropertyValueContent<T>, options?: PropertyOptions): Property<T> | null;
1867
- declare function getPropertyByVariableLabelAndValue<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, variableLabel: string, value: PropertyValueContent<T>, options?: PropertyOptions): SetItemProperty<T> | null;
1868
- declare function getPropertyByVariableLabelAndValue<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, variableLabel: string, value: PropertyValueContent<T>, options?: PropertyOptions): SimplifiedProperty<T> | null;
1869
- declare function getPropertyByVariableLabelAndValue<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, variableLabel: string, value: PropertyValueContent<T>, options?: PropertyOptions): SetItemSimplifiedProperty<T> | null;
1870
- /**
1871
- * Finds a property by its variable label and one value content.
1872
- *
1873
- * @param properties - Array of properties to search through
1874
- * @param variableLabel - The property variable label to search for
1875
- * @param valueContent - The value content to search for
1876
- * @param options - Search options, including whether to include nested properties
1877
- * @returns The matching Property object, or null if not found or value content does not match
1878
- */
1879
- declare function getPropertyByVariableLabelAndValueContent<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, variableLabel: string, valueContent: PropertyContent<T>, options?: PropertyOptions): Property<T> | null;
1880
- declare function getPropertyByVariableLabelAndValueContent<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, variableLabel: string, valueContent: PropertyContent<T>, options?: PropertyOptions): SetItemProperty<T> | null;
1881
- declare function getPropertyByVariableLabelAndValueContent<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, variableLabel: string, valueContent: PropertyContent<T>, options?: PropertyOptions): SimplifiedProperty<T> | null;
1882
- declare function getPropertyByVariableLabelAndValueContent<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, variableLabel: string, valueContent: PropertyContent<T>, options?: PropertyOptions): SetItemSimplifiedProperty<T> | null;
1883
- /**
1884
- * Retrieves all values for a property with the given variable label.
1885
- *
1886
- * @param properties - Array of properties to search through
1887
- * @param variableLabel - The property variable label to search for
1888
- * @param options - Search options, including whether to include nested properties
1889
- * @returns Array of property values, or null if property not found
1890
- */
1891
- declare function getPropertyValuesByVariableLabel<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SearchableProperty<T>>, variableLabel: string, options?: PropertyOptions): Array<PropertyValueContent<T>> | null;
1892
- /**
1893
- * Gets the first value of a property with the given variable label.
1894
- *
1895
- * @param properties - Array of properties to search through
1896
- * @param variableLabel - The property variable label to search for
1897
- * @param options - Search options, including whether to include nested properties
1898
- * @returns The first property value, or null if property not found
1899
- */
1900
- declare function getPropertyValueByVariableLabel<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SearchableProperty<T>>, variableLabel: string, options?: PropertyOptions): PropertyValueContent<T> | null;
1901
- /**
1902
- * Gets the first value content of a property with the given variable label.
1903
- *
1904
- * @param properties - Array of properties to search through
1905
- * @param variableLabel - The property variable label to search for
1906
- * @param options - Search options, including whether to include nested properties
1907
- * @returns The first property value content, or null if property not found
1908
- */
1909
- declare function getPropertyValueContentByVariableLabel<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SearchableProperty<T>>, variableLabel: string, options?: PropertyOptions): PropertyContent<T> | null;
1910
- /**
1911
- * Gets all unique properties from an array of properties.
1912
- *
1913
- * @param properties - Array of properties to get unique properties from
1914
- * @param options - Search options, including whether to include nested properties
1915
- * @returns Array of unique properties
1916
- */
1917
- declare function getUniqueProperties<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, options?: PropertyOptions): Array<Property<T>>;
1918
- declare function getUniqueProperties<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, options?: PropertyOptions): Array<SetItemProperty<T>>;
1919
- declare function getUniqueProperties<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, options?: PropertyOptions): Array<SimplifiedProperty<T>>;
1920
- declare function getUniqueProperties<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, options?: PropertyOptions): Array<SetItemSimplifiedProperty<T>>;
1921
- /**
1922
- * Gets all unique property variable labels from an array of properties.
1923
- *
1924
- * @param properties - Array of properties to get unique property variable labels from
1925
- * @param options - Search options, including whether to include nested properties
1926
- * @returns Array of unique property variable labels
1927
- */
1928
- declare function getUniquePropertyVariableLabels<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SearchableProperty<T>>, options?: PropertyOptions): Array<string>;
1929
- /**
1930
- * Get the leaf property values from an array of property values.
1931
- *
1932
- * @param propertyValues - The array of property values to get the leaf property values from
1933
- * @returns The array of leaf property values
1934
- */
1935
- declare function getLeafPropertyValues<T extends LanguageCodes = LanguageCodes>(propertyValues: ReadonlyArray<PropertyValueContent<T>>): Array<PropertyValueContent<T>>;
1936
- /**
1937
- * Filters a property based on a variable label and value content criterion.
1938
- *
1939
- * @param property - The property to filter
1940
- * @param filter - Filter criteria containing variable label and value to match
1941
- * @param filter.variableLabel - The variable label to filter by
1942
- * @param filter.value - The value to filter by
1943
- * @param options - Search options, including whether to include nested properties
1944
- * @returns True if the property matches the filter criteria, false otherwise
1945
- */
1946
- declare function filterProperties<T extends LanguageCodes = LanguageCodes>(property: SearchableProperty<T>, filter: {
1947
- variableLabel: string;
1948
- value: PropertyValueContent<T>;
1949
- }, options?: PropertyOptions): boolean;
1950
- //#endregion
1951
- //#region src/helpers.d.ts
1952
- type FlattenedItem<U, T extends LanguageCodes> = Omit<U, "properties"> & {
1953
- properties: Array<SetItemProperty<T>>;
1954
- };
1955
- /**
1956
- * The default page size to use for fetching paginated items
1957
- */
1958
- declare const DEFAULT_PAGE_SIZE = 48;
1959
- /**
1960
- * Flatten the properties of an item
1961
- * @param item - The item whose properties to flatten
1962
- * @returns The item with the properties flattened
1963
- */
1964
- declare function flattenItemProperties<U extends ItemCategory = ItemCategory, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes, W extends ItemPayloadKind = "topLevel">(item: Item<U, V, T, W>): FlattenedItem<Item<U, V, T, W>, T>;
1965
- //#endregion
1966
- export { AccordionWebBlock, AnyBibliography, AnyConcept, AnyItem, AnyPeriod, AnyPerson, AnyPropertyValue, AnyPropertyVariable, AnyResource, AnySet, AnySpatialUnit, AnyText, AnyTree, BaseItem, BaseItemLink, BelongsTo, Bibliography, BibliographyEntryInfo, BibliographyItemLink, BibliographySourceDocument, Concept, ConceptItemLink, ContainedItemCategory, ContainedItemCategoryFromOption, ContainedItemCategoryOption, Context, ContextItem, ContextItemCategory, ContextNode, ContextTree, ContextTreeFilterLevel, ContextTreeLevel, ContextTreeLevelItem, Coordinates, CoordinatesSource, DEFAULT_PAGE_SIZE, DictionaryUnitItemLink, EmbeddedBibliography, EmbeddedConcept, EmbeddedItem, EmbeddedPeriod, EmbeddedPerson, EmbeddedPropertyValue, EmbeddedPropertyVariable, EmbeddedResource, EmbeddedSet, EmbeddedSpatialUnit, EmbeddedText, EmbeddedTree, Event, Gallery, Heading, HeadingItemCategory, Identification, Image, ImageMap, ImageMapArea, Interpretation, Item, ItemCategory, ItemContainerCategory, ItemLink, ItemLinkCategory, ItemLinks, ItemPayloadKind, ItemProperty, LanguageCodes, License, Metadata, type MultilingualOptions, MultilingualString, type MultilingualStringEntries, type MultilingualStringEntry, type MultilingualStringInput, type MultilingualStringJSON, type MultilingualStringObject, type MultilingualStringText, Note, Observation, Period, PeriodItemLink, Person, PersonItemLink, Property, PropertyLike, PropertyOptions, PropertyValue, PropertyValueContent, PropertyValueDataType, PropertyValueItemLink, PropertyValueQueryItem, PropertyVariable, PropertyVariableItemLink, Query, QueryGroup, QueryLeaf, QueryablePropertyValueDataType, RecursiveItemCategory, Resource, ResourceItemLink, Scope, Section, Set, SetAttributeValueQueryItem, SetBibliography, SetConcept, SetItem, SetItemCategory, SetItemLink, SetItemProperty, SetItemSimplifiedProperty, SetItemsSort, SetItemsSortDirection, SetPeriod, SetResource, SetSpatialUnit, SetTree, SimplifiedProperty, SpatialUnit, SpatialUnitItemLink, Style, StylesheetCategory, StylesheetItem, Text, TextItemLink, TopLevelItem, Tree, TreeItemCategory, TreeItemLink, WebBlock, WebBlockByLayout, WebBlockLayout, WebElement, WebElementComponent, WebElementComponentName, WebElementComponentOf, WebElementOf, WebImage, WebTitle, Webpage, Website, WebsitePropertyQuery, WebsitePropertyQueryNode, WebsiteSegment, WebsiteType, defineLanguages, fetchGallery, fetchItem, fetchItemLinks, fetchSetItems, fetchSetPropertyValues, fetchWebsite, filterProperties, flattenItemProperties, getLeafPropertyValues, getPropertyByVariableLabel, getPropertyByVariableLabelAndValue, getPropertyByVariableLabelAndValueContent, getPropertyByVariableLabelAndValueContents, getPropertyByVariableLabelAndValues, getPropertyByVariableUuid, getPropertyValueByVariableLabel, getPropertyValueByVariableUuid, getPropertyValueContentByVariableLabel, getPropertyValueContentByVariableUuid, getPropertyValueContentsByVariableUuid, getPropertyValuesByVariableLabel, getPropertyValuesByVariableUuid, getUniqueProperties, getUniquePropertyVariableLabels, withLanguages };
1
+ import { MultilingualOptions, MultilingualString, MultilingualStringEntries, MultilingualStringEntry, MultilingualStringInput, MultilingualStringJSON, MultilingualStringObject, MultilingualStringText } from "./parsers/multilingual.mjs";
2
+ import { AccordionWebBlock, ContextTree, ContextTreeFilterLevel, ContextTreeLevel, ContextTreeLevelItem, Scope, Style, StylesheetCategory, StylesheetItem, WebBlock, WebBlockByLayout, WebBlockLayout, WebElement, WebElementComponent, WebElementComponentName, WebElementComponentOf, WebElementOf, WebImage, WebTitle, Webpage, Website, WebsitePropertyQuery, WebsitePropertyQueryNode, WebsiteSegment, WebsiteType } from "./types/website.mjs";
3
+ import { AnyBibliography, AnyConcept, AnyItem, AnyPeriod, AnyPerson, AnyPropertyValue, AnyPropertyVariable, AnyResource, AnySet, AnySpatialUnit, AnyText, AnyTree, BaseItem, BaseItemLink, BelongsTo, Bibliography, BibliographyEntryInfo, BibliographyItemLink, BibliographySourceDocument, Concept, ConceptItemLink, ContainedItemCategory, ContainedItemCategoryFromOption, ContainedItemCategoryOption, Context, ContextItem, ContextItemCategory, ContextNode, Coordinates, CoordinatesSource, DictionaryUnitItemLink, EmbeddedBibliography, EmbeddedConcept, EmbeddedItem, EmbeddedPeriod, EmbeddedPerson, EmbeddedPropertyValue, EmbeddedPropertyVariable, EmbeddedResource, EmbeddedSet, EmbeddedSpatialUnit, EmbeddedText, EmbeddedTree, Event, Gallery, Heading, HeadingItemCategory, Identification, Image, ImageMap, ImageMapArea, Interpretation, Item, ItemCategory, ItemContainerCategory, ItemLink, ItemLinkCategory, ItemLinks, ItemPayloadKind, ItemProperty, ItemWithoutEmbeddedItems, LanguageCodes, License, Metadata, Note, Observation, Period, PeriodItemLink, Person, PersonItemLink, Property, PropertyLike, PropertyValue, PropertyValueContent, PropertyValueDataType, PropertyValueItemLink, PropertyValueQueryItem, PropertyVariable, PropertyVariableItemLink, Query, QueryGroup, QueryLeaf, QueryablePropertyValueDataType, RecursiveItemCategory, Resource, ResourceItemLink, Section, Set, SetAttributeValueQueryItem, SetBibliography, SetConcept, SetItem, SetItemCategory, SetItemLink, SetItemProperty, SetItemSimplifiedProperty, SetItemsSort, SetItemsSortDirection, SetPeriod, SetResource, SetSpatialUnit, SetTree, SimplifiedProperty, SpatialUnit, SpatialUnitItemLink, Text, TextItemLink, TopLevelItem, Tree, TreeItemCategory, TreeItemLink } from "./types/index.mjs";
4
+ import { fetchGallery } from "./fetchers/gallery.mjs";
5
+ import { fetchItemLinks } from "./fetchers/item-links.mjs";
6
+ import { defineLanguages, fetchItem, withLanguages } from "./fetchers/item.mjs";
7
+ import { fetchSetItems } from "./fetchers/set/items.mjs";
8
+ import { fetchSetPropertyValues } from "./fetchers/set/property-values.mjs";
9
+ import { fetchWebsite } from "./fetchers/website.mjs";
10
+ import { PropertyOptions, filterProperties, getLeafPropertyValues, getPropertyByVariableLabel, getPropertyByVariableLabelAndValue, getPropertyByVariableLabelAndValueContent, getPropertyByVariableLabelAndValueContents, getPropertyByVariableLabelAndValues, getPropertyByVariableUuid, getPropertyValueByVariableLabel, getPropertyValueByVariableUuid, getPropertyValueContentByVariableLabel, getPropertyValueContentByVariableUuid, getPropertyValueContentsByVariableUuid, getPropertyValuesByVariableLabel, getPropertyValuesByVariableUuid, getUniqueProperties, getUniquePropertyVariableLabels } from "./getters.mjs";
11
+ import { DEFAULT_PAGE_SIZE, flattenItemProperties } from "./helpers.mjs";
12
+ export { type AccordionWebBlock, type AnyBibliography, type AnyConcept, type AnyItem, type AnyPeriod, type AnyPerson, type AnyPropertyValue, type AnyPropertyVariable, type AnyResource, type AnySet, type AnySpatialUnit, type AnyText, type AnyTree, type BaseItem, type BaseItemLink, type BelongsTo, type Bibliography, type BibliographyEntryInfo, type BibliographyItemLink, type BibliographySourceDocument, type Concept, type ConceptItemLink, type ContainedItemCategory, type ContainedItemCategoryFromOption, type ContainedItemCategoryOption, type Context, type ContextItem, type ContextItemCategory, type ContextNode, type ContextTree, type ContextTreeFilterLevel, type ContextTreeLevel, type ContextTreeLevelItem, type Coordinates, type CoordinatesSource, DEFAULT_PAGE_SIZE, type DictionaryUnitItemLink, type EmbeddedBibliography, type EmbeddedConcept, type EmbeddedItem, type EmbeddedPeriod, type EmbeddedPerson, type EmbeddedPropertyValue, type EmbeddedPropertyVariable, type EmbeddedResource, type EmbeddedSet, type EmbeddedSpatialUnit, type EmbeddedText, type EmbeddedTree, type Event, type Gallery, type Heading, type HeadingItemCategory, type Identification, type Image, type ImageMap, type ImageMapArea, type Interpretation, type Item, type ItemCategory, type ItemContainerCategory, type ItemLink, type ItemLinkCategory, type ItemLinks, type ItemPayloadKind, type ItemProperty, type ItemWithoutEmbeddedItems, type LanguageCodes, type License, type Metadata, type MultilingualOptions, MultilingualString, type MultilingualStringEntries, type MultilingualStringEntry, type MultilingualStringInput, type MultilingualStringJSON, type MultilingualStringObject, type MultilingualStringText, type Note, type Observation, type Period, type PeriodItemLink, type Person, type PersonItemLink, type Property, type PropertyLike, PropertyOptions, type PropertyValue, type PropertyValueContent, type PropertyValueDataType, type PropertyValueItemLink, type PropertyValueQueryItem, type PropertyVariable, type PropertyVariableItemLink, type Query, type QueryGroup, type QueryLeaf, type QueryablePropertyValueDataType, type RecursiveItemCategory, type Resource, type ResourceItemLink, type Scope, type Section, type Set, type SetAttributeValueQueryItem, type SetBibliography, type SetConcept, type SetItem, type SetItemCategory, type SetItemLink, type SetItemProperty, type SetItemSimplifiedProperty, type SetItemsSort, type SetItemsSortDirection, type SetPeriod, type SetResource, type SetSpatialUnit, type SetTree, type SimplifiedProperty, type SpatialUnit, type SpatialUnitItemLink, type Style, type StylesheetCategory, type StylesheetItem, type Text, type TextItemLink, type TopLevelItem, type Tree, type TreeItemCategory, type TreeItemLink, type WebBlock, type WebBlockByLayout, type WebBlockLayout, type WebElement, type WebElementComponent, type WebElementComponentName, type WebElementComponentOf, type WebElementOf, type WebImage, type WebTitle, type Webpage, type Website, type WebsitePropertyQuery, type WebsitePropertyQueryNode, type WebsiteSegment, type WebsiteType, defineLanguages, fetchGallery, fetchItem, fetchItemLinks, fetchSetItems, fetchSetPropertyValues, fetchWebsite, filterProperties, flattenItemProperties, getLeafPropertyValues, getPropertyByVariableLabel, getPropertyByVariableLabelAndValue, getPropertyByVariableLabelAndValueContent, getPropertyByVariableLabelAndValueContents, getPropertyByVariableLabelAndValues, getPropertyByVariableUuid, getPropertyValueByVariableLabel, getPropertyValueByVariableUuid, getPropertyValueContentByVariableLabel, getPropertyValueContentByVariableUuid, getPropertyValueContentsByVariableUuid, getPropertyValuesByVariableLabel, getPropertyValuesByVariableUuid, getUniqueProperties, getUniquePropertyVariableLabels, withLanguages };