@digitalculture/ochre-sdk 0.7.10 → 0.7.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,656 +1,660 @@
1
- import { Language } from 'iso-639-3';
1
+ import { Language } from "iso-639-3";
2
2
 
3
+ //#region src/types/main.d.ts
4
+ /**
5
+ * Represents the core data structure containing item information and metadata
6
+ */
3
7
  /**
4
8
  * Represents the core data structure containing item information and metadata
5
9
  */
6
10
  type Data<T extends DataCategory> = {
11
+ uuid: string;
12
+ belongsTo: {
7
13
  uuid: string;
8
- belongsTo: {
9
- uuid: string;
10
- abbreviation: string;
11
- };
12
- publicationDateTime: Date;
13
- metadata: Metadata;
14
- item: Tree | Set<T> | Resource | SpatialUnit | Concept | Period | Bibliography | Person | PropertyValue;
14
+ abbreviation: string;
15
+ };
16
+ publicationDateTime: Date;
17
+ metadata: Metadata;
18
+ item: Tree | Set<T> | Resource | SpatialUnit | Concept | Period | Bibliography | Person | PropertyValue;
15
19
  };
16
20
  type DataCategory = "tree" | "set" | "resource" | "spatialUnit" | "concept" | "period" | "bibliography" | "person" | "propertyValue";
17
21
  /**
18
22
  * Basic identification information used across multiple types
19
23
  */
20
24
  type Identification = {
21
- label: string;
22
- abbreviation: string;
25
+ label: string;
26
+ abbreviation: string;
23
27
  };
24
28
  /**
25
29
  * Metadata information for items including project, publisher and language details
26
30
  */
27
31
  type Metadata = {
28
- project: {
29
- identification: Identification & {
30
- website: string | null;
31
- };
32
- } | null;
33
- item: {
34
- identification: Identification;
35
- category: string;
36
- type: string;
37
- maxLength: number | null;
38
- } | null;
39
- dataset: string;
40
- publisher: string;
41
- languages: Array<Language["iso6393"]>;
42
- identifier: string;
43
- description: string;
32
+ project: {
33
+ identification: Identification & {
34
+ website: string | null;
35
+ };
36
+ } | null;
37
+ item: {
38
+ identification: Identification;
39
+ category: string;
40
+ type: string;
41
+ maxLength: number | null;
42
+ } | null;
43
+ dataset: string;
44
+ publisher: string;
45
+ languages: Array<Language["iso6393"]>;
46
+ identifier: string;
47
+ description: string;
44
48
  };
45
49
  /**
46
50
  * Represents a single item in a context hierarchy with its metadata
47
51
  */
48
52
  type ContextItem = {
49
- uuid: string;
50
- publicationDateTime: Date | null;
51
- number: number;
52
- content: string;
53
+ uuid: string;
54
+ publicationDateTime: Date | null;
55
+ number: number;
56
+ content: string;
53
57
  };
54
58
  /**
55
59
  * Represents a node in the context tree containing tree, project and spatial unit information
56
60
  */
57
61
  type ContextNode = {
58
- tree: ContextItem;
59
- project: ContextItem;
60
- spatialUnit: Array<ContextItem>;
62
+ tree: ContextItem;
63
+ project: ContextItem;
64
+ spatialUnit: Array<ContextItem>;
61
65
  };
62
66
  /**
63
67
  * Contains the full context information including nodes and display path
64
68
  */
65
69
  type Context = {
66
- nodes: Array<ContextNode>;
67
- displayPath: string;
70
+ nodes: Array<ContextNode>;
71
+ displayPath: string;
68
72
  };
69
73
  /**
70
74
  * License information for content items
71
75
  */
72
76
  type License = {
73
- content: string;
74
- url: string;
77
+ content: string;
78
+ url: string;
75
79
  };
76
80
  /**
77
81
  * Represents a person (author, creator, etc.) with their identification and metadata
78
82
  */
79
83
  type Person = {
80
- uuid: string;
81
- category: "person";
82
- publicationDateTime: Date | null;
83
- type: string | null;
84
- number: number | null;
85
- context: Context | null;
86
- availability: License | null;
87
- date: Date | null;
88
- identification: Identification | null;
89
- address: {
90
- country: string | null;
91
- city: string | null;
92
- state: string | null;
93
- } | null;
94
- coordinates: Coordinates | null;
95
- content: string | null;
96
- events: Array<Event>;
97
- properties: Array<Property>;
84
+ uuid: string;
85
+ category: "person";
86
+ publicationDateTime: Date | null;
87
+ type: string | null;
88
+ number: number | null;
89
+ context: Context | null;
90
+ availability: License | null;
91
+ date: Date | null;
92
+ identification: Identification | null;
93
+ address: {
94
+ country: string | null;
95
+ city: string | null;
96
+ state: string | null;
97
+ } | null;
98
+ coordinates: Coordinates | null;
99
+ content: string | null;
100
+ events: Array<Event>;
101
+ properties: Array<Property>;
98
102
  };
99
103
  /**
100
104
  * Represents a note with number, title and content
101
105
  */
102
106
  type Note = {
103
- number: number;
104
- title: string | null;
105
- content: string;
107
+ number: number;
108
+ title: string | null;
109
+ content: string;
106
110
  };
107
111
  /**
108
112
  * Represents an image with its metadata and content
109
113
  */
110
114
  type Image = {
111
- publicationDateTime: Date | null;
112
- identification: Identification | null;
113
- url: string | null;
114
- htmlPrefix: string | null;
115
- content: string | null;
116
- widthPreview: number | null;
117
- heightPreview: number | null;
118
- width: number | null;
119
- height: number | null;
115
+ publicationDateTime: Date | null;
116
+ identification: Identification | null;
117
+ url: string | null;
118
+ htmlPrefix: string | null;
119
+ content: string | null;
120
+ widthPreview: number | null;
121
+ heightPreview: number | null;
122
+ width: number | null;
123
+ height: number | null;
120
124
  };
121
125
  /**
122
126
  * Represents a link to another item with optional image and bibliographic references
123
127
  */
124
128
  type Link = {
125
- uuid: string;
126
- publicationDateTime: Date | null;
127
- type: string | null;
128
- category: string | null;
129
- identification: Identification | null;
130
- content: string | null;
131
- href: string | null;
132
- image: {
133
- isInline: boolean;
134
- isPrimary: boolean;
135
- heightPreview: number;
136
- widthPreview: number;
137
- height: number;
138
- width: number;
139
- } | null;
140
- bibliographies: Array<Bibliography> | null;
129
+ uuid: string;
130
+ publicationDateTime: Date | null;
131
+ type: string | null;
132
+ category: string | null;
133
+ identification: Identification | null;
134
+ content: string | null;
135
+ href: string | null;
136
+ image: {
137
+ isInline: boolean;
138
+ isPrimary: boolean;
139
+ heightPreview: number;
140
+ widthPreview: number;
141
+ height: number;
142
+ width: number;
143
+ } | null;
144
+ bibliographies: Array<Bibliography> | null;
141
145
  };
142
146
  /**
143
147
  * Represents a clickable/interactive area on an image map
144
148
  */
145
149
  type ImageMapArea = {
146
- uuid: string;
147
- publicationDateTime: Date | null;
148
- type: string;
149
- title: string;
150
- shape: "rectangle" | "polygon";
151
- coords: Array<number>;
150
+ uuid: string;
151
+ publicationDateTime: Date | null;
152
+ type: string;
153
+ title: string;
154
+ shape: "rectangle" | "polygon";
155
+ coords: Array<number>;
152
156
  };
153
157
  /**
154
158
  * Contains image map areas and dimensions
155
159
  */
156
160
  type ImageMap = {
157
- area: Array<ImageMapArea>;
158
- width: number;
159
- height: number;
161
+ area: Array<ImageMapArea>;
162
+ width: number;
163
+ height: number;
160
164
  };
161
165
  /**
162
166
  * Geographic coordinates with optional type and label
163
167
  */
164
168
  type Coordinates = {
165
- latitude: number;
166
- longitude: number;
167
- type: string | null;
168
- label: string | null;
169
+ latitude: number;
170
+ longitude: number;
171
+ type: string | null;
172
+ label: string | null;
169
173
  };
170
174
  /**
171
175
  * Represents an observation with notes, links and properties
172
176
  */
173
177
  type Observation = {
174
- number: number;
175
- date: Date | null;
176
- observers: Array<string>;
177
- notes: Array<Note>;
178
- links: Array<Link>;
179
- properties: Array<Property>;
178
+ number: number;
179
+ date: Date | null;
180
+ observers: Array<string>;
181
+ notes: Array<Note>;
182
+ links: Array<Link>;
183
+ properties: Array<Property>;
180
184
  };
181
185
  /**
182
186
  * Represents an event with date, label and optional agent
183
187
  */
184
188
  type Event = {
185
- date: Date | null;
186
- label: string;
187
- agent: {
188
- uuid: string;
189
- content: string;
190
- } | null;
189
+ date: Date | null;
190
+ label: string;
191
+ agent: {
192
+ uuid: string;
193
+ content: string;
194
+ } | null;
191
195
  };
192
196
  /**
193
197
  * Represents an interpretation with date and properties
194
198
  */
195
199
  type Interpretation = {
196
- date: Date | null;
197
- number: number;
198
- properties: Array<Property>;
200
+ date: Date | null;
201
+ number: number;
202
+ properties: Array<Property>;
199
203
  };
200
204
  /**
201
205
  * Represents a document with content and footnotes
202
206
  */
203
207
  type Document = {
204
- content: string;
205
- footnotes: Array<Footnote>;
208
+ content: string;
209
+ footnotes: Array<Footnote>;
206
210
  };
207
211
  /**
208
212
  * Represents a footnote in a document
209
213
  */
210
214
  type Footnote = {
211
- uuid: string;
212
- label: string;
213
- content: string;
215
+ uuid: string;
216
+ label: string;
217
+ content: string;
214
218
  };
215
219
  /**
216
220
  * Represents a resource item with associated metadata, content and relationships
217
221
  */
218
222
  type Resource = {
219
- uuid: string;
220
- category: "resource";
221
- publicationDateTime: Date | null;
222
- type: string;
223
- number: number;
224
- context: Context | null;
225
- license: License | null;
226
- copyright: string | null;
227
- identification: Identification;
228
- date: Date | null;
229
- image: Image | null;
230
- creators: Array<Person>;
231
- notes: Array<Note>;
232
- description: string;
233
- document: Document | null;
234
- href: string | null;
235
- imageMap: ImageMap | null;
236
- periods: Array<Period>;
237
- format: string | null;
238
- links: Array<Link>;
239
- reverseLinks: Array<Link>;
240
- properties: Array<Property>;
241
- citedBibliographies: Array<Bibliography>;
242
- resources: Array<Resource>;
223
+ uuid: string;
224
+ category: "resource";
225
+ publicationDateTime: Date | null;
226
+ type: string;
227
+ number: number;
228
+ context: Context | null;
229
+ license: License | null;
230
+ copyright: string | null;
231
+ identification: Identification;
232
+ date: Date | null;
233
+ image: Image | null;
234
+ creators: Array<Person>;
235
+ notes: Array<Note>;
236
+ description: string;
237
+ document: Document | null;
238
+ href: string | null;
239
+ imageMap: ImageMap | null;
240
+ periods: Array<Period>;
241
+ format: string | null;
242
+ links: Array<Link>;
243
+ reverseLinks: Array<Link>;
244
+ properties: Array<Property>;
245
+ citedBibliographies: Array<Bibliography>;
246
+ resources: Array<Resource>;
243
247
  };
244
248
  /**
245
249
  * Represents a spatial unit with geographic coordinates and observations
246
250
  */
247
251
  type SpatialUnit = {
248
- uuid: string;
249
- category: "spatialUnit";
250
- publicationDateTime: Date | null;
251
- type: string;
252
- number: number;
253
- context: Context | null;
254
- license: License | null;
255
- identification: Identification;
256
- image: Image | null;
257
- description: string | null;
258
- coordinates: Coordinates | null;
259
- observations: Array<Observation>;
260
- events: Array<Event>;
261
- properties: Array<Property>;
252
+ uuid: string;
253
+ category: "spatialUnit";
254
+ publicationDateTime: Date | null;
255
+ type: string;
256
+ number: number;
257
+ context: Context | null;
258
+ license: License | null;
259
+ identification: Identification;
260
+ image: Image | null;
261
+ description: string | null;
262
+ coordinates: Coordinates | null;
263
+ observations: Array<Observation>;
264
+ events: Array<Event>;
265
+ properties: Array<Property>;
262
266
  };
263
267
  /**
264
268
  * Represents a concept with associated interpretations
265
269
  */
266
270
  type Concept = {
267
- uuid: string;
268
- category: "concept";
269
- publicationDateTime: Date | null;
270
- number: number;
271
- license: License | null;
272
- context: Context | null;
273
- identification: Identification;
274
- interpretations: Array<Interpretation>;
271
+ uuid: string;
272
+ category: "concept";
273
+ publicationDateTime: Date | null;
274
+ number: number;
275
+ license: License | null;
276
+ context: Context | null;
277
+ identification: Identification;
278
+ interpretations: Array<Interpretation>;
275
279
  };
276
280
  /**
277
281
  * Represents a set that can contain resources, spatial units and concepts
278
282
  */
279
283
  type Set<T extends DataCategory> = {
280
- uuid: string;
281
- category: "set";
282
- itemCategory: T;
283
- publicationDateTime: Date | null;
284
- type: string;
285
- number: number;
286
- date: Date | null;
287
- license: License | null;
288
- identification: Identification;
289
- isSuppressingBlanks: boolean;
290
- description: string;
291
- creators: Array<Person>;
292
- items: T extends "resource" ? Array<Resource> : T extends "spatialUnit" ? Array<SpatialUnit> : T extends "concept" ? Array<Concept> : T extends "period" ? Array<Period> : T extends "bibliography" ? Array<Bibliography> : T extends "person" ? Array<Person> : T extends "propertyValue" ? Array<PropertyValue> : never;
284
+ uuid: string;
285
+ category: "set";
286
+ itemCategory: T;
287
+ publicationDateTime: Date | null;
288
+ type: string;
289
+ number: number;
290
+ date: Date | null;
291
+ license: License | null;
292
+ identification: Identification;
293
+ isSuppressingBlanks: boolean;
294
+ description: string;
295
+ creators: Array<Person>;
296
+ items: T extends "resource" ? Array<Resource> : T extends "spatialUnit" ? Array<SpatialUnit> : T extends "concept" ? Array<Concept> : T extends "period" ? Array<Period> : T extends "bibliography" ? Array<Bibliography> : T extends "person" ? Array<Person> : T extends "propertyValue" ? Array<PropertyValue> : never;
293
297
  };
294
298
  /**
295
299
  * Represents a bibliography entry with citation and publication information
296
300
  */
297
301
  type Bibliography = {
298
- uuid: string;
299
- category: "bibliography";
300
- publicationDateTime: Date | null;
301
- type: string | null;
302
- number: number | null;
303
- identification: Identification | null;
304
- projectIdentification: Identification | null;
305
- context: Context | null;
306
- citation: {
307
- format: string | null;
308
- short: string | null;
309
- long: string | null;
310
- };
311
- publicationInfo: {
312
- publishers: Array<Person>;
313
- startDate: Date | null;
314
- };
315
- entryInfo: {
316
- startIssue: string;
317
- startVolume: string;
318
- } | null;
319
- source: {
320
- resource: Pick<Resource, "uuid" | "publicationDateTime" | "type" | "identification"> | null;
321
- documentUrl: string | null;
322
- };
323
- periods: Array<Period>;
324
- authors: Array<Person>;
325
- properties: Array<Property>;
302
+ uuid: string;
303
+ category: "bibliography";
304
+ publicationDateTime: Date | null;
305
+ type: string | null;
306
+ number: number | null;
307
+ identification: Identification | null;
308
+ projectIdentification: Identification | null;
309
+ context: Context | null;
310
+ citation: {
311
+ format: string | null;
312
+ short: string | null;
313
+ long: string | null;
314
+ };
315
+ publicationInfo: {
316
+ publishers: Array<Person>;
317
+ startDate: Date | null;
318
+ };
319
+ entryInfo: {
320
+ startIssue: string;
321
+ startVolume: string;
322
+ } | null;
323
+ source: {
324
+ resource: Pick<Resource, "uuid" | "publicationDateTime" | "type" | "identification"> | null;
325
+ documentUrl: string | null;
326
+ };
327
+ periods: Array<Period>;
328
+ authors: Array<Person>;
329
+ properties: Array<Property>;
326
330
  };
327
331
  /**
328
332
  * Represents a time period with identification
329
333
  */
330
334
  type Period = {
331
- uuid: string;
332
- category: "period";
333
- publicationDateTime: Date | null;
334
- type: string | null;
335
- number: number | null;
336
- identification: Identification;
337
- description: string | null;
335
+ uuid: string;
336
+ category: "period";
337
+ publicationDateTime: Date | null;
338
+ type: string | null;
339
+ number: number | null;
340
+ identification: Identification;
341
+ description: string | null;
338
342
  };
339
343
  /**
340
344
  * Represents a property value with type information
341
345
  */
342
346
  type PropertyValue = {
343
- uuid: string;
344
- category: "propertyValue";
345
- number: number;
346
- publicationDateTime: Date | null;
347
- context: Context | null;
348
- availability: License | null;
349
- identification: Identification;
350
- date: Date | null;
351
- creators: Array<Person>;
352
- description: string;
353
- notes: Array<Note>;
354
- links: Array<Link>;
347
+ uuid: string;
348
+ category: "propertyValue";
349
+ number: number;
350
+ publicationDateTime: Date | null;
351
+ context: Context | null;
352
+ availability: License | null;
353
+ identification: Identification;
354
+ date: Date | null;
355
+ creators: Array<Person>;
356
+ description: string;
357
+ notes: Array<Note>;
358
+ links: Array<Link>;
355
359
  };
356
360
  type PropertyValueContentType = "string" | "integer" | "decimal" | "boolean" | "date" | "dateTime" | "time" | "coordinate" | "IDREF";
357
361
  /**
358
362
  * Represents a property value with type information
359
363
  */
360
364
  type PropertyValueContent = {
361
- content: string | number | boolean | Date | null;
362
- booleanValue: boolean | null;
363
- isUncertain: boolean;
364
- type: PropertyValueContentType;
365
- category: string;
366
- uuid: string | null;
367
- publicationDateTime: Date | null;
368
- unit: string | null;
365
+ content: string | number | boolean | Date | null;
366
+ booleanValue: boolean | null;
367
+ isUncertain: boolean;
368
+ type: PropertyValueContentType;
369
+ category: string;
370
+ uuid: string | null;
371
+ publicationDateTime: Date | null;
372
+ unit: string | null;
369
373
  };
370
374
  /**
371
375
  * Represents a property with label, values and nested properties
372
376
  */
373
377
  type Property = {
374
- uuid: string;
375
- label: string;
376
- values: Array<PropertyValueContent>;
377
- comment: string | null;
378
- properties: Array<Property>;
378
+ uuid: string;
379
+ label: string;
380
+ values: Array<PropertyValueContent>;
381
+ comment: string | null;
382
+ properties: Array<Property>;
379
383
  };
380
384
  /**
381
385
  * Represents a tree structure containing resources, spatial units and concepts
382
386
  */
383
387
  type Tree = {
384
- uuid: string;
385
- category: "tree";
386
- publicationDateTime: Date | null;
387
- type: string;
388
- number: number;
389
- date: Date | null;
390
- license: License | null;
391
- identification: Identification;
392
- creators: Array<Person>;
393
- items: {
394
- resources: Array<Resource>;
395
- spatialUnits: Array<SpatialUnit>;
396
- concepts: Array<Concept>;
397
- periods: Array<Period>;
398
- bibliographies: Array<Bibliography>;
399
- persons: Array<Person>;
400
- propertyValues: Array<PropertyValue>;
401
- };
402
- properties: Array<Property>;
388
+ uuid: string;
389
+ category: "tree";
390
+ publicationDateTime: Date | null;
391
+ type: string;
392
+ number: number;
393
+ date: Date | null;
394
+ license: License | null;
395
+ identification: Identification;
396
+ creators: Array<Person>;
397
+ items: {
398
+ resources: Array<Resource>;
399
+ spatialUnits: Array<SpatialUnit>;
400
+ concepts: Array<Concept>;
401
+ periods: Array<Period>;
402
+ bibliographies: Array<Bibliography>;
403
+ persons: Array<Person>;
404
+ propertyValues: Array<PropertyValue>;
405
+ };
406
+ properties: Array<Property>;
403
407
  };
404
408
  /**
405
409
  * Represents a gallery with its identification, project identification, resources and max length
406
410
  */
407
411
  type Gallery = {
408
- identification: Identification;
409
- projectIdentification: Identification;
410
- resources: Array<Resource>;
411
- maxLength: number;
412
+ identification: Identification;
413
+ projectIdentification: Identification;
414
+ resources: Array<Resource>;
415
+ maxLength: number;
412
416
  };
413
417
  /**
414
418
  * Represents a website with its properties and elements
415
419
  */
416
420
  type Website = {
417
- uuid: string;
418
- publicationDateTime: Date | null;
419
- identification: Identification;
420
- project: {
421
- name: string;
422
- website: string | null;
421
+ uuid: string;
422
+ publicationDateTime: Date | null;
423
+ identification: Identification;
424
+ project: {
425
+ name: string;
426
+ website: string | null;
427
+ };
428
+ creators: Array<Person>;
429
+ license: License | null;
430
+ pages: Array<Webpage>;
431
+ sidebar: {
432
+ elements: Array<WebElement>;
433
+ title: WebElement["title"];
434
+ layout: "start" | "end";
435
+ mobileLayout: "default" | "inline";
436
+ cssStyles: Array<Style>;
437
+ cssStylesMobile: Array<Style>;
438
+ } | null;
439
+ properties: WebsiteProperties;
440
+ collectionOptions: {
441
+ uuids: Array<string>;
442
+ properties: {
443
+ metadataUuids: Array<string>;
444
+ searchUuids: Array<string>;
445
+ labelUuids: Array<string>;
423
446
  };
424
- creators: Array<Person>;
425
- license: License | null;
426
- pages: Array<Webpage>;
427
- sidebar: {
428
- elements: Array<WebElement>;
429
- title: WebElement["title"];
430
- layout: "start" | "end";
431
- mobileLayout: "default" | "inline";
432
- cssStyles: Array<Style>;
433
- cssStylesMobile: Array<Style>;
434
- } | null;
435
- properties: WebsiteProperties;
436
- collectionOptions: {
437
- uuids: Array<string>;
438
- properties: {
439
- metadataUuids: Array<string>;
440
- searchUuids: Array<string>;
441
- labelUuids: Array<string>;
442
- };
443
- } | null;
447
+ } | null;
444
448
  };
445
449
  /**
446
450
  * Properties for configuring website display and styling
447
451
  */
448
452
  type WebsiteProperties = {
449
- type: "traditional" | "digital-collection" | "plum" | "cedar" | "elm" | "maple" | "oak" | "palm";
450
- privacy: "public" | "password" | "private";
451
- status: "development" | "preview" | "production";
452
- contact: {
453
- name: string;
454
- email: string | null;
455
- } | null;
456
- isHeaderDisplayed: boolean;
457
- headerVariant: "default" | "floating" | "inline";
458
- headerAlignment: "start" | "center" | "end";
459
- isHeaderProjectDisplayed: boolean;
460
- isFooterDisplayed: boolean;
461
- isSidebarDisplayed: boolean;
462
- supportsThemeToggle: boolean;
463
- logoUrl: string | null;
453
+ type: "traditional" | "digital-collection" | "plum" | "cedar" | "elm" | "maple" | "oak" | "palm";
454
+ privacy: "public" | "password" | "private";
455
+ status: "development" | "preview" | "production";
456
+ contact: {
457
+ name: string;
458
+ email: string | null;
459
+ } | null;
460
+ isHeaderDisplayed: boolean;
461
+ headerVariant: "default" | "floating" | "inline";
462
+ headerAlignment: "start" | "center" | "end";
463
+ isHeaderProjectDisplayed: boolean;
464
+ isFooterDisplayed: boolean;
465
+ isSidebarDisplayed: boolean;
466
+ supportsThemeToggle: boolean;
467
+ logoUrl: string | null;
464
468
  };
465
469
  type Webpage = {
466
- title: string;
467
- slug: string;
468
- properties: WebpageProperties;
469
- items: Array<WebElement | WebBlock>;
470
- webpages: Array<Webpage>;
470
+ title: string;
471
+ slug: string;
472
+ properties: WebpageProperties;
473
+ items: Array<WebElement | WebBlock>;
474
+ webpages: Array<Webpage>;
471
475
  };
472
476
  /**
473
477
  * Properties for configuring webpage display and styling
474
478
  */
475
479
  type WebpageProperties = {
476
- displayedInHeader: boolean;
477
- width: "full" | "large" | "narrow" | "default";
478
- variant: "default" | "no-background";
479
- backgroundImageUrl: string | null;
480
- isSidebarDisplayed: boolean;
481
- cssStyles: Array<Style>;
482
- cssStylesMobile: Array<Style>;
480
+ displayedInHeader: boolean;
481
+ width: "full" | "large" | "narrow" | "default";
482
+ variant: "default" | "no-background";
483
+ backgroundImageUrl: string | null;
484
+ isSidebarDisplayed: boolean;
485
+ cssStyles: Array<Style>;
486
+ cssStylesMobile: Array<Style>;
483
487
  };
484
488
  /**
485
489
  * Base properties for web elements
486
490
  */
487
491
  type WebElement = {
488
- uuid: string;
489
- type: "element";
490
- title: {
491
- label: string;
492
- variant: "default" | "simple";
493
- properties: {
494
- isNameDisplayed: boolean;
495
- isDescriptionDisplayed: boolean;
496
- isDateDisplayed: boolean;
497
- isCreatorsDisplayed: boolean;
498
- };
492
+ uuid: string;
493
+ type: "element";
494
+ title: {
495
+ label: string;
496
+ variant: "default" | "simple";
497
+ properties: {
498
+ isNameDisplayed: boolean;
499
+ isDescriptionDisplayed: boolean;
500
+ isDateDisplayed: boolean;
501
+ isCreatorsDisplayed: boolean;
499
502
  };
500
- isDisplayedInBlockSectionSidebar: boolean;
501
- cssStyles: Array<Style>;
502
- cssStylesMobile: Array<Style>;
503
+ };
504
+ isDisplayedInBlockSectionSidebar: boolean;
505
+ cssStyles: Array<Style>;
506
+ cssStylesMobile: Array<Style>;
503
507
  } & WebElementComponent;
504
508
  /**
505
509
  * Union type of all possible web element components
506
510
  */
507
511
  type WebElementComponent = {
508
- component: "annotated-document";
509
- document: Document;
512
+ component: "annotated-document";
513
+ document: Document;
510
514
  } | {
511
- component: "annotated-image";
512
- imageUuid: string;
513
- isSearchable: boolean;
515
+ component: "annotated-image";
516
+ imageUuid: string;
517
+ isSearchable: boolean;
514
518
  } | {
515
- component: "bibliography";
516
- bibliographies: Array<Bibliography>;
517
- layout: "long" | "short";
519
+ component: "bibliography";
520
+ bibliographies: Array<Bibliography>;
521
+ layout: "long" | "short";
518
522
  } | {
519
- component: "entries";
520
- entriesId: string;
521
- variant: "entry" | "item";
522
- isSearchable: boolean;
523
+ component: "entries";
524
+ entriesId: string;
525
+ variant: "entry" | "item";
526
+ isSearchable: boolean;
523
527
  } | {
524
- component: "button";
525
- variant: "default" | "transparent";
526
- href: string;
527
- isExternal: boolean;
528
- label: string;
529
- icon: string | null;
528
+ component: "button";
529
+ variant: "default" | "transparent";
530
+ href: string;
531
+ isExternal: boolean;
532
+ label: string;
533
+ icon: string | null;
530
534
  } | {
531
- component: "collection";
532
- collectionId: string;
533
- variant: "full" | "highlights";
534
- itemVariant: "default" | "card";
535
- isSearchable: boolean;
536
- showCount: boolean;
537
- layout: "image-top" | "image-bottom" | "image-start" | "image-end";
535
+ component: "collection";
536
+ collectionId: string;
537
+ variant: "full" | "highlights";
538
+ itemVariant: "default" | "card";
539
+ isSearchable: boolean;
540
+ showCount: boolean;
541
+ layout: "image-top" | "image-bottom" | "image-start" | "image-end";
538
542
  } | {
539
- component: "empty-space";
540
- height: string | null;
541
- width: string | null;
543
+ component: "empty-space";
544
+ height: string | null;
545
+ width: string | null;
542
546
  } | {
543
- component: "filter-categories";
544
- filterId: string;
547
+ component: "filter-categories";
548
+ filterId: string;
545
549
  } | {
546
- component: "iframe";
547
- href: string;
548
- height: string | null;
549
- width: string | null;
550
+ component: "iframe";
551
+ href: string;
552
+ height: string | null;
553
+ width: string | null;
550
554
  } | {
551
- component: "iiif-viewer";
552
- IIIFId: string;
555
+ component: "iiif-viewer";
556
+ IIIFId: string;
553
557
  } | {
554
- component: "image";
555
- images: Array<WebImage>;
556
- variant: "default" | "carousel";
557
- width: number | null;
558
- height: number | null;
559
- isFullWidth: boolean;
560
- isFullHeight: boolean;
561
- imageQuality: "high" | "low";
562
- captionSource: "name" | "abbreviation" | "description";
563
- captionLayout: "top" | "bottom" | "inset" | "suppress";
564
- altTextSource: "name" | "abbreviation" | "description";
565
- isTransparentBackground: boolean;
566
- isCover: boolean;
567
- carouselOptions: {
568
- secondsPerImage: number;
569
- } | null;
558
+ component: "image";
559
+ images: Array<WebImage>;
560
+ variant: "default" | "carousel";
561
+ width: number | null;
562
+ height: number | null;
563
+ isFullWidth: boolean;
564
+ isFullHeight: boolean;
565
+ imageQuality: "high" | "low";
566
+ captionSource: "name" | "abbreviation" | "description";
567
+ captionLayout: "top" | "bottom" | "inset" | "suppress";
568
+ altTextSource: "name" | "abbreviation" | "description";
569
+ isTransparentBackground: boolean;
570
+ isCover: boolean;
571
+ carouselOptions: {
572
+ secondsPerImage: number;
573
+ } | null;
570
574
  } | {
571
- component: "image-gallery";
572
- galleryId: string;
573
- isSearchable: boolean;
575
+ component: "image-gallery";
576
+ galleryId: string;
577
+ isSearchable: boolean;
574
578
  } | {
575
- component: "n-columns";
576
- columns: Array<WebElement>;
579
+ component: "n-columns";
580
+ columns: Array<WebElement>;
577
581
  } | {
578
- component: "n-rows";
579
- rows: Array<WebElement>;
582
+ component: "n-rows";
583
+ rows: Array<WebElement>;
580
584
  } | {
581
- component: "network-graph";
585
+ component: "network-graph";
582
586
  } | {
583
- component: "search-bar";
584
- variant: "default" | "full";
587
+ component: "search-bar";
588
+ variant: "default" | "full";
585
589
  } | {
586
- component: "table";
587
- tableId: string;
590
+ component: "table";
591
+ tableId: string;
588
592
  } | {
589
- component: "text";
590
- variant: "title" | "block" | "banner";
591
- heading: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
592
- content: string;
593
+ component: "text";
594
+ variant: "title" | "block" | "banner";
595
+ heading: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
596
+ content: string;
593
597
  } | {
594
- component: "timeline";
595
- timelineId: string;
598
+ component: "timeline";
599
+ timelineId: string;
596
600
  } | {
597
- component: "video";
598
- isChaptersDislayed: boolean;
601
+ component: "video";
602
+ isChaptersDislayed: boolean;
599
603
  };
600
604
  /**
601
605
  * Represents an image used in web elements
602
606
  */
603
607
  type WebImage = {
604
- url: string;
605
- label: string | null;
606
- width: number;
607
- height: number;
608
+ url: string;
609
+ label: string | null;
610
+ width: number;
611
+ height: number;
608
612
  };
609
613
  /**
610
614
  * Represents a CSS style with label and value
611
615
  */
612
616
  type Style = {
613
- label: string;
614
- value: string;
617
+ label: string;
618
+ value: string;
615
619
  };
616
620
  /**
617
621
  * Represents a block of vertical or horizontal content alignment
618
622
  */
619
623
  type WebBlock = {
620
- uuid: string;
621
- type: "block";
622
- layout: "vertical" | "horizontal" | "grid";
623
- items: Array<WebElement | WebBlock>;
624
- properties: {
625
- /**
626
- * valid `gridTemplateColumns` or `gridTemplateRows` CSS property value
627
- */
628
- spacing: string | undefined;
629
- /**
630
- * `gap` CSS property value
631
- */
632
- gap: string | undefined;
633
- /**
634
- * `align-items` CSS property value
635
- */
636
- alignItems: "stretch" | "start" | "center" | "end" | "space-between";
637
- /**
638
- * `justify-content` CSS property value
639
- */
640
- justifyContent: "stretch" | "start" | "center" | "end" | "space-between";
641
- sectionSidebarItems: Array<WebSectionSidebarItem> | null;
642
- };
643
- propertiesMobile: Record<string, string> | null;
644
- cssStyles: Array<Style>;
645
- cssStylesMobile: Array<Style>;
624
+ uuid: string;
625
+ type: "block";
626
+ layout: "vertical" | "horizontal" | "grid";
627
+ items: Array<WebElement | WebBlock>;
628
+ properties: {
629
+ /**
630
+ * valid `gridTemplateColumns` or `gridTemplateRows` CSS property value
631
+ */
632
+ spacing: string | undefined;
633
+ /**
634
+ * `gap` CSS property value
635
+ */
636
+ gap: string | undefined;
637
+ /**
638
+ * `align-items` CSS property value
639
+ */
640
+ alignItems: "stretch" | "start" | "center" | "end" | "space-between";
641
+ /**
642
+ * `justify-content` CSS property value
643
+ */
644
+ justifyContent: "stretch" | "start" | "center" | "end" | "space-between";
645
+ sectionSidebarItems: Array<WebSectionSidebarItem> | null;
646
+ };
647
+ propertiesMobile: Record<string, string> | null;
648
+ cssStyles: Array<Style>;
649
+ cssStylesMobile: Array<Style>;
646
650
  };
647
651
  type WebSectionSidebarItem = {
648
- uuid: string;
649
- type: "block" | "element";
650
- name: string | null;
651
- items: Array<WebSectionSidebarItem> | null;
652
- };
653
-
652
+ uuid: string;
653
+ type: "block" | "element";
654
+ name: string | null;
655
+ items: Array<WebSectionSidebarItem> | null;
656
+ }; //#endregion
657
+ //#region src/utils/fetchers/gallery.d.ts
654
658
  /**
655
659
  * Fetches and parses a gallery from the OCHRE API
656
660
  *
@@ -678,13 +682,15 @@ type WebSectionSidebarItem = {
678
682
  * - Resources (gallery items)
679
683
  */
680
684
  declare function fetchGallery(uuid: string, filter: string, page: number, perPage: number): Promise<{
681
- item: Gallery | null;
682
- error: null;
685
+ item: Gallery | null;
686
+ error: null;
683
687
  } | {
684
- item: null;
685
- error: string;
688
+ item: null;
689
+ error: string;
686
690
  }>;
687
691
 
692
+ //#endregion
693
+ //#region src/utils/fetchers/item.d.ts
688
694
  /**
689
695
  * Fetches and parses an OCHRE item from the OCHRE API
690
696
  *
@@ -719,27 +725,33 @@ declare function fetchGallery(uuid: string, filter: string, page: number, perPag
719
725
  * If the fetch/parse fails, the returned object will have an `error` property.
720
726
  */
721
727
  declare function fetchItem<T extends DataCategory, U extends DataCategory>(uuid: string, category?: T, setCategory?: T extends "set" ? U : never): Promise<{
722
- error: null;
723
- metadata: Metadata;
724
- belongsTo: {
725
- uuid: string;
726
- abbreviation: string;
727
- };
728
- item: T extends "resource" ? Resource : T extends "spatialUnit" ? SpatialUnit : T extends "concept" ? Concept : T extends "period" ? Period : T extends "bibliography" ? Bibliography : T extends "person" ? Person : T extends "propertyValue" ? PropertyValue : T extends "set" ? Set<U> : T extends "tree" ? Tree : never;
729
- category: T;
728
+ error: null;
729
+ metadata: Metadata;
730
+ belongsTo: {
731
+ uuid: string;
732
+ abbreviation: string;
733
+ };
734
+ item: T extends "resource" ? Resource : T extends "spatialUnit" ? SpatialUnit : T extends "concept" ? Concept : T extends "period" ? Period : T extends "bibliography" ? Bibliography : T extends "person" ? Person : T extends "propertyValue" ? PropertyValue : T extends "set" ? Set<U> : T extends "tree" ? Tree : never;
735
+ category: T;
730
736
  } | {
731
- error: string;
732
- metadata: never;
733
- belongsTo: never;
734
- item: never;
735
- category: never;
737
+ error: string;
738
+ metadata: never;
739
+ belongsTo: never;
740
+ item: never;
741
+ category: never;
736
742
  }>;
737
743
 
744
+ //#endregion
745
+ //#region src/types/internal.raw.d.ts
738
746
  /**
739
747
  * Raw string value that can be a string, number, or boolean
740
748
  */
741
749
  type FakeString = string | number | boolean;
742
750
 
751
+ /**
752
+ * Text rendering options for string content
753
+ */
754
+
743
755
  /**
744
756
  * Raw content item with rendering and whitespace options
745
757
  */
@@ -753,10 +765,7 @@ type OchreStringItemContent = {
753
765
  * Raw string item with language metadata
754
766
  */
755
767
  type OchreStringItem = {
756
- string:
757
- | FakeString
758
- | OchreStringItemContent
759
- | Array<FakeString | OchreStringItemContent>;
768
+ string: FakeString | OchreStringItemContent | Array<FakeString | OchreStringItemContent>;
760
769
  lang?: Language["iso6393"]; // 3 character code (zxx = "a.k.a.")
761
770
  languages?: string; // 3 character codes, semicolon separated
762
771
  };
@@ -791,19 +800,12 @@ type OchreStringRichTextItemAnnotation = {
791
800
  /**
792
801
  * Union type for different rich text item formats
793
802
  */
794
- type OchreStringRichTextItem =
795
- | FakeString
796
- | OchreStringRichTextItemContent
797
- | {
798
- string:
799
- | OchreStringRichTextItemAnnotation
800
- | Array<OchreStringRichTextItemAnnotation>;
801
- whitespace?: string; // "newline" | "trailing" | "leading" (space separated)
802
- }
803
- | {
804
- whitespace: string; // "newline" | "trailing" | "leading" (space separated)
805
- }
806
- | OchreStringRichTextItemAnnotation;
803
+ type OchreStringRichTextItem = FakeString | OchreStringRichTextItemContent | {
804
+ string: OchreStringRichTextItemAnnotation | Array<OchreStringRichTextItemAnnotation>;
805
+ whitespace?: string; // "newline" | "trailing" | "leading" (space separated)
806
+ } | {
807
+ whitespace: string; // "newline" | "trailing" | "leading" (space separated)
808
+ } | OchreStringRichTextItemAnnotation;
807
809
 
808
810
  /**
809
811
  * Container for rich text content with language metadata
@@ -825,19 +827,31 @@ type OchreData = {
825
827
  publicationDateTime: string; // YYYY-MM-DDThh:mm:ssZ
826
828
  metadata: OchreMetadata;
827
829
  languages?: string; // 3 character codes, semicolon separated
828
- } & (
829
- | { tree: OchreTree }
830
- | { set: OchreSet }
831
- | { resource: OchreResource }
832
- | { spatialUnit: OchreSpatialUnit }
833
- | { concept: OchreConcept }
834
- | { period: OchrePeriod }
835
- | { bibliography: OchreBibliography }
836
- | { person: OchrePerson }
837
- | { propertyValue: OchrePropertyValue }
838
- );
830
+ } & ({
831
+ tree: OchreTree;
832
+ } | {
833
+ set: OchreSet;
834
+ } | {
835
+ resource: OchreResource;
836
+ } | {
837
+ spatialUnit: OchreSpatialUnit;
838
+ } | {
839
+ concept: OchreConcept;
840
+ } | {
841
+ period: OchrePeriod;
842
+ } | {
843
+ bibliography: OchreBibliography;
844
+ } | {
845
+ person: OchrePerson;
846
+ } | {
847
+ propertyValue: OchrePropertyValue;
848
+ });
839
849
  };
840
850
 
851
+ /**
852
+ * Raw data response structure from the OCHRE API
853
+ */
854
+
841
855
  /**
842
856
  * Raw metadata structure corresponding to the parsed Metadata type
843
857
  */
@@ -853,10 +867,16 @@ type OchreMetadata = {
853
867
  };
854
868
  publisher: OchreStringContent;
855
869
  dataset: OchreStringContent;
856
- project?: { identification: OchreIdentification };
870
+ project?: {
871
+ identification: OchreIdentification;
872
+ };
857
873
  language?: OchreLanguage | Array<OchreLanguage>;
858
874
  description: OchreStringContent;
859
875
  };
876
+ type OchreTreeCollectionOption = {
877
+ type: "set" | "variable";
878
+ content: string; // UUID
879
+ };
860
880
 
861
881
  /**
862
882
  * Raw tree structure corresponding to the parsed Tree type
@@ -869,30 +889,38 @@ type OchreTree = {
869
889
  availability: OchreLicense;
870
890
  identification: OchreIdentification;
871
891
  date?: string; // YYYY-MM-DD
872
- creators?: { creator: OchrePerson | Array<OchrePerson> };
873
- searchOptions?: {
874
- metadata?: {
875
- option: string | Array<string>; // UUIDs
892
+ creators?: {
893
+ creator: OchrePerson | Array<OchrePerson>;
894
+ };
895
+ collectionOptions?: {
896
+ metadataUuids: {
897
+ uuid?: OchreTreeCollectionOption | Array<OchreTreeCollectionOption>;
876
898
  };
877
- filters?: {
878
- option: string | Array<string>; // UUIDs
899
+ searchUuids: {
900
+ uuid?: OchreTreeCollectionOption | Array<OchreTreeCollectionOption>;
879
901
  };
880
- labels?: {
881
- option: string | Array<string>; // UUIDs
902
+ labelUuids: {
903
+ uuid?: OchreTreeCollectionOption | Array<OchreTreeCollectionOption>;
882
904
  };
883
905
  };
884
- items:
885
- | string
886
- | {
887
- resource: OchreResource | Array<OchreResource>;
888
- }
889
- | { spatialUnit: OchreSpatialUnit | Array<OchreSpatialUnit> }
890
- | { concept: OchreConcept | Array<OchreConcept> }
891
- | { period: OchrePeriod | Array<OchrePeriod> }
892
- | { bibliography: OchreBibliography | Array<OchreBibliography> }
893
- | { person: OchrePerson | Array<OchrePerson> }
894
- | { propertyValue: OchrePropertyValue | Array<OchrePropertyValue> };
895
- properties?: { property: OchreProperty | Array<OchreProperty> };
906
+ items: string | {
907
+ resource: OchreResource | Array<OchreResource>;
908
+ } | {
909
+ spatialUnit: OchreSpatialUnit | Array<OchreSpatialUnit>;
910
+ } | {
911
+ concept: OchreConcept | Array<OchreConcept>;
912
+ } | {
913
+ period: OchrePeriod | Array<OchrePeriod>;
914
+ } | {
915
+ bibliography: OchreBibliography | Array<OchreBibliography>;
916
+ } | {
917
+ person: OchrePerson | Array<OchrePerson>;
918
+ } | {
919
+ propertyValue: OchrePropertyValue | Array<OchrePropertyValue>;
920
+ };
921
+ properties?: {
922
+ property: OchreProperty | Array<OchreProperty>;
923
+ };
896
924
  };
897
925
 
898
926
  /**
@@ -908,16 +936,24 @@ type OchreSet = {
908
936
  date?: string; // YYYY-MM-DD
909
937
  suppressBlanks?: boolean;
910
938
  description?: OchreStringContent | FakeString;
911
- creators?: { creator: OchrePerson | Array<OchrePerson> };
912
- items:
913
- | string
914
- | { resource: OchreResource | Array<OchreResource> }
915
- | { spatialUnit: OchreSpatialUnit | Array<OchreSpatialUnit> }
916
- | { concept: OchreConcept | Array<OchreConcept> }
917
- | { period: OchrePeriod | Array<OchrePeriod> }
918
- | { bibliography: OchreBibliography | Array<OchreBibliography> }
919
- | { person: OchrePerson | Array<OchrePerson> }
920
- | { propertyValue: OchrePropertyValue | Array<OchrePropertyValue> };
939
+ creators?: {
940
+ creator: OchrePerson | Array<OchrePerson>;
941
+ };
942
+ items: string | {
943
+ resource: OchreResource | Array<OchreResource>;
944
+ } | {
945
+ spatialUnit: OchreSpatialUnit | Array<OchreSpatialUnit>;
946
+ } | {
947
+ concept: OchreConcept | Array<OchreConcept>;
948
+ } | {
949
+ period: OchrePeriod | Array<OchrePeriod>;
950
+ } | {
951
+ bibliography: OchreBibliography | Array<OchreBibliography>;
952
+ } | {
953
+ person: OchrePerson | Array<OchrePerson>;
954
+ } | {
955
+ propertyValue: OchrePropertyValue | Array<OchrePropertyValue>;
956
+ };
921
957
  };
922
958
 
923
959
  /**
@@ -938,18 +974,24 @@ type OchreResource = {
938
974
  description?: OchreStringContent | FakeString;
939
975
  date?: string; // YYYY-MM-DD
940
976
  image?: OchreImage;
941
- creators?: { creator: OchrePerson | Array<OchrePerson> };
942
- notes?: { note: OchreNote | Array<OchreNote> };
943
- document?:
944
- | {
945
- content: OchreStringRichText | Array<OchreStringRichText>;
946
- }
947
- | object;
977
+ creators?: {
978
+ creator: OchrePerson | Array<OchrePerson>;
979
+ };
980
+ notes?: {
981
+ note: OchreNote | Array<OchreNote>;
982
+ };
983
+ document?: {
984
+ content: OchreStringRichText | Array<OchreStringRichText>;
985
+ } | object;
948
986
  imagemap?: OchreImageMap;
949
- periods?: { period: OchrePeriod | Array<OchrePeriod> };
987
+ periods?: {
988
+ period: OchrePeriod | Array<OchrePeriod>;
989
+ };
950
990
  links?: OchreLink | Array<OchreLink>;
951
991
  reverseLinks?: OchreLink | Array<OchreLink>;
952
- properties?: { property: OchreProperty | Array<OchreProperty> };
992
+ properties?: {
993
+ property: OchreProperty | Array<OchreProperty>;
994
+ };
953
995
  citedBibliography?: {
954
996
  reference: OchreBibliography | Array<OchreBibliography>;
955
997
  };
@@ -971,10 +1013,16 @@ type OchreSpatialUnit = {
971
1013
  description?: OchreStringContent | FakeString;
972
1014
  coordinate?: string; // "latitude, longitude"
973
1015
  coordinates?: OchreCoordinates;
974
- events?: { event: OchreEvent | Array<OchreEvent> };
975
- observations?: { observation: OchreObservation | Array<OchreObservation> };
1016
+ events?: {
1017
+ event: OchreEvent | Array<OchreEvent>;
1018
+ };
1019
+ observations?: {
1020
+ observation: OchreObservation | Array<OchreObservation>;
1021
+ };
976
1022
  observation?: OchreObservation;
977
- properties?: { property: OchreProperty | Array<OchreProperty> };
1023
+ properties?: {
1024
+ property: OchreProperty | Array<OchreProperty>;
1025
+ };
978
1026
  };
979
1027
 
980
1028
  /**
@@ -1011,11 +1059,10 @@ type OchrePropertyValueContent = {
1011
1059
  * Raw property structure corresponding to the parsed Property type
1012
1060
  */
1013
1061
  type OchreProperty = {
1014
- label: OchreStringContent & { uuid: string };
1015
- value?:
1016
- | OchrePropertyValueContent
1017
- | Array<OchrePropertyValueContent>
1018
- | FakeString;
1062
+ label: OchreStringContent & {
1063
+ uuid: string;
1064
+ };
1065
+ value?: OchrePropertyValueContent | Array<OchrePropertyValueContent> | FakeString;
1019
1066
  comment?: FakeString;
1020
1067
  property?: OchreProperty | Array<OchreProperty>;
1021
1068
  };
@@ -1039,7 +1086,10 @@ type OchreIdentification = {
1039
1086
  * Raw license structure corresponding to the parsed License type
1040
1087
  */
1041
1088
  type OchreLicense = {
1042
- license: { content: string; target: string } | string;
1089
+ license: {
1090
+ content: string;
1091
+ target: string;
1092
+ } | string;
1043
1093
  };
1044
1094
 
1045
1095
  /**
@@ -1071,16 +1121,25 @@ type OchreLinkItem = {
1071
1121
  /**
1072
1122
  * Raw link structure corresponding to the parsed Link type
1073
1123
  */
1074
- type OchreLink =
1075
- | { resource: OchreLinkItem | Array<OchreLinkItem> }
1076
- | { spatialUnit: OchreLinkItem | Array<OchreLinkItem> }
1077
- | { concept: OchreLinkItem | Array<OchreLinkItem> }
1078
- | { set: OchreLinkItem | Array<OchreLinkItem> }
1079
- | { tree: OchreLinkItem | Array<OchreLinkItem> }
1080
- | { person: OchreLinkItem | Array<OchreLinkItem> }
1081
- | { epigraphicUnit: OchreLinkItem | Array<OchreLinkItem> }
1082
- | { bibliography: OchreBibliography | Array<OchreBibliography> }
1083
- | { propertyValue: OchreLinkItem | Array<OchreLinkItem> };
1124
+ type OchreLink = {
1125
+ resource: OchreLinkItem | Array<OchreLinkItem>;
1126
+ } | {
1127
+ spatialUnit: OchreLinkItem | Array<OchreLinkItem>;
1128
+ } | {
1129
+ concept: OchreLinkItem | Array<OchreLinkItem>;
1130
+ } | {
1131
+ set: OchreLinkItem | Array<OchreLinkItem>;
1132
+ } | {
1133
+ tree: OchreLinkItem | Array<OchreLinkItem>;
1134
+ } | {
1135
+ person: OchreLinkItem | Array<OchreLinkItem>;
1136
+ } | {
1137
+ epigraphicUnit: OchreLinkItem | Array<OchreLinkItem>;
1138
+ } | {
1139
+ bibliography: OchreBibliography | Array<OchreBibliography>;
1140
+ } | {
1141
+ propertyValue: OchreLinkItem | Array<OchreLinkItem>;
1142
+ };
1084
1143
 
1085
1144
  /**
1086
1145
  * Raw image structure corresponding to the parsed Image type
@@ -1106,14 +1165,20 @@ type OchreBibliography = {
1106
1165
  type?: string;
1107
1166
  n?: number;
1108
1167
  identification?: OchreIdentification;
1109
- project?: { identification: OchreIdentification };
1168
+ project?: {
1169
+ identification: OchreIdentification;
1170
+ };
1110
1171
  context?: OchreContext;
1111
1172
  sourceDocument?: {
1112
1173
  uuid: string;
1113
1174
  content: FakeString;
1114
1175
  };
1115
1176
  publicationInfo?: {
1116
- publishers?: { publishers: { person: OchrePerson | Array<OchrePerson> } };
1177
+ publishers?: {
1178
+ publishers: {
1179
+ person: OchrePerson | Array<OchrePerson>;
1180
+ };
1181
+ };
1117
1182
  startDate?: {
1118
1183
  month: number;
1119
1184
  year: number;
@@ -1125,58 +1190,55 @@ type OchreBibliography = {
1125
1190
  startVolume: FakeString;
1126
1191
  };
1127
1192
  citationFormat?: string;
1128
- citationFormatSpan?:
1129
- | {
1130
- span: {
1131
- content: FakeString;
1132
- };
1133
- }
1134
- | {
1135
- "default:span": {
1136
- content: FakeString;
1137
- };
1193
+ citationFormatSpan?: {
1194
+ span: {
1195
+ content: FakeString;
1196
+ };
1197
+ } | {
1198
+ "default:span": {
1199
+ content: FakeString;
1200
+ };
1201
+ };
1202
+ referenceFormatDiv?: {
1203
+ div: {
1204
+ div: {
1205
+ class: string;
1206
+ content: FakeString;
1138
1207
  };
1139
- referenceFormatDiv?:
1140
- | {
1141
- div: {
1142
- div: {
1143
- class: string;
1144
- content: FakeString;
1145
- };
1146
- style: string;
1147
- class: string;
1148
- };
1149
- }
1150
- | {
1151
- "default:div": {
1152
- "default:div": {
1153
- class: string;
1154
- content: FakeString;
1155
- };
1156
- style: string;
1157
- class: string;
1158
- };
1208
+ style: string;
1209
+ class: string;
1210
+ };
1211
+ } | {
1212
+ "default:div": {
1213
+ "default:div": {
1214
+ class: string;
1215
+ content: FakeString;
1159
1216
  };
1217
+ style: string;
1218
+ class: string;
1219
+ };
1220
+ };
1160
1221
  source?: {
1161
- resource: Pick<
1162
- OchreResource,
1163
- "uuid" | "type" | "publicationDateTime" | "identification"
1164
- >;
1222
+ resource: Pick<OchreResource, "uuid" | "type" | "publicationDateTime" | "identification">;
1223
+ };
1224
+ periods?: {
1225
+ period: OchrePeriod | Array<OchrePeriod>;
1226
+ };
1227
+ authors?: {
1228
+ person: OchrePerson | Array<OchrePerson>;
1229
+ };
1230
+ properties?: {
1231
+ property: OchreProperty | Array<OchreProperty>;
1165
1232
  };
1166
- periods?: { period: OchrePeriod | Array<OchrePeriod> };
1167
- authors?: { person: OchrePerson | Array<OchrePerson> };
1168
- properties?: { property: OchreProperty | Array<OchreProperty> };
1169
1233
  };
1170
1234
 
1171
1235
  /**
1172
1236
  * Raw note structure corresponding to the parsed Note type
1173
1237
  */
1174
- type OchreNote =
1175
- | string
1176
- | {
1177
- noteNo: number;
1178
- content: OchreStringRichText | Array<OchreStringRichText>;
1179
- };
1238
+ type OchreNote = string | {
1239
+ noteNo: number;
1240
+ content: OchreStringRichText | Array<OchreStringRichText>;
1241
+ };
1180
1242
 
1181
1243
  /**
1182
1244
  * Raw period structure corresponding to the parsed Period type
@@ -1258,8 +1320,12 @@ type OchrePerson = {
1258
1320
  };
1259
1321
  coordinates?: OchreCoordinates;
1260
1322
  content?: FakeString | null;
1261
- events?: { event: OchreEvent | Array<OchreEvent> };
1262
- properties?: { property: OchreProperty | Array<OchreProperty> };
1323
+ events?: {
1324
+ event: OchreEvent | Array<OchreEvent>;
1325
+ };
1326
+ properties?: {
1327
+ property: OchreProperty | Array<OchreProperty>;
1328
+ };
1263
1329
  };
1264
1330
 
1265
1331
  /**
@@ -1269,9 +1335,13 @@ type OchreObservation = {
1269
1335
  observationNo: number;
1270
1336
  date?: string; // YYYY-MM-DD
1271
1337
  observers?: FakeString;
1272
- notes?: { note: OchreNote | Array<OchreNote> };
1338
+ notes?: {
1339
+ note: OchreNote | Array<OchreNote>;
1340
+ };
1273
1341
  links?: OchreLink | Array<OchreLink>;
1274
- properties?: { property: OchreProperty | Array<OchreProperty> };
1342
+ properties?: {
1343
+ property: OchreProperty | Array<OchreProperty>;
1344
+ };
1275
1345
  };
1276
1346
 
1277
1347
  /**
@@ -1311,7 +1381,9 @@ type OchreEvent = {
1311
1381
  type OchreInterpretation = {
1312
1382
  date: string; // YYYY-MM-DD
1313
1383
  interpretationNo: number;
1314
- properties?: { property: OchreProperty | Array<OchreProperty> };
1384
+ properties?: {
1385
+ property: OchreProperty | Array<OchreProperty>;
1386
+ };
1315
1387
  };
1316
1388
 
1317
1389
  /**
@@ -1325,12 +1397,21 @@ type OchrePropertyValue = {
1325
1397
  availability?: OchreLicense;
1326
1398
  identification: OchreIdentification;
1327
1399
  date?: string; // YYYY-MM-DD
1328
- creators?: { creator: OchrePerson | Array<OchrePerson> };
1400
+ creators?: {
1401
+ creator: OchrePerson | Array<OchrePerson>;
1402
+ };
1329
1403
  description?: OchreStringContent | FakeString;
1330
- notes?: { note: OchreNote | Array<OchreNote> };
1404
+ notes?: {
1405
+ note: OchreNote | Array<OchreNote>;
1406
+ };
1331
1407
  links?: OchreLink | Array<OchreLink>;
1332
1408
  };
1333
1409
 
1410
+ //#endregion
1411
+ //#region src/utils/fetchers/uuid.d.ts
1412
+ /**
1413
+ * Raw gallery response structure
1414
+ */
1334
1415
  /**
1335
1416
  * Fetches raw OCHRE data by UUID from the OCHRE API
1336
1417
  *
@@ -1351,6 +1432,8 @@ type OchrePropertyValue = {
1351
1432
  */
1352
1433
  declare function fetchByUuid(uuid: string): Promise<[null, OchreData] | [string, null]>;
1353
1434
 
1435
+ //#endregion
1436
+ //#region src/utils/fetchers/website.d.ts
1354
1437
  /**
1355
1438
  * Fetches and parses a website configuration from the OCHRE API
1356
1439
  *
@@ -1382,24 +1465,26 @@ declare function fetchByUuid(uuid: string): Promise<[null, OchreData] | [string,
1382
1465
  */
1383
1466
  declare function fetchWebsite(abbreviation: string): Promise<Website | null>;
1384
1467
 
1468
+ //#endregion
1469
+ //#region src/utils/getters.d.ts
1385
1470
  /**
1386
1471
  * Options for property search operations
1387
1472
  */
1388
1473
  type PropertyOptions = {
1389
- /** Whether to recursively search through nested properties */
1390
- searchNestedProperties: boolean;
1474
+ /** Whether to recursively search through nested properties */
1475
+ includeNestedProperties: boolean;
1391
1476
  };
1392
1477
  /**
1393
1478
  * Finds a property by its label in an array of properties
1394
1479
  *
1395
1480
  * @param properties - Array of properties to search through
1396
1481
  * @param label - The label to search for
1397
- * @param options - Search options, including whether to search nested properties
1482
+ * @param options - Search options, including whether to include nested properties
1398
1483
  * @returns The matching Property object, or null if not found
1399
1484
  *
1400
1485
  * @example
1401
1486
  * ```ts
1402
- * const property = getPropertyByLabel(properties, "author", { searchNestedProperties: true });
1487
+ * const property = getPropertyByLabel(properties, "author", { includeNestedProperties: true });
1403
1488
  * if (property) {
1404
1489
  * console.log(property.values);
1405
1490
  * }
@@ -1411,7 +1496,7 @@ declare function getPropertyByLabel(properties: Array<Property>, label: string,
1411
1496
  *
1412
1497
  * @param properties - Array of properties to search through
1413
1498
  * @param label - The label to search for
1414
- * @param options - Search options, including whether to search nested properties
1499
+ * @param options - Search options, including whether to include nested properties
1415
1500
  * @returns Array of property values as strings, or null if property not found
1416
1501
  *
1417
1502
  * @example
@@ -1430,7 +1515,7 @@ declare function getPropertyValuesByLabel(properties: Array<Property>, label: st
1430
1515
  *
1431
1516
  * @param properties - Array of properties to search through
1432
1517
  * @param label - The label to search for
1433
- * @param options - Search options, including whether to search nested properties
1518
+ * @param options - Search options, including whether to include nested properties
1434
1519
  * @returns The first property value as string, or null if property not found
1435
1520
  *
1436
1521
  * @example
@@ -1443,19 +1528,19 @@ declare function getPropertyValuesByLabel(properties: Array<Property>, label: st
1443
1528
  */
1444
1529
  declare function getPropertyValueByLabel(properties: Array<Property>, label: string, options?: PropertyOptions): string | number | boolean | Date | null;
1445
1530
  /**
1446
- * Gets all unique property labels from an array of properties
1531
+ * Gets all unique properties from an array of properties
1447
1532
  *
1448
- * @param properties - Array of properties to get labels from
1449
- * @param options - Search options, including whether to include nested property labels
1450
- * @returns Array of unique property labels
1533
+ * @param properties - Array of properties to get unique properties from
1534
+ * @param options - Search options, including whether to include nested properties
1535
+ * @returns Array of unique properties
1451
1536
  *
1452
1537
  * @example
1453
1538
  * ```ts
1454
- * const labels = getAllPropertyLabels(properties, { searchNestedProperties: true });
1455
- * console.log(`Available properties: ${labels.join(", ")}`);
1539
+ * const properties = getAllUniqueProperties(properties, { includeNestedProperties: true });
1540
+ * console.log(`Available properties: ${properties.map((p) => p.label).join(", ")}`);
1456
1541
  * ```
1457
1542
  */
1458
- declare function getAllPropertyLabels(properties: Array<Property>, options?: PropertyOptions): Array<string>;
1543
+ declare function getUniqueProperties(properties: Array<Property>, options?: PropertyOptions): Array<Property>;
1459
1544
  /**
1460
1545
  * Filters a property based on a label and value criteria
1461
1546
  *
@@ -1463,7 +1548,7 @@ declare function getAllPropertyLabels(properties: Array<Property>, options?: Pro
1463
1548
  * @param filter - Filter criteria containing label and value to match
1464
1549
  * @param filter.label - The label to filter by
1465
1550
  * @param filter.value - The value to filter by
1466
- * @param options - Search options, including whether to search nested properties
1551
+ * @param options - Search options, including whether to include nested properties
1467
1552
  * @returns True if the property matches the filter criteria, false otherwise
1468
1553
  *
1469
1554
  * @example
@@ -1478,10 +1563,12 @@ declare function getAllPropertyLabels(properties: Array<Property>, options?: Pro
1478
1563
  * ```
1479
1564
  */
1480
1565
  declare function filterProperties(property: Property, filter: {
1481
- label: string;
1482
- value: string | number | boolean | Date;
1566
+ label: string;
1567
+ value: string | number | boolean | Date;
1483
1568
  }, options?: PropertyOptions): boolean;
1484
1569
 
1570
+ //#endregion
1571
+ //#region src/utils/parse.d.ts
1485
1572
  /**
1486
1573
  * Parses raw identification data into the standardized Identification type
1487
1574
  *
@@ -1719,6 +1806,8 @@ declare function parseConcept(concept: OchreConcept): Concept;
1719
1806
  declare function parseConcepts(concepts: Array<OchreConcept>): Array<Concept>;
1720
1807
  declare function parseWebsite(websiteTree: OchreTree, projectName: FakeString, website: FakeString | null): Promise<Website>;
1721
1808
 
1809
+ //#endregion
1810
+ //#region src/utils/string.d.ts
1722
1811
  /**
1723
1812
  * Parses email addresses in a string into HTML links
1724
1813
  *
@@ -1770,4 +1859,5 @@ declare function parseStringDocumentItem(item: OchreStringRichTextItem, footnote
1770
1859
  */
1771
1860
  declare function parseStringContent(content: OchreStringContent, language?: string): string;
1772
1861
 
1773
- export { type Bibliography, type Concept, type Context, type ContextItem, type ContextNode, type Coordinates, type Data, type DataCategory, type Document, type Event, type Footnote, type Gallery, type Identification, type Image, type ImageMap, type ImageMapArea, type Interpretation, type License, type Link, type Metadata, type Note, type Observation, type Period, type Person, type Property, type PropertyValue, type PropertyValueContent, type PropertyValueContentType, type Resource, type Set, type SpatialUnit, type Style, type Tree, type WebBlock, type WebElement, type WebElementComponent, type WebImage, type WebSectionSidebarItem, type Webpage, type WebpageProperties, type Website, type WebsiteProperties, fetchByUuid, fetchGallery, fetchItem, fetchWebsite, filterProperties, getAllPropertyLabels, getPropertyByLabel, getPropertyValueByLabel, getPropertyValuesByLabel, parseBibliographies, parseBibliography, parseConcept, parseConcepts, parseContext, parseCoordinates, parseDocument, parseEmail, parseEvents, parseFakeString, parseIdentification, parseImage, parseImageMap, parseInterpretations, parseLanguages, parseLicense, parseLink, parseLinks, parseMetadata, parseNotes, parseObservation, parseObservations, parsePeriod, parsePeriods, parsePerson, parsePersons, parseProperties, parseProperty, parsePropertyValue, parsePropertyValues, parseResource, parseResources, parseSet, parseSpatialUnit, parseSpatialUnits, parseStringContent, parseStringDocumentItem, parseStringItem, parseTree, parseWebsite };
1862
+ //#endregion
1863
+ export { Bibliography, Concept, Context, ContextItem, ContextNode, Coordinates, Data, DataCategory, Document, Event, Footnote, Gallery, Identification, Image, ImageMap, ImageMapArea, Interpretation, License, Link, Metadata, Note, Observation, Period, Person, Property, PropertyValue, PropertyValueContent, PropertyValueContentType, Resource, Set, SpatialUnit, Style, Tree, WebBlock, WebElement, WebElementComponent, WebImage, WebSectionSidebarItem, Webpage, WebpageProperties, Website, WebsiteProperties, fetchByUuid, fetchGallery, fetchItem, fetchWebsite, filterProperties, getPropertyByLabel, getPropertyValueByLabel, getPropertyValuesByLabel, getUniqueProperties, parseBibliographies, parseBibliography, parseConcept, parseConcepts, parseContext, parseCoordinates, parseDocument, parseEmail, parseEvents, parseFakeString, parseIdentification, parseImage, parseImageMap, parseInterpretations, parseLanguages, parseLicense, parseLink, parseLinks, parseMetadata, parseNotes, parseObservation, parseObservations, parsePeriod, parsePeriods, parsePerson, parsePersons, parseProperties, parseProperty, parsePropertyValue, parsePropertyValues, parseResource, parseResources, parseSet, parseSpatialUnit, parseSpatialUnits, parseStringContent, parseStringDocumentItem, parseStringItem, parseTree, parseWebsite };