@digitalculture/ochre-sdk 0.7.11 → 0.7.13

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,661 @@
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
+ itemUuid: string;
152
+ publicationDateTime: Date | null;
153
+ type: string;
154
+ title: string;
155
+ shape: "rectangle" | "polygon";
156
+ coords: Array<number>;
152
157
  };
153
158
  /**
154
159
  * Contains image map areas and dimensions
155
160
  */
156
161
  type ImageMap = {
157
- area: Array<ImageMapArea>;
158
- width: number;
159
- height: number;
162
+ area: Array<ImageMapArea>;
163
+ width: number;
164
+ height: number;
160
165
  };
161
166
  /**
162
167
  * Geographic coordinates with optional type and label
163
168
  */
164
169
  type Coordinates = {
165
- latitude: number;
166
- longitude: number;
167
- type: string | null;
168
- label: string | null;
170
+ latitude: number;
171
+ longitude: number;
172
+ type: string | null;
173
+ label: string | null;
169
174
  };
170
175
  /**
171
176
  * Represents an observation with notes, links and properties
172
177
  */
173
178
  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>;
179
+ number: number;
180
+ date: Date | null;
181
+ observers: Array<string>;
182
+ notes: Array<Note>;
183
+ links: Array<Link>;
184
+ properties: Array<Property>;
180
185
  };
181
186
  /**
182
187
  * Represents an event with date, label and optional agent
183
188
  */
184
189
  type Event = {
185
- date: Date | null;
186
- label: string;
187
- agent: {
188
- uuid: string;
189
- content: string;
190
- } | null;
190
+ date: Date | null;
191
+ label: string;
192
+ agent: {
193
+ uuid: string;
194
+ content: string;
195
+ } | null;
191
196
  };
192
197
  /**
193
198
  * Represents an interpretation with date and properties
194
199
  */
195
200
  type Interpretation = {
196
- date: Date | null;
197
- number: number;
198
- properties: Array<Property>;
201
+ date: Date | null;
202
+ number: number;
203
+ properties: Array<Property>;
199
204
  };
200
205
  /**
201
206
  * Represents a document with content and footnotes
202
207
  */
203
208
  type Document = {
204
- content: string;
205
- footnotes: Array<Footnote>;
209
+ content: string;
210
+ footnotes: Array<Footnote>;
206
211
  };
207
212
  /**
208
213
  * Represents a footnote in a document
209
214
  */
210
215
  type Footnote = {
211
- uuid: string;
212
- label: string;
213
- content: string;
216
+ uuid: string;
217
+ label: string;
218
+ content: string;
214
219
  };
215
220
  /**
216
221
  * Represents a resource item with associated metadata, content and relationships
217
222
  */
218
223
  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>;
224
+ uuid: string;
225
+ category: "resource";
226
+ publicationDateTime: Date | null;
227
+ type: string;
228
+ number: number;
229
+ context: Context | null;
230
+ license: License | null;
231
+ copyright: string | null;
232
+ identification: Identification;
233
+ date: Date | null;
234
+ image: Image | null;
235
+ creators: Array<Person>;
236
+ notes: Array<Note>;
237
+ description: string;
238
+ document: Document | null;
239
+ href: string | null;
240
+ imageMap: ImageMap | null;
241
+ periods: Array<Period>;
242
+ format: string | null;
243
+ links: Array<Link>;
244
+ reverseLinks: Array<Link>;
245
+ properties: Array<Property>;
246
+ citedBibliographies: Array<Bibliography>;
247
+ resources: Array<Resource>;
243
248
  };
244
249
  /**
245
250
  * Represents a spatial unit with geographic coordinates and observations
246
251
  */
247
252
  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>;
253
+ uuid: string;
254
+ category: "spatialUnit";
255
+ publicationDateTime: Date | null;
256
+ type: string;
257
+ number: number;
258
+ context: Context | null;
259
+ license: License | null;
260
+ identification: Identification;
261
+ image: Image | null;
262
+ description: string | null;
263
+ coordinates: Coordinates | null;
264
+ observations: Array<Observation>;
265
+ events: Array<Event>;
266
+ properties: Array<Property>;
262
267
  };
263
268
  /**
264
269
  * Represents a concept with associated interpretations
265
270
  */
266
271
  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>;
272
+ uuid: string;
273
+ category: "concept";
274
+ publicationDateTime: Date | null;
275
+ number: number;
276
+ license: License | null;
277
+ context: Context | null;
278
+ identification: Identification;
279
+ interpretations: Array<Interpretation>;
275
280
  };
276
281
  /**
277
282
  * Represents a set that can contain resources, spatial units and concepts
278
283
  */
279
284
  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;
285
+ uuid: string;
286
+ category: "set";
287
+ itemCategory: T;
288
+ publicationDateTime: Date | null;
289
+ type: string;
290
+ number: number;
291
+ date: Date | null;
292
+ license: License | null;
293
+ identification: Identification;
294
+ isSuppressingBlanks: boolean;
295
+ description: string;
296
+ creators: Array<Person>;
297
+ 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
298
  };
294
299
  /**
295
300
  * Represents a bibliography entry with citation and publication information
296
301
  */
297
302
  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>;
303
+ uuid: string;
304
+ category: "bibliography";
305
+ publicationDateTime: Date | null;
306
+ type: string | null;
307
+ number: number | null;
308
+ identification: Identification | null;
309
+ projectIdentification: Identification | null;
310
+ context: Context | null;
311
+ citation: {
312
+ format: string | null;
313
+ short: string | null;
314
+ long: string | null;
315
+ };
316
+ publicationInfo: {
317
+ publishers: Array<Person>;
318
+ startDate: Date | null;
319
+ };
320
+ entryInfo: {
321
+ startIssue: string;
322
+ startVolume: string;
323
+ } | null;
324
+ source: {
325
+ resource: Pick<Resource, "uuid" | "publicationDateTime" | "type" | "identification"> | null;
326
+ documentUrl: string | null;
327
+ };
328
+ periods: Array<Period>;
329
+ authors: Array<Person>;
330
+ properties: Array<Property>;
326
331
  };
327
332
  /**
328
333
  * Represents a time period with identification
329
334
  */
330
335
  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;
336
+ uuid: string;
337
+ category: "period";
338
+ publicationDateTime: Date | null;
339
+ type: string | null;
340
+ number: number | null;
341
+ identification: Identification;
342
+ description: string | null;
338
343
  };
339
344
  /**
340
345
  * Represents a property value with type information
341
346
  */
342
347
  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>;
348
+ uuid: string;
349
+ category: "propertyValue";
350
+ number: number;
351
+ publicationDateTime: Date | null;
352
+ context: Context | null;
353
+ availability: License | null;
354
+ identification: Identification;
355
+ date: Date | null;
356
+ creators: Array<Person>;
357
+ description: string;
358
+ notes: Array<Note>;
359
+ links: Array<Link>;
355
360
  };
356
361
  type PropertyValueContentType = "string" | "integer" | "decimal" | "boolean" | "date" | "dateTime" | "time" | "coordinate" | "IDREF";
357
362
  /**
358
363
  * Represents a property value with type information
359
364
  */
360
365
  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;
366
+ content: string | number | boolean | Date | null;
367
+ booleanValue: boolean | null;
368
+ isUncertain: boolean;
369
+ type: PropertyValueContentType;
370
+ category: string;
371
+ uuid: string | null;
372
+ publicationDateTime: Date | null;
373
+ unit: string | null;
369
374
  };
370
375
  /**
371
376
  * Represents a property with label, values and nested properties
372
377
  */
373
378
  type Property = {
374
- uuid: string;
375
- label: string;
376
- values: Array<PropertyValueContent>;
377
- comment: string | null;
378
- properties: Array<Property>;
379
+ uuid: string;
380
+ label: string;
381
+ values: Array<PropertyValueContent>;
382
+ comment: string | null;
383
+ properties: Array<Property>;
379
384
  };
380
385
  /**
381
386
  * Represents a tree structure containing resources, spatial units and concepts
382
387
  */
383
388
  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>;
389
+ uuid: string;
390
+ category: "tree";
391
+ publicationDateTime: Date | null;
392
+ type: string;
393
+ number: number;
394
+ date: Date | null;
395
+ license: License | null;
396
+ identification: Identification;
397
+ creators: Array<Person>;
398
+ items: {
399
+ resources: Array<Resource>;
400
+ spatialUnits: Array<SpatialUnit>;
401
+ concepts: Array<Concept>;
402
+ periods: Array<Period>;
403
+ bibliographies: Array<Bibliography>;
404
+ persons: Array<Person>;
405
+ propertyValues: Array<PropertyValue>;
406
+ };
407
+ properties: Array<Property>;
403
408
  };
404
409
  /**
405
410
  * Represents a gallery with its identification, project identification, resources and max length
406
411
  */
407
412
  type Gallery = {
408
- identification: Identification;
409
- projectIdentification: Identification;
410
- resources: Array<Resource>;
411
- maxLength: number;
413
+ identification: Identification;
414
+ projectIdentification: Identification;
415
+ resources: Array<Resource>;
416
+ maxLength: number;
412
417
  };
413
418
  /**
414
419
  * Represents a website with its properties and elements
415
420
  */
416
421
  type Website = {
417
- uuid: string;
418
- publicationDateTime: Date | null;
419
- identification: Identification;
420
- project: {
421
- name: string;
422
- website: string | null;
422
+ uuid: string;
423
+ publicationDateTime: Date | null;
424
+ identification: Identification;
425
+ project: {
426
+ name: string;
427
+ website: string | null;
428
+ };
429
+ creators: Array<Person>;
430
+ license: License | null;
431
+ pages: Array<Webpage>;
432
+ sidebar: {
433
+ elements: Array<WebElement>;
434
+ title: WebElement["title"];
435
+ layout: "start" | "end";
436
+ mobileLayout: "default" | "inline";
437
+ cssStyles: Array<Style>;
438
+ cssStylesMobile: Array<Style>;
439
+ } | null;
440
+ properties: WebsiteProperties;
441
+ collectionOptions: {
442
+ uuids: Array<string>;
443
+ properties: {
444
+ metadataUuids: Array<string>;
445
+ searchUuids: Array<string>;
446
+ labelUuids: Array<string>;
423
447
  };
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;
448
+ } | null;
444
449
  };
445
450
  /**
446
451
  * Properties for configuring website display and styling
447
452
  */
448
453
  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;
454
+ type: "traditional" | "digital-collection" | "plum" | "cedar" | "elm" | "maple" | "oak" | "palm";
455
+ privacy: "public" | "password" | "private";
456
+ status: "development" | "preview" | "production";
457
+ contact: {
458
+ name: string;
459
+ email: string | null;
460
+ } | null;
461
+ isHeaderDisplayed: boolean;
462
+ headerVariant: "default" | "floating" | "inline";
463
+ headerAlignment: "start" | "center" | "end";
464
+ isHeaderProjectDisplayed: boolean;
465
+ isFooterDisplayed: boolean;
466
+ isSidebarDisplayed: boolean;
467
+ supportsThemeToggle: boolean;
468
+ logoUrl: string | null;
464
469
  };
465
470
  type Webpage = {
466
- title: string;
467
- slug: string;
468
- properties: WebpageProperties;
469
- items: Array<WebElement | WebBlock>;
470
- webpages: Array<Webpage>;
471
+ title: string;
472
+ slug: string;
473
+ properties: WebpageProperties;
474
+ items: Array<WebElement | WebBlock>;
475
+ webpages: Array<Webpage>;
471
476
  };
472
477
  /**
473
478
  * Properties for configuring webpage display and styling
474
479
  */
475
480
  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>;
481
+ displayedInHeader: boolean;
482
+ width: "full" | "large" | "narrow" | "default";
483
+ variant: "default" | "no-background";
484
+ backgroundImageUrl: string | null;
485
+ isSidebarDisplayed: boolean;
486
+ cssStyles: Array<Style>;
487
+ cssStylesMobile: Array<Style>;
483
488
  };
484
489
  /**
485
490
  * Base properties for web elements
486
491
  */
487
492
  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
- };
493
+ uuid: string;
494
+ type: "element";
495
+ title: {
496
+ label: string;
497
+ variant: "default" | "simple";
498
+ properties: {
499
+ isNameDisplayed: boolean;
500
+ isDescriptionDisplayed: boolean;
501
+ isDateDisplayed: boolean;
502
+ isCreatorsDisplayed: boolean;
499
503
  };
500
- isDisplayedInBlockSectionSidebar: boolean;
501
- cssStyles: Array<Style>;
502
- cssStylesMobile: Array<Style>;
504
+ };
505
+ isDisplayedInBlockSectionSidebar: boolean;
506
+ cssStyles: Array<Style>;
507
+ cssStylesMobile: Array<Style>;
503
508
  } & WebElementComponent;
504
509
  /**
505
510
  * Union type of all possible web element components
506
511
  */
507
512
  type WebElementComponent = {
508
- component: "annotated-document";
509
- document: Document;
513
+ component: "annotated-document";
514
+ document: Document;
510
515
  } | {
511
- component: "annotated-image";
512
- imageUuid: string;
513
- isSearchable: boolean;
516
+ component: "annotated-image";
517
+ imageUuid: string;
518
+ isSearchable: boolean;
514
519
  } | {
515
- component: "bibliography";
516
- bibliographies: Array<Bibliography>;
517
- layout: "long" | "short";
520
+ component: "bibliography";
521
+ bibliographies: Array<Bibliography>;
522
+ layout: "long" | "short";
518
523
  } | {
519
- component: "entries";
520
- entriesId: string;
521
- variant: "entry" | "item";
522
- isSearchable: boolean;
524
+ component: "entries";
525
+ entriesId: string;
526
+ variant: "entry" | "item";
527
+ isSearchable: boolean;
523
528
  } | {
524
- component: "button";
525
- variant: "default" | "transparent";
526
- href: string;
527
- isExternal: boolean;
528
- label: string;
529
- icon: string | null;
529
+ component: "button";
530
+ variant: "default" | "transparent";
531
+ href: string;
532
+ isExternal: boolean;
533
+ label: string;
534
+ icon: string | null;
530
535
  } | {
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";
536
+ component: "collection";
537
+ collectionId: string;
538
+ variant: "full" | "highlights";
539
+ itemVariant: "default" | "card";
540
+ isSearchable: boolean;
541
+ showCount: boolean;
542
+ layout: "image-top" | "image-bottom" | "image-start" | "image-end";
538
543
  } | {
539
- component: "empty-space";
540
- height: string | null;
541
- width: string | null;
544
+ component: "empty-space";
545
+ height: string | null;
546
+ width: string | null;
542
547
  } | {
543
- component: "filter-categories";
544
- filterId: string;
548
+ component: "filter-categories";
549
+ filterId: string;
545
550
  } | {
546
- component: "iframe";
547
- href: string;
548
- height: string | null;
549
- width: string | null;
551
+ component: "iframe";
552
+ href: string;
553
+ height: string | null;
554
+ width: string | null;
550
555
  } | {
551
- component: "iiif-viewer";
552
- IIIFId: string;
556
+ component: "iiif-viewer";
557
+ IIIFId: string;
553
558
  } | {
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;
559
+ component: "image";
560
+ images: Array<WebImage>;
561
+ variant: "default" | "carousel";
562
+ width: number | null;
563
+ height: number | null;
564
+ isFullWidth: boolean;
565
+ isFullHeight: boolean;
566
+ imageQuality: "high" | "low";
567
+ captionSource: "name" | "abbreviation" | "description";
568
+ captionLayout: "top" | "bottom" | "inset" | "suppress";
569
+ altTextSource: "name" | "abbreviation" | "description";
570
+ isTransparentBackground: boolean;
571
+ isCover: boolean;
572
+ carouselOptions: {
573
+ secondsPerImage: number;
574
+ } | null;
570
575
  } | {
571
- component: "image-gallery";
572
- galleryId: string;
573
- isSearchable: boolean;
576
+ component: "image-gallery";
577
+ galleryId: string;
578
+ isSearchable: boolean;
574
579
  } | {
575
- component: "n-columns";
576
- columns: Array<WebElement>;
580
+ component: "n-columns";
581
+ columns: Array<WebElement>;
577
582
  } | {
578
- component: "n-rows";
579
- rows: Array<WebElement>;
583
+ component: "n-rows";
584
+ rows: Array<WebElement>;
580
585
  } | {
581
- component: "network-graph";
586
+ component: "network-graph";
582
587
  } | {
583
- component: "search-bar";
584
- variant: "default" | "full";
588
+ component: "search-bar";
589
+ variant: "default" | "full";
585
590
  } | {
586
- component: "table";
587
- tableId: string;
591
+ component: "table";
592
+ tableId: string;
588
593
  } | {
589
- component: "text";
590
- variant: "title" | "block" | "banner";
591
- heading: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
592
- content: string;
594
+ component: "text";
595
+ variant: "title" | "block" | "banner";
596
+ heading: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
597
+ content: string;
593
598
  } | {
594
- component: "timeline";
595
- timelineId: string;
599
+ component: "timeline";
600
+ timelineId: string;
596
601
  } | {
597
- component: "video";
598
- isChaptersDislayed: boolean;
602
+ component: "video";
603
+ isChaptersDislayed: boolean;
599
604
  };
600
605
  /**
601
606
  * Represents an image used in web elements
602
607
  */
603
608
  type WebImage = {
604
- url: string;
605
- label: string | null;
606
- width: number;
607
- height: number;
609
+ url: string;
610
+ label: string | null;
611
+ width: number;
612
+ height: number;
608
613
  };
609
614
  /**
610
615
  * Represents a CSS style with label and value
611
616
  */
612
617
  type Style = {
613
- label: string;
614
- value: string;
618
+ label: string;
619
+ value: string;
615
620
  };
616
621
  /**
617
622
  * Represents a block of vertical or horizontal content alignment
618
623
  */
619
624
  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>;
625
+ uuid: string;
626
+ type: "block";
627
+ layout: "vertical" | "horizontal" | "grid";
628
+ items: Array<WebElement | WebBlock>;
629
+ properties: {
630
+ /**
631
+ * valid `gridTemplateColumns` or `gridTemplateRows` CSS property value
632
+ */
633
+ spacing: string | undefined;
634
+ /**
635
+ * `gap` CSS property value
636
+ */
637
+ gap: string | undefined;
638
+ /**
639
+ * `align-items` CSS property value
640
+ */
641
+ alignItems: "stretch" | "start" | "center" | "end" | "space-between";
642
+ /**
643
+ * `justify-content` CSS property value
644
+ */
645
+ justifyContent: "stretch" | "start" | "center" | "end" | "space-between";
646
+ sectionSidebarItems: Array<WebSectionSidebarItem> | null;
647
+ };
648
+ propertiesMobile: Record<string, string> | null;
649
+ cssStyles: Array<Style>;
650
+ cssStylesMobile: Array<Style>;
646
651
  };
647
652
  type WebSectionSidebarItem = {
648
- uuid: string;
649
- type: "block" | "element";
650
- name: string | null;
651
- items: Array<WebSectionSidebarItem> | null;
652
- };
653
-
653
+ uuid: string;
654
+ type: "block" | "element";
655
+ name: string | null;
656
+ items: Array<WebSectionSidebarItem> | null;
657
+ }; //#endregion
658
+ //#region src/utils/fetchers/gallery.d.ts
654
659
  /**
655
660
  * Fetches and parses a gallery from the OCHRE API
656
661
  *
@@ -678,13 +683,15 @@ type WebSectionSidebarItem = {
678
683
  * - Resources (gallery items)
679
684
  */
680
685
  declare function fetchGallery(uuid: string, filter: string, page: number, perPage: number): Promise<{
681
- item: Gallery | null;
682
- error: null;
686
+ item: Gallery | null;
687
+ error: null;
683
688
  } | {
684
- item: null;
685
- error: string;
689
+ item: null;
690
+ error: string;
686
691
  }>;
687
692
 
693
+ //#endregion
694
+ //#region src/utils/fetchers/item.d.ts
688
695
  /**
689
696
  * Fetches and parses an OCHRE item from the OCHRE API
690
697
  *
@@ -719,27 +726,33 @@ declare function fetchGallery(uuid: string, filter: string, page: number, perPag
719
726
  * If the fetch/parse fails, the returned object will have an `error` property.
720
727
  */
721
728
  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;
729
+ error: null;
730
+ metadata: Metadata;
731
+ belongsTo: {
732
+ uuid: string;
733
+ abbreviation: string;
734
+ };
735
+ 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;
736
+ category: T;
730
737
  } | {
731
- error: string;
732
- metadata: never;
733
- belongsTo: never;
734
- item: never;
735
- category: never;
738
+ error: string;
739
+ metadata: never;
740
+ belongsTo: never;
741
+ item: never;
742
+ category: never;
736
743
  }>;
737
744
 
745
+ //#endregion
746
+ //#region src/types/internal.raw.d.ts
738
747
  /**
739
748
  * Raw string value that can be a string, number, or boolean
740
749
  */
741
750
  type FakeString = string | number | boolean;
742
751
 
752
+ /**
753
+ * Text rendering options for string content
754
+ */
755
+
743
756
  /**
744
757
  * Raw content item with rendering and whitespace options
745
758
  */
@@ -753,10 +766,7 @@ type OchreStringItemContent = {
753
766
  * Raw string item with language metadata
754
767
  */
755
768
  type OchreStringItem = {
756
- string:
757
- | FakeString
758
- | OchreStringItemContent
759
- | Array<FakeString | OchreStringItemContent>;
769
+ string: FakeString | OchreStringItemContent | Array<FakeString | OchreStringItemContent>;
760
770
  lang?: Language["iso6393"]; // 3 character code (zxx = "a.k.a.")
761
771
  languages?: string; // 3 character codes, semicolon separated
762
772
  };
@@ -791,19 +801,12 @@ type OchreStringRichTextItemAnnotation = {
791
801
  /**
792
802
  * Union type for different rich text item formats
793
803
  */
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;
804
+ type OchreStringRichTextItem = FakeString | OchreStringRichTextItemContent | {
805
+ string: OchreStringRichTextItemAnnotation | Array<OchreStringRichTextItemAnnotation>;
806
+ whitespace?: string; // "newline" | "trailing" | "leading" (space separated)
807
+ } | {
808
+ whitespace: string; // "newline" | "trailing" | "leading" (space separated)
809
+ } | OchreStringRichTextItemAnnotation;
807
810
 
808
811
  /**
809
812
  * Container for rich text content with language metadata
@@ -825,19 +828,31 @@ type OchreData = {
825
828
  publicationDateTime: string; // YYYY-MM-DDThh:mm:ssZ
826
829
  metadata: OchreMetadata;
827
830
  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
- );
831
+ } & ({
832
+ tree: OchreTree;
833
+ } | {
834
+ set: OchreSet;
835
+ } | {
836
+ resource: OchreResource;
837
+ } | {
838
+ spatialUnit: OchreSpatialUnit;
839
+ } | {
840
+ concept: OchreConcept;
841
+ } | {
842
+ period: OchrePeriod;
843
+ } | {
844
+ bibliography: OchreBibliography;
845
+ } | {
846
+ person: OchrePerson;
847
+ } | {
848
+ propertyValue: OchrePropertyValue;
849
+ });
839
850
  };
840
851
 
852
+ /**
853
+ * Raw data response structure from the OCHRE API
854
+ */
855
+
841
856
  /**
842
857
  * Raw metadata structure corresponding to the parsed Metadata type
843
858
  */
@@ -853,10 +868,16 @@ type OchreMetadata = {
853
868
  };
854
869
  publisher: OchreStringContent;
855
870
  dataset: OchreStringContent;
856
- project?: { identification: OchreIdentification };
871
+ project?: {
872
+ identification: OchreIdentification;
873
+ };
857
874
  language?: OchreLanguage | Array<OchreLanguage>;
858
875
  description: OchreStringContent;
859
876
  };
877
+ type OchreTreeCollectionOption = {
878
+ type: "set" | "variable";
879
+ content: string; // UUID
880
+ };
860
881
 
861
882
  /**
862
883
  * Raw tree structure corresponding to the parsed Tree type
@@ -869,30 +890,38 @@ type OchreTree = {
869
890
  availability: OchreLicense;
870
891
  identification: OchreIdentification;
871
892
  date?: string; // YYYY-MM-DD
872
- creators?: { creator: OchrePerson | Array<OchrePerson> };
873
- searchOptions?: {
874
- metadata?: {
875
- option: string | Array<string>; // UUIDs
893
+ creators?: {
894
+ creator: OchrePerson | Array<OchrePerson>;
895
+ };
896
+ collectionOptions?: {
897
+ metadataUuids: {
898
+ uuid?: OchreTreeCollectionOption | Array<OchreTreeCollectionOption>;
876
899
  };
877
- filters?: {
878
- option: string | Array<string>; // UUIDs
900
+ searchUuids: {
901
+ uuid?: OchreTreeCollectionOption | Array<OchreTreeCollectionOption>;
879
902
  };
880
- labels?: {
881
- option: string | Array<string>; // UUIDs
903
+ labelUuids: {
904
+ uuid?: OchreTreeCollectionOption | Array<OchreTreeCollectionOption>;
882
905
  };
883
906
  };
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> };
907
+ items: string | {
908
+ resource: OchreResource | Array<OchreResource>;
909
+ } | {
910
+ spatialUnit: OchreSpatialUnit | Array<OchreSpatialUnit>;
911
+ } | {
912
+ concept: OchreConcept | Array<OchreConcept>;
913
+ } | {
914
+ period: OchrePeriod | Array<OchrePeriod>;
915
+ } | {
916
+ bibliography: OchreBibliography | Array<OchreBibliography>;
917
+ } | {
918
+ person: OchrePerson | Array<OchrePerson>;
919
+ } | {
920
+ propertyValue: OchrePropertyValue | Array<OchrePropertyValue>;
921
+ };
922
+ properties?: {
923
+ property: OchreProperty | Array<OchreProperty>;
924
+ };
896
925
  };
897
926
 
898
927
  /**
@@ -908,16 +937,24 @@ type OchreSet = {
908
937
  date?: string; // YYYY-MM-DD
909
938
  suppressBlanks?: boolean;
910
939
  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> };
940
+ creators?: {
941
+ creator: OchrePerson | Array<OchrePerson>;
942
+ };
943
+ items: string | {
944
+ resource: OchreResource | Array<OchreResource>;
945
+ } | {
946
+ spatialUnit: OchreSpatialUnit | Array<OchreSpatialUnit>;
947
+ } | {
948
+ concept: OchreConcept | Array<OchreConcept>;
949
+ } | {
950
+ period: OchrePeriod | Array<OchrePeriod>;
951
+ } | {
952
+ bibliography: OchreBibliography | Array<OchreBibliography>;
953
+ } | {
954
+ person: OchrePerson | Array<OchrePerson>;
955
+ } | {
956
+ propertyValue: OchrePropertyValue | Array<OchrePropertyValue>;
957
+ };
921
958
  };
922
959
 
923
960
  /**
@@ -938,18 +975,24 @@ type OchreResource = {
938
975
  description?: OchreStringContent | FakeString;
939
976
  date?: string; // YYYY-MM-DD
940
977
  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;
978
+ creators?: {
979
+ creator: OchrePerson | Array<OchrePerson>;
980
+ };
981
+ notes?: {
982
+ note: OchreNote | Array<OchreNote>;
983
+ };
984
+ document?: {
985
+ content: OchreStringRichText | Array<OchreStringRichText>;
986
+ } | object;
948
987
  imagemap?: OchreImageMap;
949
- periods?: { period: OchrePeriod | Array<OchrePeriod> };
988
+ periods?: {
989
+ period: OchrePeriod | Array<OchrePeriod>;
990
+ };
950
991
  links?: OchreLink | Array<OchreLink>;
951
992
  reverseLinks?: OchreLink | Array<OchreLink>;
952
- properties?: { property: OchreProperty | Array<OchreProperty> };
993
+ properties?: {
994
+ property: OchreProperty | Array<OchreProperty>;
995
+ };
953
996
  citedBibliography?: {
954
997
  reference: OchreBibliography | Array<OchreBibliography>;
955
998
  };
@@ -971,10 +1014,16 @@ type OchreSpatialUnit = {
971
1014
  description?: OchreStringContent | FakeString;
972
1015
  coordinate?: string; // "latitude, longitude"
973
1016
  coordinates?: OchreCoordinates;
974
- events?: { event: OchreEvent | Array<OchreEvent> };
975
- observations?: { observation: OchreObservation | Array<OchreObservation> };
1017
+ events?: {
1018
+ event: OchreEvent | Array<OchreEvent>;
1019
+ };
1020
+ observations?: {
1021
+ observation: OchreObservation | Array<OchreObservation>;
1022
+ };
976
1023
  observation?: OchreObservation;
977
- properties?: { property: OchreProperty | Array<OchreProperty> };
1024
+ properties?: {
1025
+ property: OchreProperty | Array<OchreProperty>;
1026
+ };
978
1027
  };
979
1028
 
980
1029
  /**
@@ -1011,11 +1060,10 @@ type OchrePropertyValueContent = {
1011
1060
  * Raw property structure corresponding to the parsed Property type
1012
1061
  */
1013
1062
  type OchreProperty = {
1014
- label: OchreStringContent & { uuid: string };
1015
- value?:
1016
- | OchrePropertyValueContent
1017
- | Array<OchrePropertyValueContent>
1018
- | FakeString;
1063
+ label: OchreStringContent & {
1064
+ uuid: string;
1065
+ };
1066
+ value?: OchrePropertyValueContent | Array<OchrePropertyValueContent> | FakeString;
1019
1067
  comment?: FakeString;
1020
1068
  property?: OchreProperty | Array<OchreProperty>;
1021
1069
  };
@@ -1039,7 +1087,10 @@ type OchreIdentification = {
1039
1087
  * Raw license structure corresponding to the parsed License type
1040
1088
  */
1041
1089
  type OchreLicense = {
1042
- license: { content: string; target: string } | string;
1090
+ license: {
1091
+ content: string;
1092
+ target: string;
1093
+ } | string;
1043
1094
  };
1044
1095
 
1045
1096
  /**
@@ -1071,16 +1122,25 @@ type OchreLinkItem = {
1071
1122
  /**
1072
1123
  * Raw link structure corresponding to the parsed Link type
1073
1124
  */
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> };
1125
+ type OchreLink = {
1126
+ resource: OchreLinkItem | Array<OchreLinkItem>;
1127
+ } | {
1128
+ spatialUnit: OchreLinkItem | Array<OchreLinkItem>;
1129
+ } | {
1130
+ concept: OchreLinkItem | Array<OchreLinkItem>;
1131
+ } | {
1132
+ set: OchreLinkItem | Array<OchreLinkItem>;
1133
+ } | {
1134
+ tree: OchreLinkItem | Array<OchreLinkItem>;
1135
+ } | {
1136
+ person: OchreLinkItem | Array<OchreLinkItem>;
1137
+ } | {
1138
+ epigraphicUnit: OchreLinkItem | Array<OchreLinkItem>;
1139
+ } | {
1140
+ bibliography: OchreBibliography | Array<OchreBibliography>;
1141
+ } | {
1142
+ propertyValue: OchreLinkItem | Array<OchreLinkItem>;
1143
+ };
1084
1144
 
1085
1145
  /**
1086
1146
  * Raw image structure corresponding to the parsed Image type
@@ -1106,14 +1166,20 @@ type OchreBibliography = {
1106
1166
  type?: string;
1107
1167
  n?: number;
1108
1168
  identification?: OchreIdentification;
1109
- project?: { identification: OchreIdentification };
1169
+ project?: {
1170
+ identification: OchreIdentification;
1171
+ };
1110
1172
  context?: OchreContext;
1111
1173
  sourceDocument?: {
1112
1174
  uuid: string;
1113
1175
  content: FakeString;
1114
1176
  };
1115
1177
  publicationInfo?: {
1116
- publishers?: { publishers: { person: OchrePerson | Array<OchrePerson> } };
1178
+ publishers?: {
1179
+ publishers: {
1180
+ person: OchrePerson | Array<OchrePerson>;
1181
+ };
1182
+ };
1117
1183
  startDate?: {
1118
1184
  month: number;
1119
1185
  year: number;
@@ -1125,58 +1191,55 @@ type OchreBibliography = {
1125
1191
  startVolume: FakeString;
1126
1192
  };
1127
1193
  citationFormat?: string;
1128
- citationFormatSpan?:
1129
- | {
1130
- span: {
1131
- content: FakeString;
1132
- };
1133
- }
1134
- | {
1135
- "default:span": {
1136
- content: FakeString;
1137
- };
1194
+ citationFormatSpan?: {
1195
+ span: {
1196
+ content: FakeString;
1197
+ };
1198
+ } | {
1199
+ "default:span": {
1200
+ content: FakeString;
1201
+ };
1202
+ };
1203
+ referenceFormatDiv?: {
1204
+ div: {
1205
+ div: {
1206
+ class: string;
1207
+ content: FakeString;
1138
1208
  };
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
- };
1209
+ style: string;
1210
+ class: string;
1211
+ };
1212
+ } | {
1213
+ "default:div": {
1214
+ "default:div": {
1215
+ class: string;
1216
+ content: FakeString;
1159
1217
  };
1218
+ style: string;
1219
+ class: string;
1220
+ };
1221
+ };
1160
1222
  source?: {
1161
- resource: Pick<
1162
- OchreResource,
1163
- "uuid" | "type" | "publicationDateTime" | "identification"
1164
- >;
1223
+ resource: Pick<OchreResource, "uuid" | "type" | "publicationDateTime" | "identification">;
1224
+ };
1225
+ periods?: {
1226
+ period: OchrePeriod | Array<OchrePeriod>;
1227
+ };
1228
+ authors?: {
1229
+ person: OchrePerson | Array<OchrePerson>;
1230
+ };
1231
+ properties?: {
1232
+ property: OchreProperty | Array<OchreProperty>;
1165
1233
  };
1166
- periods?: { period: OchrePeriod | Array<OchrePeriod> };
1167
- authors?: { person: OchrePerson | Array<OchrePerson> };
1168
- properties?: { property: OchreProperty | Array<OchreProperty> };
1169
1234
  };
1170
1235
 
1171
1236
  /**
1172
1237
  * Raw note structure corresponding to the parsed Note type
1173
1238
  */
1174
- type OchreNote =
1175
- | string
1176
- | {
1177
- noteNo: number;
1178
- content: OchreStringRichText | Array<OchreStringRichText>;
1179
- };
1239
+ type OchreNote = string | {
1240
+ noteNo: number;
1241
+ content: OchreStringRichText | Array<OchreStringRichText>;
1242
+ };
1180
1243
 
1181
1244
  /**
1182
1245
  * Raw period structure corresponding to the parsed Period type
@@ -1258,8 +1321,12 @@ type OchrePerson = {
1258
1321
  };
1259
1322
  coordinates?: OchreCoordinates;
1260
1323
  content?: FakeString | null;
1261
- events?: { event: OchreEvent | Array<OchreEvent> };
1262
- properties?: { property: OchreProperty | Array<OchreProperty> };
1324
+ events?: {
1325
+ event: OchreEvent | Array<OchreEvent>;
1326
+ };
1327
+ properties?: {
1328
+ property: OchreProperty | Array<OchreProperty>;
1329
+ };
1263
1330
  };
1264
1331
 
1265
1332
  /**
@@ -1269,9 +1336,13 @@ type OchreObservation = {
1269
1336
  observationNo: number;
1270
1337
  date?: string; // YYYY-MM-DD
1271
1338
  observers?: FakeString;
1272
- notes?: { note: OchreNote | Array<OchreNote> };
1339
+ notes?: {
1340
+ note: OchreNote | Array<OchreNote>;
1341
+ };
1273
1342
  links?: OchreLink | Array<OchreLink>;
1274
- properties?: { property: OchreProperty | Array<OchreProperty> };
1343
+ properties?: {
1344
+ property: OchreProperty | Array<OchreProperty>;
1345
+ };
1275
1346
  };
1276
1347
 
1277
1348
  /**
@@ -1311,7 +1382,9 @@ type OchreEvent = {
1311
1382
  type OchreInterpretation = {
1312
1383
  date: string; // YYYY-MM-DD
1313
1384
  interpretationNo: number;
1314
- properties?: { property: OchreProperty | Array<OchreProperty> };
1385
+ properties?: {
1386
+ property: OchreProperty | Array<OchreProperty>;
1387
+ };
1315
1388
  };
1316
1389
 
1317
1390
  /**
@@ -1325,12 +1398,21 @@ type OchrePropertyValue = {
1325
1398
  availability?: OchreLicense;
1326
1399
  identification: OchreIdentification;
1327
1400
  date?: string; // YYYY-MM-DD
1328
- creators?: { creator: OchrePerson | Array<OchrePerson> };
1401
+ creators?: {
1402
+ creator: OchrePerson | Array<OchrePerson>;
1403
+ };
1329
1404
  description?: OchreStringContent | FakeString;
1330
- notes?: { note: OchreNote | Array<OchreNote> };
1405
+ notes?: {
1406
+ note: OchreNote | Array<OchreNote>;
1407
+ };
1331
1408
  links?: OchreLink | Array<OchreLink>;
1332
1409
  };
1333
1410
 
1411
+ //#endregion
1412
+ //#region src/utils/fetchers/uuid.d.ts
1413
+ /**
1414
+ * Raw gallery response structure
1415
+ */
1334
1416
  /**
1335
1417
  * Fetches raw OCHRE data by UUID from the OCHRE API
1336
1418
  *
@@ -1351,6 +1433,8 @@ type OchrePropertyValue = {
1351
1433
  */
1352
1434
  declare function fetchByUuid(uuid: string): Promise<[null, OchreData] | [string, null]>;
1353
1435
 
1436
+ //#endregion
1437
+ //#region src/utils/fetchers/website.d.ts
1354
1438
  /**
1355
1439
  * Fetches and parses a website configuration from the OCHRE API
1356
1440
  *
@@ -1382,12 +1466,14 @@ declare function fetchByUuid(uuid: string): Promise<[null, OchreData] | [string,
1382
1466
  */
1383
1467
  declare function fetchWebsite(abbreviation: string): Promise<Website | null>;
1384
1468
 
1469
+ //#endregion
1470
+ //#region src/utils/getters.d.ts
1385
1471
  /**
1386
1472
  * Options for property search operations
1387
1473
  */
1388
1474
  type PropertyOptions = {
1389
- /** Whether to recursively search through nested properties */
1390
- includeNestedProperties: boolean;
1475
+ /** Whether to recursively search through nested properties */
1476
+ includeNestedProperties: boolean;
1391
1477
  };
1392
1478
  /**
1393
1479
  * Finds a property by its label in an array of properties
@@ -1478,10 +1564,12 @@ declare function getUniqueProperties(properties: Array<Property>, options?: Prop
1478
1564
  * ```
1479
1565
  */
1480
1566
  declare function filterProperties(property: Property, filter: {
1481
- label: string;
1482
- value: string | number | boolean | Date;
1567
+ label: string;
1568
+ value: string | number | boolean | Date;
1483
1569
  }, options?: PropertyOptions): boolean;
1484
1570
 
1571
+ //#endregion
1572
+ //#region src/utils/parse.d.ts
1485
1573
  /**
1486
1574
  * Parses raw identification data into the standardized Identification type
1487
1575
  *
@@ -1719,6 +1807,8 @@ declare function parseConcept(concept: OchreConcept): Concept;
1719
1807
  declare function parseConcepts(concepts: Array<OchreConcept>): Array<Concept>;
1720
1808
  declare function parseWebsite(websiteTree: OchreTree, projectName: FakeString, website: FakeString | null): Promise<Website>;
1721
1809
 
1810
+ //#endregion
1811
+ //#region src/utils/string.d.ts
1722
1812
  /**
1723
1813
  * Parses email addresses in a string into HTML links
1724
1814
  *
@@ -1770,4 +1860,5 @@ declare function parseStringDocumentItem(item: OchreStringRichTextItem, footnote
1770
1860
  */
1771
1861
  declare function parseStringContent(content: OchreStringContent, language?: string): string;
1772
1862
 
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, 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 };
1863
+ //#endregion
1864
+ 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 };