ochre-sdk 1.0.0-beta.13 → 1.0.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +153 -149
- package/dist/index.mjs +356 -359
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -198,31 +198,34 @@ type LanguageCodes = ReadonlyArray<string>;
|
|
|
198
198
|
/**
|
|
199
199
|
* The category of an item in OCHRE
|
|
200
200
|
*/
|
|
201
|
-
type
|
|
202
|
-
|
|
201
|
+
type ItemCategory = "tree" | "bibliography" | "concept" | "spatialUnit" | "period" | "person" | "propertyVariable" | "propertyValue" | "resource" | "text" | "set";
|
|
202
|
+
/**
|
|
203
|
+
* OCHRE item categories that can contain other items in API payloads.
|
|
204
|
+
*/
|
|
205
|
+
type ItemContainerCategory = Extract<ItemCategory, "tree" | "set">;
|
|
203
206
|
/**
|
|
204
207
|
* The category of items in a Tree
|
|
205
208
|
*/
|
|
206
|
-
type
|
|
209
|
+
type TreeItemCategory = Exclude<ItemCategory, "tree">;
|
|
207
210
|
/**
|
|
208
211
|
* The category of items in a Set
|
|
209
212
|
*/
|
|
210
|
-
type
|
|
211
|
-
type
|
|
212
|
-
type
|
|
213
|
-
type
|
|
213
|
+
type SetItemCategory = ItemCategory;
|
|
214
|
+
type ContainedItemCategory<U extends ItemCategory = ItemCategory> = U extends "tree" ? TreeItemCategory : U extends "set" ? SetItemCategory : never;
|
|
215
|
+
type ContainedItemCategoryOption<U extends ItemCategory = ItemCategory> = U extends "tree" ? TreeItemCategory : U extends "set" ? SetItemCategory | ReadonlyArray<SetItemCategory> : never;
|
|
216
|
+
type ContainedItemCategoryFromOption<U extends ItemCategory = ItemCategory, V extends ContainedItemCategoryOption<U> | undefined = undefined> = V extends ReadonlyArray<infer W> ? Extract<W, ContainedItemCategory<U>> : V extends ContainedItemCategory<U> ? V : ContainedItemCategory<U>;
|
|
214
217
|
/**
|
|
215
218
|
* The category of items in a heading
|
|
216
219
|
*/
|
|
217
|
-
type
|
|
220
|
+
type HeadingItemCategory = Exclude<ItemCategory, "tree" | "bibliography" | "spatialUnit" | "concept" | "period">;
|
|
218
221
|
/**
|
|
219
|
-
* The category of items that
|
|
222
|
+
* The category of items that expose recursive subitem structures.
|
|
220
223
|
*/
|
|
221
|
-
type
|
|
224
|
+
type RecursiveItemCategory = Exclude<ItemCategory, "tree" | "person" | "propertyVariable" | "propertyValue" | "set">;
|
|
222
225
|
/**
|
|
223
226
|
* The category names that can appear in OCHRE context paths
|
|
224
227
|
*/
|
|
225
|
-
type
|
|
228
|
+
type ContextItemCategory = Exclude<ItemCategory, "tree" | "person" | "set">;
|
|
226
229
|
/**
|
|
227
230
|
* Basic identification information
|
|
228
231
|
*/
|
|
@@ -271,8 +274,8 @@ type BelongsTo = {
|
|
|
271
274
|
uuid: string;
|
|
272
275
|
abbreviation: string;
|
|
273
276
|
};
|
|
274
|
-
type
|
|
275
|
-
type
|
|
277
|
+
type ItemPayloadKind = "topLevel" | "embedded";
|
|
278
|
+
type ItemEnvelopeFields<T extends LanguageCodes, U extends ItemPayloadKind> = U extends "topLevel" ? {
|
|
276
279
|
belongsTo: BelongsTo;
|
|
277
280
|
metadata: Metadata<T>;
|
|
278
281
|
persistentUrl: string | null;
|
|
@@ -300,7 +303,7 @@ type ContextItem = {
|
|
|
300
303
|
/**
|
|
301
304
|
* Context node in OCHRE
|
|
302
305
|
*/
|
|
303
|
-
type ContextNode<U extends
|
|
306
|
+
type ContextNode<U extends ContextItemCategory = ContextItemCategory> = {
|
|
304
307
|
tree: ContextItem;
|
|
305
308
|
project: ContextItem;
|
|
306
309
|
heading: Array<ContextItem>;
|
|
@@ -308,7 +311,7 @@ type ContextNode<U extends ContextDataCategory = ContextDataCategory> = {
|
|
|
308
311
|
/**
|
|
309
312
|
* Context in OCHRE
|
|
310
313
|
*/
|
|
311
|
-
type Context<U extends
|
|
314
|
+
type Context<U extends ContextItemCategory = ContextItemCategory> = {
|
|
312
315
|
nodes: Array<ContextNode<U>>;
|
|
313
316
|
displayPath: string;
|
|
314
317
|
};
|
|
@@ -431,7 +434,7 @@ type Note<T extends LanguageCodes = LanguageCodes> = {
|
|
|
431
434
|
number: number;
|
|
432
435
|
title: MultilingualString<T> | null;
|
|
433
436
|
content: MultilingualString<T>;
|
|
434
|
-
authors: Array<Person<T, "
|
|
437
|
+
authors: Array<Person<T, "embedded">>;
|
|
435
438
|
};
|
|
436
439
|
/**
|
|
437
440
|
* Property value content in OCHRE
|
|
@@ -493,37 +496,37 @@ type SimplifiedProperty<T extends LanguageCodes = LanguageCodes> = {
|
|
|
493
496
|
/**
|
|
494
497
|
* Property in a Set item. OCHRE exposes Set item properties as a flat list.
|
|
495
498
|
*/
|
|
496
|
-
type
|
|
497
|
-
type
|
|
498
|
-
type PropertyLike<T extends LanguageCodes = LanguageCodes> = Property<T> |
|
|
499
|
-
type ItemProperty<T extends LanguageCodes = LanguageCodes> = Property<T> |
|
|
499
|
+
type SetItemProperty<T extends LanguageCodes = LanguageCodes> = Omit<Property<T>, "properties">;
|
|
500
|
+
type SetItemSimplifiedProperty<T extends LanguageCodes = LanguageCodes> = Omit<SimplifiedProperty<T>, "properties">;
|
|
501
|
+
type PropertyLike<T extends LanguageCodes = LanguageCodes> = Property<T> | SetItemProperty<T> | SimplifiedProperty<T> | SetItemSimplifiedProperty<T>;
|
|
502
|
+
type ItemProperty<T extends LanguageCodes = LanguageCodes> = Property<T> | SetItemProperty<T>;
|
|
500
503
|
type PropertyValueDataType = PropertyValueContent["dataType"];
|
|
501
504
|
type QueryablePropertyValueDataType = Exclude<PropertyValueDataType, "coordinate">;
|
|
502
|
-
type
|
|
505
|
+
type WithSetItemProperties<U extends {
|
|
503
506
|
properties: Array<Property<T>>;
|
|
504
507
|
}, T extends LanguageCodes> = U extends {
|
|
505
508
|
properties: Array<Property<T>>;
|
|
506
509
|
} ? Prettify<Omit<U, "properties"> & {
|
|
507
|
-
properties: Array<
|
|
510
|
+
properties: Array<SetItemProperty<T>>;
|
|
508
511
|
}> : never;
|
|
509
512
|
/**
|
|
510
513
|
* Base item in OCHRE
|
|
511
514
|
*/
|
|
512
|
-
type BaseItem<U extends
|
|
515
|
+
type BaseItem<U extends ItemCategory = ItemCategory, T extends LanguageCodes = LanguageCodes, V extends ItemPayloadKind = "topLevel"> = ItemEnvelopeFields<T, V> & {
|
|
513
516
|
uuid: string;
|
|
514
517
|
category: U;
|
|
515
518
|
publicationDateTime: Date | null;
|
|
516
|
-
context: Context<
|
|
519
|
+
context: Context<ContextItemCategory> | null;
|
|
517
520
|
date: Date | null;
|
|
518
521
|
license: License | null;
|
|
519
522
|
copyright: MultilingualString<T> | null;
|
|
520
523
|
watermark: MultilingualString<T> | null;
|
|
521
524
|
identification: Identification<T>;
|
|
522
|
-
creators: Array<Person<T, "
|
|
525
|
+
creators: Array<Person<T, "embedded">>;
|
|
523
526
|
description: MultilingualString<T> | null;
|
|
524
527
|
events: Array<Event<T>>;
|
|
525
528
|
};
|
|
526
|
-
type ItemLinkCategory =
|
|
529
|
+
type ItemLinkCategory = ItemCategory | "dictionaryUnit";
|
|
527
530
|
/**
|
|
528
531
|
* Base item data exposed by OCHRE link and reverse-link payloads.
|
|
529
532
|
*/
|
|
@@ -531,7 +534,7 @@ type BaseItemLink<U extends ItemLinkCategory = ItemLinkCategory, T extends Langu
|
|
|
531
534
|
uuid: string;
|
|
532
535
|
category: U;
|
|
533
536
|
publicationDateTime: Date | null;
|
|
534
|
-
context: Context<
|
|
537
|
+
context: Context<ContextItemCategory> | null;
|
|
535
538
|
date: Date | null;
|
|
536
539
|
identification: Identification<T>;
|
|
537
540
|
description: MultilingualString<T> | null;
|
|
@@ -552,11 +555,11 @@ type BibliographyEntryInfo = {
|
|
|
552
555
|
type ItemLinks<T extends LanguageCodes = LanguageCodes> = Array<ItemLink<ItemLinkCategory, T>>;
|
|
553
556
|
type TreeItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"tree", T> & {
|
|
554
557
|
type: string | null;
|
|
555
|
-
|
|
558
|
+
containedItemCategory: TreeItemCategory | null;
|
|
556
559
|
}>;
|
|
557
560
|
type SetItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"set", T> & {
|
|
558
561
|
type: string | null;
|
|
559
|
-
|
|
562
|
+
containedItemCategories: Array<SetItemCategory> | null;
|
|
560
563
|
}>;
|
|
561
564
|
type BibliographyItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<BaseItemLink<"bibliography", T> & {
|
|
562
565
|
type: string | null;
|
|
@@ -572,7 +575,7 @@ type BibliographyItemLink<T extends LanguageCodes = LanguageCodes> = Prettify<Ba
|
|
|
572
575
|
startDate: Date | null;
|
|
573
576
|
} | null;
|
|
574
577
|
entryInfo: BibliographyEntryInfo | null;
|
|
575
|
-
source: ItemLink<
|
|
578
|
+
source: ItemLink<TreeItemCategory, T> | null;
|
|
576
579
|
authors: Array<ItemLink<"person", T>>;
|
|
577
580
|
periods: Array<ItemLink<"period", T>>;
|
|
578
581
|
properties: Array<Property<T>>;
|
|
@@ -627,35 +630,35 @@ type ItemLink<U extends ItemLinkCategory = ItemLinkCategory, T extends LanguageC
|
|
|
627
630
|
/**
|
|
628
631
|
* An Item in OCHRE (can be a tree, set, bibliography, concept, spatial unit, period, person, property value, property variable, or resource)
|
|
629
632
|
*/
|
|
630
|
-
type Item<U extends
|
|
631
|
-
type TopLevelItem<U extends
|
|
632
|
-
type
|
|
633
|
-
type
|
|
633
|
+
type Item<U extends ItemCategory = ItemCategory, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes, W extends ItemPayloadKind = "topLevel"> = U extends ItemCategory ? U extends "tree" ? Tree<Extract<V, TreeItemCategory>, T, W> : U extends "set" ? Set<Extract<V, SetItemCategory>, T, W> : U extends "bibliography" ? Bibliography<T, W> : U extends "concept" ? Concept<T, W> : U extends "spatialUnit" ? SpatialUnit<T, W> : U extends "period" ? Period<T, W> : U extends "person" ? Person<T, W> : U extends "propertyVariable" ? PropertyVariable<T, W> : U extends "propertyValue" ? PropertyValue<T, W> : U extends "resource" ? Resource<T, W> : U extends "text" ? Text<T, W> : never : never;
|
|
634
|
+
type TopLevelItem<U extends ItemCategory = ItemCategory, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes> = Item<U, V, T, "topLevel">;
|
|
635
|
+
type EmbeddedItem<U extends ItemCategory = ItemCategory, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes> = Item<U, V, T, "embedded">;
|
|
636
|
+
type AnyItem<U extends ItemCategory = ItemCategory, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes> = Item<U, V, T, ItemPayloadKind>;
|
|
634
637
|
/**
|
|
635
638
|
* Heading in OCHRE
|
|
636
639
|
*/
|
|
637
|
-
type Heading<U extends
|
|
640
|
+
type Heading<U extends HeadingItemCategory = HeadingItemCategory, T extends LanguageCodes = LanguageCodes> = {
|
|
638
641
|
name: string;
|
|
639
642
|
headings: Array<Heading<U, T>>;
|
|
640
|
-
items: Array<Item<U, never, T, "
|
|
643
|
+
items: Array<Item<U, never, T, "embedded">>;
|
|
641
644
|
};
|
|
642
645
|
/**
|
|
643
646
|
* Tree in OCHRE
|
|
644
647
|
*/
|
|
645
|
-
type Tree<U extends
|
|
648
|
+
type Tree<U extends TreeItemCategory = TreeItemCategory, T extends LanguageCodes = LanguageCodes, V extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"tree", T, V> & {
|
|
646
649
|
type: string | null;
|
|
647
|
-
|
|
650
|
+
containedItemCategory: U | null;
|
|
648
651
|
links: ItemLinks<T>;
|
|
649
652
|
notes: Array<Note<T>>;
|
|
650
653
|
properties: Array<Property<T>>;
|
|
651
|
-
bibliographies: Array<Bibliography<T, "
|
|
652
|
-
items: U extends
|
|
654
|
+
bibliographies: Array<Bibliography<T, "embedded">>;
|
|
655
|
+
items: U extends HeadingItemCategory ? Array<Heading<U, T> | Item<U, never, T, "embedded">> : Array<Item<U, never, T, "embedded">>;
|
|
653
656
|
}>;
|
|
654
657
|
/**
|
|
655
658
|
* Set in OCHRE
|
|
656
659
|
*/
|
|
657
|
-
type Set<U extends
|
|
658
|
-
|
|
660
|
+
type Set<U extends SetItemCategory = SetItemCategory, T extends LanguageCodes = LanguageCodes, V extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"set", T, V> & {
|
|
661
|
+
containedItemCategories: Array<U>;
|
|
659
662
|
isTabularStructure: boolean;
|
|
660
663
|
isSuppressingBlanks: boolean;
|
|
661
664
|
links: ItemLinks<T>;
|
|
@@ -663,25 +666,25 @@ type Set<U extends SetItemDataCategory = SetItemDataCategory, T extends Language
|
|
|
663
666
|
properties: Array<Property<T>>;
|
|
664
667
|
items: Array<SetItem<U, T>>;
|
|
665
668
|
}>;
|
|
666
|
-
type SetBibliography<T extends LanguageCodes = LanguageCodes> = Bibliography<T, "
|
|
669
|
+
type SetBibliography<T extends LanguageCodes = LanguageCodes> = Bibliography<T, "embedded"> extends infer U ? U extends {
|
|
667
670
|
properties: Array<Property<T>>;
|
|
668
671
|
} ? Prettify<Omit<U, "properties" | "items"> & {
|
|
669
|
-
properties: Array<
|
|
672
|
+
properties: Array<SetItemProperty<T>>;
|
|
670
673
|
}> : never : never;
|
|
671
|
-
type SetConcept<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<Concept<T, "
|
|
672
|
-
properties: Array<
|
|
674
|
+
type SetConcept<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<Concept<T, "embedded">, "interpretations" | "items"> & {
|
|
675
|
+
properties: Array<SetItemProperty<T>>;
|
|
673
676
|
}>;
|
|
674
|
-
type SetSpatialUnit<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<SpatialUnit<T, "
|
|
675
|
-
properties: Array<
|
|
677
|
+
type SetSpatialUnit<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<SpatialUnit<T, "embedded">, "observations" | "items"> & {
|
|
678
|
+
properties: Array<SetItemProperty<T>>;
|
|
676
679
|
}>;
|
|
677
|
-
type SetPeriod<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<
|
|
678
|
-
type SetResource<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<
|
|
679
|
-
type SetTree<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<
|
|
680
|
-
type SetItem<U extends
|
|
680
|
+
type SetPeriod<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<WithSetItemProperties<Period<T, "embedded">, T>, "items">>;
|
|
681
|
+
type SetResource<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<WithSetItemProperties<Resource<T, "embedded">, T>, "items">>;
|
|
682
|
+
type SetTree<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<WithSetItemProperties<Tree<TreeItemCategory, T, "embedded">, T>, "items">>;
|
|
683
|
+
type SetItem<U extends SetItemCategory = SetItemCategory, T extends LanguageCodes = LanguageCodes> = U extends "tree" ? SetTree<T> : U extends "bibliography" ? SetBibliography<T> : U extends "concept" ? SetConcept<T> : U extends "spatialUnit" ? SetSpatialUnit<T> : U extends "period" ? SetPeriod<T> : U extends "person" ? WithSetItemProperties<Person<T, "embedded">, T> : U extends "propertyVariable" ? PropertyVariable<T, "embedded"> : U extends "propertyValue" ? WithSetItemProperties<PropertyValue<T, "embedded">, T> : U extends "resource" ? SetResource<T> : U extends "text" ? Text<T, "embedded"> : U extends "set" ? Omit<WithSetItemProperties<Set<SetItemCategory, T, "embedded">, T>, "items"> : never;
|
|
681
684
|
/**
|
|
682
685
|
* Person in OCHRE
|
|
683
686
|
*/
|
|
684
|
-
type Person<T extends LanguageCodes = LanguageCodes, U extends
|
|
687
|
+
type Person<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"person", T, U> & {
|
|
685
688
|
type: string;
|
|
686
689
|
image: Image<T> | null;
|
|
687
690
|
address: {
|
|
@@ -692,7 +695,7 @@ type Person<T extends LanguageCodes = LanguageCodes, U extends ItemLocation = "t
|
|
|
692
695
|
} | null;
|
|
693
696
|
coordinates: Array<Coordinates<T>>;
|
|
694
697
|
content: MultilingualString<T> | null;
|
|
695
|
-
periods: Array<Period<T, "
|
|
698
|
+
periods: Array<Period<T, "embedded">>;
|
|
696
699
|
links: ItemLinks<T>;
|
|
697
700
|
notes: Array<Note<T>>;
|
|
698
701
|
properties: Array<Property<T>>;
|
|
@@ -700,19 +703,19 @@ type Person<T extends LanguageCodes = LanguageCodes, U extends ItemLocation = "t
|
|
|
700
703
|
/**
|
|
701
704
|
* Period in OCHRE
|
|
702
705
|
*/
|
|
703
|
-
type Period<T extends LanguageCodes = LanguageCodes, U extends
|
|
706
|
+
type Period<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"period", T, U> & {
|
|
704
707
|
type: string | null;
|
|
705
708
|
coordinates: Array<Coordinates<T>>;
|
|
706
709
|
links: ItemLinks<T>;
|
|
707
710
|
notes: Array<Note<T>>;
|
|
708
711
|
properties: Array<Property<T>>;
|
|
709
|
-
bibliographies: Array<Bibliography<T, "
|
|
710
|
-
items: Array<Period<T, "
|
|
712
|
+
bibliographies: Array<Bibliography<T, "embedded">>;
|
|
713
|
+
items: Array<Period<T, "embedded">>;
|
|
711
714
|
}>;
|
|
712
715
|
/**
|
|
713
716
|
* Bibliography in OCHRE
|
|
714
717
|
*/
|
|
715
|
-
type Bibliography<T extends LanguageCodes = LanguageCodes, U extends
|
|
718
|
+
type Bibliography<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"bibliography", T, U> & {
|
|
716
719
|
citationDetails: string | null;
|
|
717
720
|
citationFormat: MultilingualString<T> | null;
|
|
718
721
|
citationFormatSpan: string | null;
|
|
@@ -720,18 +723,18 @@ type Bibliography<T extends LanguageCodes = LanguageCodes, U extends ItemLocatio
|
|
|
720
723
|
image: Image<T> | null;
|
|
721
724
|
sourceDocument: BibliographySourceDocument | null;
|
|
722
725
|
publicationInfo: {
|
|
723
|
-
publishers: Array<Person<T, "
|
|
726
|
+
publishers: Array<Person<T, "embedded">>;
|
|
724
727
|
startDate: Date | null;
|
|
725
728
|
} | null;
|
|
726
729
|
entryInfo: BibliographyEntryInfo | null;
|
|
727
|
-
source: ItemLink<
|
|
728
|
-
authors: Array<Person<T, "
|
|
729
|
-
periods: Array<Period<T, "
|
|
730
|
+
source: ItemLink<TreeItemCategory, T> | null;
|
|
731
|
+
authors: Array<Person<T, "embedded">>;
|
|
732
|
+
periods: Array<Period<T, "embedded">>;
|
|
730
733
|
links: ItemLinks<T>;
|
|
731
734
|
notes: Array<Note<T>>;
|
|
732
735
|
properties: Array<Property<T>>;
|
|
733
|
-
bibliographies: Array<Bibliography<T, "
|
|
734
|
-
items: Array<Bibliography<T, "
|
|
736
|
+
bibliographies: Array<Bibliography<T, "embedded">>;
|
|
737
|
+
items: Array<Bibliography<T, "embedded">>;
|
|
735
738
|
} & ({
|
|
736
739
|
type: "zotero";
|
|
737
740
|
zoteroId: string;
|
|
@@ -742,11 +745,11 @@ type Bibliography<T extends LanguageCodes = LanguageCodes, U extends ItemLocatio
|
|
|
742
745
|
/**
|
|
743
746
|
* Concept in OCHRE
|
|
744
747
|
*/
|
|
745
|
-
type Concept<T extends LanguageCodes = LanguageCodes, U extends
|
|
748
|
+
type Concept<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"concept", T, U> & {
|
|
746
749
|
image: Image<T> | null;
|
|
747
750
|
interpretations: Array<Interpretation<T>>;
|
|
748
751
|
coordinates: Array<Coordinates<T>>;
|
|
749
|
-
items: Array<Concept<T, "
|
|
752
|
+
items: Array<Concept<T, "embedded">>;
|
|
750
753
|
}>;
|
|
751
754
|
/**
|
|
752
755
|
* Interpretation in OCHRE
|
|
@@ -754,17 +757,17 @@ type Concept<T extends LanguageCodes = LanguageCodes, U extends ItemLocation = "
|
|
|
754
757
|
type Interpretation<T extends LanguageCodes = LanguageCodes> = {
|
|
755
758
|
number: number;
|
|
756
759
|
date: Date | null;
|
|
757
|
-
observers: Array<Person<T, "
|
|
758
|
-
periods: Array<Period<T, "
|
|
760
|
+
observers: Array<Person<T, "embedded">>;
|
|
761
|
+
periods: Array<Period<T, "embedded">>;
|
|
759
762
|
links: ItemLinks<T>;
|
|
760
763
|
notes: Array<Note<T>>;
|
|
761
764
|
properties: Array<Property<T>>;
|
|
762
|
-
bibliographies: Array<Bibliography<T, "
|
|
765
|
+
bibliographies: Array<Bibliography<T, "embedded">>;
|
|
763
766
|
};
|
|
764
767
|
/**
|
|
765
768
|
* Spatial unit in OCHRE
|
|
766
769
|
*/
|
|
767
|
-
type SpatialUnit<T extends LanguageCodes = LanguageCodes, U extends
|
|
770
|
+
type SpatialUnit<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"spatialUnit", T, U> & {
|
|
768
771
|
image: Image<T> | null;
|
|
769
772
|
coordinates: Array<Coordinates<T>>;
|
|
770
773
|
mapData: {
|
|
@@ -774,8 +777,8 @@ type SpatialUnit<T extends LanguageCodes = LanguageCodes, U extends ItemLocation
|
|
|
774
777
|
};
|
|
775
778
|
} | null;
|
|
776
779
|
observations: Array<Observation<T>>;
|
|
777
|
-
bibliographies: Array<Bibliography<T, "
|
|
778
|
-
items: Array<SpatialUnit<T, "
|
|
780
|
+
bibliographies: Array<Bibliography<T, "embedded">>;
|
|
781
|
+
items: Array<SpatialUnit<T, "embedded">>;
|
|
779
782
|
}>;
|
|
780
783
|
/**
|
|
781
784
|
* Observation in OCHRE
|
|
@@ -783,37 +786,37 @@ type SpatialUnit<T extends LanguageCodes = LanguageCodes, U extends ItemLocation
|
|
|
783
786
|
type Observation<T extends LanguageCodes = LanguageCodes> = {
|
|
784
787
|
number: number;
|
|
785
788
|
date: Date | null;
|
|
786
|
-
observers: Array<string> | Array<Person<T, "
|
|
787
|
-
periods: Array<Period<T, "
|
|
789
|
+
observers: Array<string> | Array<Person<T, "embedded">>;
|
|
790
|
+
periods: Array<Period<T, "embedded">>;
|
|
788
791
|
links: ItemLinks<T>;
|
|
789
792
|
notes: Array<Note<T>>;
|
|
790
793
|
properties: Array<Property<T>>;
|
|
791
|
-
bibliographies: Array<Bibliography<T, "
|
|
794
|
+
bibliographies: Array<Bibliography<T, "embedded">>;
|
|
792
795
|
};
|
|
793
796
|
/**
|
|
794
797
|
* Property variable in OCHRE
|
|
795
798
|
*/
|
|
796
|
-
type PropertyVariable<T extends LanguageCodes = LanguageCodes, U extends
|
|
799
|
+
type PropertyVariable<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"propertyVariable", T, U> & {
|
|
797
800
|
type: string | null;
|
|
798
801
|
coordinates: Array<Coordinates<T>>;
|
|
799
802
|
links: ItemLinks<T>;
|
|
800
803
|
notes: Array<Note<T>>;
|
|
801
|
-
bibliographies: Array<Bibliography<T, "
|
|
804
|
+
bibliographies: Array<Bibliography<T, "embedded">>;
|
|
802
805
|
}>;
|
|
803
806
|
/**
|
|
804
807
|
* Property value in OCHRE
|
|
805
808
|
*/
|
|
806
|
-
type PropertyValue<T extends LanguageCodes = LanguageCodes, U extends
|
|
809
|
+
type PropertyValue<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"propertyValue", T, U> & {
|
|
807
810
|
coordinates: Array<Coordinates<T>>;
|
|
808
811
|
links: ItemLinks<T>;
|
|
809
812
|
notes: Array<Note<T>>;
|
|
810
813
|
properties: Array<Property<T>>;
|
|
811
|
-
bibliographies: Array<Bibliography<T, "
|
|
814
|
+
bibliographies: Array<Bibliography<T, "embedded">>;
|
|
812
815
|
}>;
|
|
813
816
|
/**
|
|
814
817
|
* Resource in OCHRE
|
|
815
818
|
*/
|
|
816
|
-
type Resource<T extends LanguageCodes = LanguageCodes, U extends
|
|
819
|
+
type Resource<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"resource", T, U> & {
|
|
817
820
|
type: string;
|
|
818
821
|
href: string | null;
|
|
819
822
|
fileFormat: string | null;
|
|
@@ -825,18 +828,18 @@ type Resource<T extends LanguageCodes = LanguageCodes, U extends ItemLocation =
|
|
|
825
828
|
document: MultilingualString<T> | null;
|
|
826
829
|
imageMap: ImageMap | null;
|
|
827
830
|
coordinates: Array<Coordinates<T>>;
|
|
828
|
-
periods: Array<Period<T, "
|
|
831
|
+
periods: Array<Period<T, "embedded">>;
|
|
829
832
|
links: ItemLinks<T>;
|
|
830
833
|
reverseLinks: ItemLinks<T>;
|
|
831
834
|
notes: Array<Note<T>>;
|
|
832
835
|
properties: Array<Property<T>>;
|
|
833
|
-
bibliographies: Array<Bibliography<T, "
|
|
834
|
-
items: Array<Resource<T, "
|
|
836
|
+
bibliographies: Array<Bibliography<T, "embedded">>;
|
|
837
|
+
items: Array<Resource<T, "embedded">>;
|
|
835
838
|
}>;
|
|
836
839
|
/**
|
|
837
840
|
* Text in OCHRE
|
|
838
841
|
*/
|
|
839
|
-
type Text<T extends LanguageCodes = LanguageCodes, U extends
|
|
842
|
+
type Text<T extends LanguageCodes = LanguageCodes, U extends ItemPayloadKind = "topLevel"> = Prettify<BaseItem<"text", T, U> & {
|
|
840
843
|
type: string;
|
|
841
844
|
text: string | null;
|
|
842
845
|
language: string | null;
|
|
@@ -846,9 +849,9 @@ type Text<T extends LanguageCodes = LanguageCodes, U extends ItemLocation = "top
|
|
|
846
849
|
reverseLinks: ItemLinks<T>;
|
|
847
850
|
notes: Array<Note<T>>;
|
|
848
851
|
sections: Array<Section<T>>;
|
|
849
|
-
periods: Array<Period<T, "
|
|
850
|
-
creators: Array<Person<T, "
|
|
851
|
-
editions: Array<Person<T, "
|
|
852
|
+
periods: Array<Period<T, "embedded">>;
|
|
853
|
+
creators: Array<Person<T, "embedded">>;
|
|
854
|
+
editions: Array<Person<T, "embedded">>;
|
|
852
855
|
}>;
|
|
853
856
|
/**
|
|
854
857
|
* Section in OCHRE
|
|
@@ -861,35 +864,35 @@ type Section<T extends LanguageCodes = LanguageCodes> = {
|
|
|
861
864
|
identification: Identification<T>;
|
|
862
865
|
} | null;
|
|
863
866
|
};
|
|
864
|
-
type
|
|
865
|
-
type
|
|
866
|
-
type
|
|
867
|
-
type
|
|
868
|
-
type
|
|
869
|
-
type
|
|
870
|
-
type
|
|
871
|
-
type
|
|
872
|
-
type
|
|
873
|
-
type
|
|
874
|
-
type
|
|
875
|
-
type
|
|
876
|
-
type
|
|
877
|
-
type
|
|
878
|
-
type
|
|
879
|
-
type
|
|
880
|
-
type
|
|
881
|
-
type
|
|
882
|
-
type
|
|
883
|
-
type
|
|
884
|
-
type
|
|
885
|
-
type
|
|
867
|
+
type EmbeddedTree<U extends TreeItemCategory = TreeItemCategory, T extends LanguageCodes = LanguageCodes> = Tree<U, T, "embedded">;
|
|
868
|
+
type AnyTree<U extends TreeItemCategory = TreeItemCategory, T extends LanguageCodes = LanguageCodes> = Tree<U, T, ItemPayloadKind>;
|
|
869
|
+
type EmbeddedSet<U extends SetItemCategory = SetItemCategory, T extends LanguageCodes = LanguageCodes> = Set<U, T, "embedded">;
|
|
870
|
+
type AnySet<U extends SetItemCategory = SetItemCategory, T extends LanguageCodes = LanguageCodes> = Set<U, T, ItemPayloadKind>;
|
|
871
|
+
type EmbeddedBibliography<T extends LanguageCodes = LanguageCodes> = Bibliography<T, "embedded">;
|
|
872
|
+
type AnyBibliography<T extends LanguageCodes = LanguageCodes> = Bibliography<T, ItemPayloadKind>;
|
|
873
|
+
type EmbeddedConcept<T extends LanguageCodes = LanguageCodes> = Concept<T, "embedded">;
|
|
874
|
+
type AnyConcept<T extends LanguageCodes = LanguageCodes> = Concept<T, ItemPayloadKind>;
|
|
875
|
+
type EmbeddedSpatialUnit<T extends LanguageCodes = LanguageCodes> = SpatialUnit<T, "embedded">;
|
|
876
|
+
type AnySpatialUnit<T extends LanguageCodes = LanguageCodes> = SpatialUnit<T, ItemPayloadKind>;
|
|
877
|
+
type EmbeddedPeriod<T extends LanguageCodes = LanguageCodes> = Period<T, "embedded">;
|
|
878
|
+
type AnyPeriod<T extends LanguageCodes = LanguageCodes> = Period<T, ItemPayloadKind>;
|
|
879
|
+
type EmbeddedPerson<T extends LanguageCodes = LanguageCodes> = Person<T, "embedded">;
|
|
880
|
+
type AnyPerson<T extends LanguageCodes = LanguageCodes> = Person<T, ItemPayloadKind>;
|
|
881
|
+
type EmbeddedPropertyVariable<T extends LanguageCodes = LanguageCodes> = PropertyVariable<T, "embedded">;
|
|
882
|
+
type AnyPropertyVariable<T extends LanguageCodes = LanguageCodes> = PropertyVariable<T, ItemPayloadKind>;
|
|
883
|
+
type EmbeddedPropertyValue<T extends LanguageCodes = LanguageCodes> = PropertyValue<T, "embedded">;
|
|
884
|
+
type AnyPropertyValue<T extends LanguageCodes = LanguageCodes> = PropertyValue<T, ItemPayloadKind>;
|
|
885
|
+
type EmbeddedResource<T extends LanguageCodes = LanguageCodes> = Resource<T, "embedded">;
|
|
886
|
+
type AnyResource<T extends LanguageCodes = LanguageCodes> = Resource<T, ItemPayloadKind>;
|
|
887
|
+
type EmbeddedText<T extends LanguageCodes = LanguageCodes> = Text<T, "embedded">;
|
|
888
|
+
type AnyText<T extends LanguageCodes = LanguageCodes> = Text<T, ItemPayloadKind>;
|
|
886
889
|
/**
|
|
887
890
|
* Represents a gallery with its identification, project identification, resources and max length
|
|
888
891
|
*/
|
|
889
892
|
type Gallery<T extends LanguageCodes = LanguageCodes> = {
|
|
890
893
|
identification: Identification<T>;
|
|
891
894
|
projectIdentification: Identification<T>;
|
|
892
|
-
resources: Array<Resource<T, "
|
|
895
|
+
resources: Array<Resource<T, "embedded">>;
|
|
893
896
|
maxLength: number;
|
|
894
897
|
};
|
|
895
898
|
/**
|
|
@@ -1057,15 +1060,15 @@ type FetchItemLinksLanguages<TLanguages extends ReadonlyArray<string> | undefine
|
|
|
1057
1060
|
*
|
|
1058
1061
|
* @param uuid - The UUID of the OCHRE item whose linked items should be fetched
|
|
1059
1062
|
* @param options - Fetch and parser options
|
|
1060
|
-
* @param options.
|
|
1063
|
+
* @param options.containedItemCategory - The category of items inside linked Trees/Sets to parse. Tree accepts one category; Set accepts one category or an array.
|
|
1061
1064
|
* @param options.languages - Language codes to parse. Inline arrays preserve literal types automatically.
|
|
1062
1065
|
* @param options.fetch - Custom fetch function to use instead of the default fetch
|
|
1063
1066
|
* @returns An object containing parsed linked items
|
|
1064
1067
|
*/
|
|
1065
|
-
declare function fetchItemLinks<const
|
|
1066
|
-
|
|
1068
|
+
declare function fetchItemLinks<const TContainedItemCategory extends ContainedItemCategoryOption<ItemContainerCategory> | undefined = undefined, const TLanguages extends ReadonlyArray<string> | undefined = undefined>(uuid: string, options?: FetchItemLinksBaseOptions<TLanguages> & {
|
|
1069
|
+
containedItemCategory?: TContainedItemCategory;
|
|
1067
1070
|
}): Promise<{
|
|
1068
|
-
items: Array<Item<
|
|
1071
|
+
items: Array<Item<ItemCategory, ContainedItemCategoryFromOption<ItemCategory, TContainedItemCategory>, FetchItemLinksLanguages<TLanguages>, "embedded">>;
|
|
1069
1072
|
error: null;
|
|
1070
1073
|
} | {
|
|
1071
1074
|
items: null;
|
|
@@ -1100,36 +1103,36 @@ declare function withLanguages<const TLanguages extends ReadonlyArray<string>>(l
|
|
|
1100
1103
|
* @param uuid - The UUID of the OCHRE item to fetch
|
|
1101
1104
|
* @param options - Required options object
|
|
1102
1105
|
* @param options.category - The category of the OCHRE item to fetch
|
|
1103
|
-
* @param options.
|
|
1106
|
+
* @param options.containedItemCategory - The category of items inside the OCHRE item to fetch. Only valid for Trees and Sets. Tree accepts one category; Set accepts one category or an array.
|
|
1104
1107
|
* @param options.languages - Language codes to parse. Inline arrays preserve literal types automatically.
|
|
1105
1108
|
* @param options.fetch - Custom fetch function to use instead of the default fetch
|
|
1106
1109
|
* @returns An object containing the parsed item
|
|
1107
1110
|
*/
|
|
1108
|
-
declare function fetchItem<const
|
|
1111
|
+
declare function fetchItem<const TContainedItemCategory extends ContainedItemCategoryOption<ItemContainerCategory> | undefined = undefined, const TLanguages extends ReadonlyArray<string> | undefined = undefined>(uuid: string, options?: FetchItemBaseOptions<TLanguages> & {
|
|
1109
1112
|
category?: undefined;
|
|
1110
|
-
|
|
1113
|
+
containedItemCategory?: TContainedItemCategory;
|
|
1111
1114
|
}): Promise<{
|
|
1112
|
-
item: Item<
|
|
1115
|
+
item: Item<ItemCategory, ContainedItemCategoryFromOption<ItemCategory, TContainedItemCategory>, FetchItemLanguages<TLanguages>>;
|
|
1113
1116
|
error: null;
|
|
1114
1117
|
} | {
|
|
1115
1118
|
item: null;
|
|
1116
1119
|
error: string;
|
|
1117
1120
|
}>;
|
|
1118
|
-
declare function fetchItem<const TCategory extends
|
|
1121
|
+
declare function fetchItem<const TCategory extends ItemContainerCategory, const TContainedItemCategory extends ContainedItemCategoryOption<TCategory> | undefined = undefined, const TLanguages extends ReadonlyArray<string> | undefined = undefined>(uuid: string, options: FetchItemBaseOptions<TLanguages> & {
|
|
1119
1122
|
category: TCategory;
|
|
1120
|
-
|
|
1123
|
+
containedItemCategory?: TContainedItemCategory;
|
|
1121
1124
|
}): Promise<{
|
|
1122
|
-
item: Item<TCategory,
|
|
1125
|
+
item: Item<TCategory, ContainedItemCategoryFromOption<TCategory, TContainedItemCategory>, FetchItemLanguages<TLanguages>>;
|
|
1123
1126
|
error: null;
|
|
1124
1127
|
} | {
|
|
1125
1128
|
item: null;
|
|
1126
1129
|
error: string;
|
|
1127
1130
|
}>;
|
|
1128
|
-
declare function fetchItem<const TCategory extends
|
|
1131
|
+
declare function fetchItem<const TCategory extends ItemCategory, const TLanguages extends ReadonlyArray<string> | undefined = undefined>(uuid: string, options: FetchItemBaseOptions<TLanguages> & {
|
|
1129
1132
|
category: TCategory;
|
|
1130
|
-
|
|
1133
|
+
containedItemCategory?: never;
|
|
1131
1134
|
}): Promise<{
|
|
1132
|
-
item: Item<TCategory,
|
|
1135
|
+
item: Item<TCategory, ContainedItemCategory<TCategory>, FetchItemLanguages<TLanguages>>;
|
|
1133
1136
|
error: null;
|
|
1134
1137
|
} | {
|
|
1135
1138
|
item: null;
|
|
@@ -1143,7 +1146,7 @@ type FetchSetItemsBaseOptions<TLanguages extends ReadonlyArray<string> | undefin
|
|
|
1143
1146
|
fetch?: FetchFunction$1;
|
|
1144
1147
|
};
|
|
1145
1148
|
type FetchSetItemsLanguages<TLanguages extends ReadonlyArray<string> | undefined> = TLanguages extends readonly [] ? ReadonlyArray<string> : TLanguages extends ReadonlyArray<string> ? TLanguages : ReadonlyArray<string>;
|
|
1146
|
-
type FetchSetItemsCategory<
|
|
1149
|
+
type FetchSetItemsCategory<TContainedItemCategories extends ReadonlyArray<SetItemCategory> | undefined> = TContainedItemCategories extends ReadonlyArray<infer U> ? Extract<U, SetItemCategory> : SetItemCategory;
|
|
1147
1150
|
/**
|
|
1148
1151
|
* Fetches and parses Set items from the OCHRE API
|
|
1149
1152
|
*
|
|
@@ -1154,22 +1157,22 @@ type FetchSetItemsCategory<TItemCategories extends ReadonlyArray<SetItemDataCate
|
|
|
1154
1157
|
* For propertyValue sorting, dataType is required and the sort key uses the first valid leaf value (value[not(@i)]).
|
|
1155
1158
|
* @param params.page - The page number (1-indexed)
|
|
1156
1159
|
* @param params.pageSize - The number of items per page
|
|
1157
|
-
* @param
|
|
1160
|
+
* @param containedItemCategories - The categories of the items to fetch
|
|
1158
1161
|
* @param options - Options for the fetch
|
|
1159
1162
|
* @param options.fetch - The fetch function to use
|
|
1160
1163
|
* @returns The parsed Set items or null if the fetch/parse fails
|
|
1161
1164
|
*/
|
|
1162
|
-
declare function fetchSetItems<const
|
|
1165
|
+
declare function fetchSetItems<const TContainedItemCategories extends ReadonlyArray<SetItemCategory> | undefined = undefined, const TLanguages extends ReadonlyArray<string> | undefined = undefined>(params: {
|
|
1163
1166
|
setScopeUuids: Array<string>;
|
|
1164
1167
|
queries?: Query | null;
|
|
1165
1168
|
sort?: SetItemsSort;
|
|
1166
1169
|
page: number;
|
|
1167
1170
|
pageSize?: number;
|
|
1168
|
-
},
|
|
1171
|
+
}, containedItemCategories?: TContainedItemCategories, options?: FetchSetItemsBaseOptions<TLanguages>): Promise<{
|
|
1169
1172
|
totalCount: number;
|
|
1170
1173
|
page: number;
|
|
1171
1174
|
pageSize: number;
|
|
1172
|
-
items: Array<SetItem<FetchSetItemsCategory<
|
|
1175
|
+
items: Array<SetItem<FetchSetItemsCategory<TContainedItemCategories>, FetchSetItemsLanguages<TLanguages>>>;
|
|
1173
1176
|
error: null;
|
|
1174
1177
|
} | {
|
|
1175
1178
|
totalCount: null;
|
|
@@ -1273,7 +1276,7 @@ type Scope<T extends LanguageCodes = LanguageCodes> = {
|
|
|
1273
1276
|
/**
|
|
1274
1277
|
* Represents a stylesheet item with its UUID and category
|
|
1275
1278
|
*/
|
|
1276
|
-
type StylesheetCategory = Extract<
|
|
1279
|
+
type StylesheetCategory = Extract<ItemCategory, "propertyVariable" | "propertyValue">;
|
|
1277
1280
|
type StylesheetItem = {
|
|
1278
1281
|
uuid: string;
|
|
1279
1282
|
category: "propertyVariable";
|
|
@@ -1323,12 +1326,13 @@ type Website<T extends LanguageCodes = LanguageCodes> = {
|
|
|
1323
1326
|
metadata: Metadata<T>;
|
|
1324
1327
|
publicationDateTime: Date | null;
|
|
1325
1328
|
identification: Identification<T>;
|
|
1326
|
-
creators: Array<Person<T, "
|
|
1329
|
+
creators: Array<Person<T, "embedded">>;
|
|
1327
1330
|
license: License | null;
|
|
1328
1331
|
items: Array<Webpage<T> | WebSegment<T>>;
|
|
1329
1332
|
properties: {
|
|
1330
1333
|
type: WebsiteType;
|
|
1331
1334
|
status: "development" | "preview" | "production";
|
|
1335
|
+
versionLabel: "experimental" | "alpha" | "beta" | "test" | "staging" | "pre-release" | "release";
|
|
1332
1336
|
privacy: "public" | "password" | "private";
|
|
1333
1337
|
contact: {
|
|
1334
1338
|
name: string;
|
|
@@ -1502,7 +1506,7 @@ type WebElementComponent<T extends LanguageCodes = LanguageCodes> = {
|
|
|
1502
1506
|
} | {
|
|
1503
1507
|
component: "bibliography";
|
|
1504
1508
|
linkUuids: Array<string>;
|
|
1505
|
-
bibliographies: Array<Bibliography<T, "
|
|
1509
|
+
bibliographies: Array<Bibliography<T, "embedded">>;
|
|
1506
1510
|
layout: "long" | "short";
|
|
1507
1511
|
isSourceDocumentDisplayed: boolean;
|
|
1508
1512
|
} | {
|
|
@@ -1770,9 +1774,9 @@ type SearchableProperty<T extends LanguageCodes> = PropertyLike<T>;
|
|
|
1770
1774
|
* @returns The matching Property object, or null if not found
|
|
1771
1775
|
*/
|
|
1772
1776
|
declare function getPropertyByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, variableUuid: string, options?: PropertyOptions): Property<T> | null;
|
|
1773
|
-
declare function getPropertyByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1777
|
+
declare function getPropertyByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, variableUuid: string, options?: PropertyOptions): SetItemProperty<T> | null;
|
|
1774
1778
|
declare function getPropertyByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, variableUuid: string, options?: PropertyOptions): SimplifiedProperty<T> | null;
|
|
1775
|
-
declare function getPropertyByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1779
|
+
declare function getPropertyByVariableUuid<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, variableUuid: string, options?: PropertyOptions): SetItemSimplifiedProperty<T> | null;
|
|
1776
1780
|
/**
|
|
1777
1781
|
* Retrieves all values for a property with the given variable UUID.
|
|
1778
1782
|
*
|
|
@@ -1818,9 +1822,9 @@ declare function getPropertyValueContentByVariableUuid<T extends LanguageCodes =
|
|
|
1818
1822
|
* @returns The matching Property object, or null if not found
|
|
1819
1823
|
*/
|
|
1820
1824
|
declare function getPropertyByVariableLabel<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, variableLabel: string, options?: PropertyOptions): Property<T> | null;
|
|
1821
|
-
declare function getPropertyByVariableLabel<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1825
|
+
declare function getPropertyByVariableLabel<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, variableLabel: string, options?: PropertyOptions): SetItemProperty<T> | null;
|
|
1822
1826
|
declare function getPropertyByVariableLabel<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, variableLabel: string, options?: PropertyOptions): SimplifiedProperty<T> | null;
|
|
1823
|
-
declare function getPropertyByVariableLabel<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1827
|
+
declare function getPropertyByVariableLabel<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, variableLabel: string, options?: PropertyOptions): SetItemSimplifiedProperty<T> | null;
|
|
1824
1828
|
/**
|
|
1825
1829
|
* Finds a property by its variable label and all values.
|
|
1826
1830
|
*
|
|
@@ -1831,9 +1835,9 @@ declare function getPropertyByVariableLabel<T extends LanguageCodes = LanguageCo
|
|
|
1831
1835
|
* @returns The matching Property object, or null if not found or all values do not match
|
|
1832
1836
|
*/
|
|
1833
1837
|
declare function getPropertyByVariableLabelAndValues<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, variableLabel: string, values: ReadonlyArray<PropertyValueContent<T>>, options?: PropertyOptions): Property<T> | null;
|
|
1834
|
-
declare function getPropertyByVariableLabelAndValues<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1838
|
+
declare function getPropertyByVariableLabelAndValues<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, variableLabel: string, values: ReadonlyArray<PropertyValueContent<T>>, options?: PropertyOptions): SetItemProperty<T> | null;
|
|
1835
1839
|
declare function getPropertyByVariableLabelAndValues<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, variableLabel: string, values: ReadonlyArray<PropertyValueContent<T>>, options?: PropertyOptions): SimplifiedProperty<T> | null;
|
|
1836
|
-
declare function getPropertyByVariableLabelAndValues<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1840
|
+
declare function getPropertyByVariableLabelAndValues<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, variableLabel: string, values: ReadonlyArray<PropertyValueContent<T>>, options?: PropertyOptions): SetItemSimplifiedProperty<T> | null;
|
|
1837
1841
|
/**
|
|
1838
1842
|
* Finds a property by its variable label and all value contents.
|
|
1839
1843
|
*
|
|
@@ -1844,9 +1848,9 @@ declare function getPropertyByVariableLabelAndValues<T extends LanguageCodes = L
|
|
|
1844
1848
|
* @returns The matching Property object, or null if not found or all value contents do not match
|
|
1845
1849
|
*/
|
|
1846
1850
|
declare function getPropertyByVariableLabelAndValueContents<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, variableLabel: string, valueContents: ReadonlyArray<PropertyContent<T>>, options?: PropertyOptions): Property<T> | null;
|
|
1847
|
-
declare function getPropertyByVariableLabelAndValueContents<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1851
|
+
declare function getPropertyByVariableLabelAndValueContents<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, variableLabel: string, valueContents: ReadonlyArray<PropertyContent<T>>, options?: PropertyOptions): SetItemProperty<T> | null;
|
|
1848
1852
|
declare function getPropertyByVariableLabelAndValueContents<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, variableLabel: string, valueContents: ReadonlyArray<PropertyContent<T>>, options?: PropertyOptions): SimplifiedProperty<T> | null;
|
|
1849
|
-
declare function getPropertyByVariableLabelAndValueContents<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1853
|
+
declare function getPropertyByVariableLabelAndValueContents<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, variableLabel: string, valueContents: ReadonlyArray<PropertyContent<T>>, options?: PropertyOptions): SetItemSimplifiedProperty<T> | null;
|
|
1850
1854
|
/**
|
|
1851
1855
|
* Finds a property by its variable label and one value.
|
|
1852
1856
|
*
|
|
@@ -1857,9 +1861,9 @@ declare function getPropertyByVariableLabelAndValueContents<T extends LanguageCo
|
|
|
1857
1861
|
* @returns The matching Property object, or null if not found or value does not match
|
|
1858
1862
|
*/
|
|
1859
1863
|
declare function getPropertyByVariableLabelAndValue<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, variableLabel: string, value: PropertyValueContent<T>, options?: PropertyOptions): Property<T> | null;
|
|
1860
|
-
declare function getPropertyByVariableLabelAndValue<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1864
|
+
declare function getPropertyByVariableLabelAndValue<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, variableLabel: string, value: PropertyValueContent<T>, options?: PropertyOptions): SetItemProperty<T> | null;
|
|
1861
1865
|
declare function getPropertyByVariableLabelAndValue<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, variableLabel: string, value: PropertyValueContent<T>, options?: PropertyOptions): SimplifiedProperty<T> | null;
|
|
1862
|
-
declare function getPropertyByVariableLabelAndValue<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1866
|
+
declare function getPropertyByVariableLabelAndValue<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, variableLabel: string, value: PropertyValueContent<T>, options?: PropertyOptions): SetItemSimplifiedProperty<T> | null;
|
|
1863
1867
|
/**
|
|
1864
1868
|
* Finds a property by its variable label and one value content.
|
|
1865
1869
|
*
|
|
@@ -1870,9 +1874,9 @@ declare function getPropertyByVariableLabelAndValue<T extends LanguageCodes = La
|
|
|
1870
1874
|
* @returns The matching Property object, or null if not found or value content does not match
|
|
1871
1875
|
*/
|
|
1872
1876
|
declare function getPropertyByVariableLabelAndValueContent<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, variableLabel: string, valueContent: PropertyContent<T>, options?: PropertyOptions): Property<T> | null;
|
|
1873
|
-
declare function getPropertyByVariableLabelAndValueContent<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1877
|
+
declare function getPropertyByVariableLabelAndValueContent<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, variableLabel: string, valueContent: PropertyContent<T>, options?: PropertyOptions): SetItemProperty<T> | null;
|
|
1874
1878
|
declare function getPropertyByVariableLabelAndValueContent<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, variableLabel: string, valueContent: PropertyContent<T>, options?: PropertyOptions): SimplifiedProperty<T> | null;
|
|
1875
|
-
declare function getPropertyByVariableLabelAndValueContent<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1879
|
+
declare function getPropertyByVariableLabelAndValueContent<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, variableLabel: string, valueContent: PropertyContent<T>, options?: PropertyOptions): SetItemSimplifiedProperty<T> | null;
|
|
1876
1880
|
/**
|
|
1877
1881
|
* Retrieves all values for a property with the given variable label.
|
|
1878
1882
|
*
|
|
@@ -1908,9 +1912,9 @@ declare function getPropertyValueContentByVariableLabel<T extends LanguageCodes
|
|
|
1908
1912
|
* @returns Array of unique properties
|
|
1909
1913
|
*/
|
|
1910
1914
|
declare function getUniqueProperties<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<Property<T>>, options?: PropertyOptions): Array<Property<T>>;
|
|
1911
|
-
declare function getUniqueProperties<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1915
|
+
declare function getUniqueProperties<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemProperty<T>>, options?: PropertyOptions): Array<SetItemProperty<T>>;
|
|
1912
1916
|
declare function getUniqueProperties<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>, options?: PropertyOptions): Array<SimplifiedProperty<T>>;
|
|
1913
|
-
declare function getUniqueProperties<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<
|
|
1917
|
+
declare function getUniqueProperties<T extends LanguageCodes = LanguageCodes>(properties: ReadonlyArray<SetItemSimplifiedProperty<T>>, options?: PropertyOptions): Array<SetItemSimplifiedProperty<T>>;
|
|
1914
1918
|
/**
|
|
1915
1919
|
* Gets all unique property variable labels from an array of properties.
|
|
1916
1920
|
*
|
|
@@ -1943,7 +1947,7 @@ declare function filterProperties<T extends LanguageCodes = LanguageCodes>(prope
|
|
|
1943
1947
|
//#endregion
|
|
1944
1948
|
//#region src/helpers.d.ts
|
|
1945
1949
|
type FlattenedItem<U, T extends LanguageCodes> = Omit<U, "properties"> & {
|
|
1946
|
-
properties: Array<
|
|
1950
|
+
properties: Array<SetItemProperty<T>>;
|
|
1947
1951
|
};
|
|
1948
1952
|
/**
|
|
1949
1953
|
* The default page size to use for fetching paginated items
|
|
@@ -1954,6 +1958,6 @@ declare const DEFAULT_PAGE_SIZE = 48;
|
|
|
1954
1958
|
* @param item - The item whose properties to flatten
|
|
1955
1959
|
* @returns The item with the properties flattened
|
|
1956
1960
|
*/
|
|
1957
|
-
declare function flattenItemProperties<U extends
|
|
1961
|
+
declare function flattenItemProperties<U extends ItemCategory = ItemCategory, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes, W extends ItemPayloadKind = "topLevel">(item: Item<U, V, T, W>): FlattenedItem<Item<U, V, T, W>, T>;
|
|
1958
1962
|
//#endregion
|
|
1959
|
-
export { AccordionWebBlock, BaseItem, BaseItemLink, BelongsTo, Bibliography, BibliographyEntryInfo, BibliographyItemLink, BibliographySourceDocument, Concept, ConceptItemLink,
|
|
1963
|
+
export { AccordionWebBlock, AnyBibliography, AnyConcept, AnyItem, AnyPeriod, AnyPerson, AnyPropertyValue, AnyPropertyVariable, AnyResource, AnySet, AnySpatialUnit, AnyText, AnyTree, BaseItem, BaseItemLink, BelongsTo, Bibliography, BibliographyEntryInfo, BibliographyItemLink, BibliographySourceDocument, Concept, ConceptItemLink, ContainedItemCategory, ContainedItemCategoryFromOption, ContainedItemCategoryOption, Context, ContextItem, ContextItemCategory, ContextNode, ContextTree, ContextTreeFilterLevel, ContextTreeLevel, ContextTreeLevelItem, Coordinates, CoordinatesSource, DEFAULT_PAGE_SIZE, DictionaryUnitItemLink, EmbeddedBibliography, EmbeddedConcept, EmbeddedItem, EmbeddedPeriod, EmbeddedPerson, EmbeddedPropertyValue, EmbeddedPropertyVariable, EmbeddedResource, EmbeddedSet, EmbeddedSpatialUnit, EmbeddedText, EmbeddedTree, Event, Gallery, Heading, HeadingItemCategory, Identification, Image, ImageMap, ImageMapArea, Interpretation, Item, ItemCategory, ItemContainerCategory, ItemLink, ItemLinkCategory, ItemLinks, ItemPayloadKind, ItemProperty, LanguageCodes, License, Metadata, type MultilingualOptions, MultilingualString, type MultilingualStringEntries, type MultilingualStringEntry, type MultilingualStringInput, type MultilingualStringJSON, type MultilingualStringObject, type MultilingualStringText, Note, Observation, Period, PeriodItemLink, Person, PersonItemLink, Property, PropertyLike, PropertyOptions, PropertyValue, PropertyValueContent, PropertyValueDataType, PropertyValueItemLink, PropertyValueQueryItem, PropertyVariable, PropertyVariableItemLink, Query, QueryGroup, QueryLeaf, QueryablePropertyValueDataType, RecursiveItemCategory, Resource, ResourceItemLink, Scope, Section, Set, SetAttributeValueQueryItem, SetBibliography, SetConcept, SetItem, SetItemCategory, SetItemLink, SetItemProperty, SetItemSimplifiedProperty, SetItemsSort, SetItemsSortDirection, SetPeriod, SetResource, SetSpatialUnit, SetTree, SimplifiedProperty, SpatialUnit, SpatialUnitItemLink, Style, StylesheetCategory, StylesheetItem, Text, TextItemLink, TopLevelItem, Tree, TreeItemCategory, TreeItemLink, WebBlock, WebBlockByLayout, WebBlockLayout, WebElement, WebElementComponent, WebElementComponentName, WebElementComponentOf, WebElementOf, WebImage, WebSegment, WebSegmentItem, WebTitle, Webpage, Website, WebsitePropertyQuery, WebsitePropertyQueryNode, WebsiteType, defineLanguages, fetchGallery, fetchItem, fetchItemLinks, fetchSetItems, fetchSetPropertyValues, fetchWebsite, filterProperties, flattenItemProperties, getLeafPropertyValues, getPropertyByVariableLabel, getPropertyByVariableLabelAndValue, getPropertyByVariableLabelAndValueContent, getPropertyByVariableLabelAndValueContents, getPropertyByVariableLabelAndValues, getPropertyByVariableUuid, getPropertyValueByVariableLabel, getPropertyValueByVariableUuid, getPropertyValueContentByVariableLabel, getPropertyValueContentByVariableUuid, getPropertyValueContentsByVariableUuid, getPropertyValuesByVariableLabel, getPropertyValuesByVariableUuid, getUniqueProperties, getUniquePropertyVariableLabels, withLanguages };
|