@digitalculture/ochre-sdk 0.7.12 → 0.7.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.cts CHANGED
@@ -741,697 +741,6 @@ declare function fetchItem<T extends DataCategory, U extends DataCategory>(uuid:
741
741
  category: never;
742
742
  }>;
743
743
 
744
- //#endregion
745
- //#region src/types/internal.raw.d.ts
746
- /**
747
- * Raw string value that can be a string, number, or boolean
748
- */
749
- type FakeString = string | number | boolean;
750
-
751
- /**
752
- * Text rendering options for string content
753
- */
754
-
755
- /**
756
- * Raw content item with rendering and whitespace options
757
- */
758
- type OchreStringItemContent = {
759
- rend?: string; // "bold" | "italic" | "underline" (space separated)
760
- whitespace?: string; // "newline" | "trailing" | "leading" (space separated)
761
- content: FakeString;
762
- };
763
-
764
- /**
765
- * Raw string item with language metadata
766
- */
767
- type OchreStringItem = {
768
- string: FakeString | OchreStringItemContent | Array<FakeString | OchreStringItemContent>;
769
- lang?: Language["iso6393"]; // 3 character code (zxx = "a.k.a.")
770
- languages?: string; // 3 character codes, semicolon separated
771
- };
772
-
773
- /**
774
- * Container for raw string content
775
- */
776
- type OchreStringContent = {
777
- content: FakeString | OchreStringItem | Array<OchreStringItem>;
778
- };
779
-
780
- /**
781
- * Rich text content item with formatting and language metadata
782
- */
783
- type OchreStringRichTextItemContent = {
784
- content: FakeString;
785
- title?: FakeString;
786
- lang?: Language["iso6393"]; // 3 character code (zxx = "a.k.a.")
787
- whitespace?: string; // "newline" | "trailing" | "leading" (space separated)
788
- rend?: string; // "bold" | "italic" | "underline" (space separated)
789
- };
790
-
791
- /**
792
- * Annotated rich text item with links
793
- */
794
- type OchreStringRichTextItemAnnotation = {
795
- annotation: string; // UUID
796
- string: FakeString | OchreStringRichTextItemContent;
797
- links: OchreLink | Array<OchreLink>;
798
- };
799
-
800
- /**
801
- * Union type for different rich text item formats
802
- */
803
- type OchreStringRichTextItem = FakeString | OchreStringRichTextItemContent | {
804
- string: OchreStringRichTextItemAnnotation | Array<OchreStringRichTextItemAnnotation>;
805
- whitespace?: string; // "newline" | "trailing" | "leading" (space separated)
806
- } | {
807
- whitespace: string; // "newline" | "trailing" | "leading" (space separated)
808
- } | OchreStringRichTextItemAnnotation;
809
-
810
- /**
811
- * Container for rich text content with language metadata
812
- */
813
- type OchreStringRichText = {
814
- string: FakeString | OchreStringRichTextItem | Array<OchreStringRichTextItem>;
815
- title?: FakeString;
816
- lang?: Language["iso6393"]; // 3 character code (zxx = "a.k.a.")
817
- };
818
-
819
- /**
820
- * Raw data structure corresponding to the parsed Data type
821
- */
822
- type OchreData = {
823
- ochre: {
824
- uuid: string;
825
- uuidBelongsTo: string;
826
- belongsTo: FakeString;
827
- publicationDateTime: string; // YYYY-MM-DDThh:mm:ssZ
828
- metadata: OchreMetadata;
829
- languages?: string; // 3 character codes, semicolon separated
830
- } & ({
831
- tree: OchreTree;
832
- } | {
833
- set: OchreSet;
834
- } | {
835
- resource: OchreResource;
836
- } | {
837
- spatialUnit: OchreSpatialUnit;
838
- } | {
839
- concept: OchreConcept;
840
- } | {
841
- period: OchrePeriod;
842
- } | {
843
- bibliography: OchreBibliography;
844
- } | {
845
- person: OchrePerson;
846
- } | {
847
- propertyValue: OchrePropertyValue;
848
- });
849
- };
850
-
851
- /**
852
- * Raw data response structure from the OCHRE API
853
- */
854
-
855
- /**
856
- * Raw metadata structure corresponding to the parsed Metadata type
857
- */
858
- type OchreMetadata = {
859
- identifier: OchreStringContent;
860
- item?: {
861
- label?: OchreStringContent; // Faulty, only exists in old items that have not been republished
862
- abbreviation?: OchreStringContent; // Faulty, only exists in old items that have not been republished
863
- identification: OchreIdentification;
864
- category: string;
865
- type: string;
866
- maxLength?: number;
867
- };
868
- publisher: OchreStringContent;
869
- dataset: OchreStringContent;
870
- project?: {
871
- identification: OchreIdentification;
872
- };
873
- language?: OchreLanguage | Array<OchreLanguage>;
874
- description: OchreStringContent;
875
- };
876
- type OchreTreeCollectionOption = {
877
- type: "set" | "variable";
878
- content: string; // UUID
879
- };
880
-
881
- /**
882
- * Raw tree structure corresponding to the parsed Tree type
883
- */
884
- type OchreTree = {
885
- uuid: string;
886
- publicationDateTime: string; // YYYY-MM-DDThh:mm:ssZ
887
- type: string;
888
- n: number;
889
- availability: OchreLicense;
890
- identification: OchreIdentification;
891
- date?: string; // YYYY-MM-DD
892
- creators?: {
893
- creator: OchrePerson | Array<OchrePerson>;
894
- };
895
- collectionOptions?: {
896
- metadataUuids: {
897
- uuid?: OchreTreeCollectionOption | Array<OchreTreeCollectionOption>;
898
- };
899
- searchUuids: {
900
- uuid?: OchreTreeCollectionOption | Array<OchreTreeCollectionOption>;
901
- };
902
- labelUuids: {
903
- uuid?: OchreTreeCollectionOption | Array<OchreTreeCollectionOption>;
904
- };
905
- };
906
- items: string | {
907
- resource: OchreResource | Array<OchreResource>;
908
- } | {
909
- spatialUnit: OchreSpatialUnit | Array<OchreSpatialUnit>;
910
- } | {
911
- concept: OchreConcept | Array<OchreConcept>;
912
- } | {
913
- period: OchrePeriod | Array<OchrePeriod>;
914
- } | {
915
- bibliography: OchreBibliography | Array<OchreBibliography>;
916
- } | {
917
- person: OchrePerson | Array<OchrePerson>;
918
- } | {
919
- propertyValue: OchrePropertyValue | Array<OchrePropertyValue>;
920
- };
921
- properties?: {
922
- property: OchreProperty | Array<OchreProperty>;
923
- };
924
- };
925
-
926
- /**
927
- * Raw set structure corresponding to the parsed Set type
928
- */
929
- type OchreSet = {
930
- uuid: string;
931
- publicationDateTime: string; // YYYY-MM-DDThh:mm:ssZ
932
- type: string;
933
- n: number;
934
- availability: OchreLicense;
935
- identification: OchreIdentification;
936
- date?: string; // YYYY-MM-DD
937
- suppressBlanks?: boolean;
938
- description?: OchreStringContent | FakeString;
939
- creators?: {
940
- creator: OchrePerson | Array<OchrePerson>;
941
- };
942
- items: string | {
943
- resource: OchreResource | Array<OchreResource>;
944
- } | {
945
- spatialUnit: OchreSpatialUnit | Array<OchreSpatialUnit>;
946
- } | {
947
- concept: OchreConcept | Array<OchreConcept>;
948
- } | {
949
- period: OchrePeriod | Array<OchrePeriod>;
950
- } | {
951
- bibliography: OchreBibliography | Array<OchreBibliography>;
952
- } | {
953
- person: OchrePerson | Array<OchrePerson>;
954
- } | {
955
- propertyValue: OchrePropertyValue | Array<OchrePropertyValue>;
956
- };
957
- };
958
-
959
- /**
960
- * Raw resource structure corresponding to the parsed Resource type
961
- */
962
- type OchreResource = {
963
- uuid: string;
964
- publicationDateTime: string; // YYYY-MM-DDThh:mm:ssZ
965
- type: string;
966
- n: number;
967
- slug?: string;
968
- format?: string;
969
- context?: OchreContext;
970
- availability?: OchreLicense;
971
- copyright?: FakeString;
972
- identification: OchreIdentification;
973
- href?: string;
974
- description?: OchreStringContent | FakeString;
975
- date?: string; // YYYY-MM-DD
976
- image?: OchreImage;
977
- creators?: {
978
- creator: OchrePerson | Array<OchrePerson>;
979
- };
980
- notes?: {
981
- note: OchreNote | Array<OchreNote>;
982
- };
983
- document?: {
984
- content: OchreStringRichText | Array<OchreStringRichText>;
985
- } | object;
986
- imagemap?: OchreImageMap;
987
- periods?: {
988
- period: OchrePeriod | Array<OchrePeriod>;
989
- };
990
- links?: OchreLink | Array<OchreLink>;
991
- reverseLinks?: OchreLink | Array<OchreLink>;
992
- properties?: {
993
- property: OchreProperty | Array<OchreProperty>;
994
- };
995
- citedBibliography?: {
996
- reference: OchreBibliography | Array<OchreBibliography>;
997
- };
998
- resource?: OchreResource | Array<OchreResource>;
999
- };
1000
-
1001
- /**
1002
- * Raw spatial unit structure corresponding to the parsed SpatialUnit type
1003
- */
1004
- type OchreSpatialUnit = {
1005
- uuid: string;
1006
- publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
1007
- type: string;
1008
- n: number;
1009
- availability?: OchreLicense;
1010
- context?: OchreContext;
1011
- identification: OchreIdentification;
1012
- image?: OchreImage;
1013
- description?: OchreStringContent | FakeString;
1014
- coordinate?: string; // "latitude, longitude"
1015
- coordinates?: OchreCoordinates;
1016
- events?: {
1017
- event: OchreEvent | Array<OchreEvent>;
1018
- };
1019
- observations?: {
1020
- observation: OchreObservation | Array<OchreObservation>;
1021
- };
1022
- observation?: OchreObservation;
1023
- properties?: {
1024
- property: OchreProperty | Array<OchreProperty>;
1025
- };
1026
- };
1027
-
1028
- /**
1029
- * Raw concept structure corresponding to the parsed Concept type
1030
- */
1031
- type OchreConcept = {
1032
- uuid: string;
1033
- publicationDateTime: string; // YYYY-MM-DDThh:mm:ssZ
1034
- n: number;
1035
- availability?: OchreLicense;
1036
- context?: OchreContext;
1037
- identification: OchreIdentification;
1038
- interpretations: {
1039
- interpretation: OchreInterpretation | Array<OchreInterpretation>;
1040
- };
1041
- };
1042
-
1043
- /**
1044
- * Raw property value structure corresponding to the parsed PropertyValue type
1045
- */
1046
- type OchrePropertyValueContent = {
1047
- uuid?: string;
1048
- publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
1049
- type?: string;
1050
- category?: string;
1051
- slug?: FakeString;
1052
- unit?: string;
1053
- booleanValue?: boolean;
1054
- isUncertain?: boolean;
1055
- content?: FakeString | OchreStringItem | Array<OchreStringItem>;
1056
- };
1057
-
1058
- /**
1059
- * Raw property structure corresponding to the parsed Property type
1060
- */
1061
- type OchreProperty = {
1062
- label: OchreStringContent & {
1063
- uuid: string;
1064
- };
1065
- value?: OchrePropertyValueContent | Array<OchrePropertyValueContent> | FakeString;
1066
- comment?: FakeString;
1067
- property?: OchreProperty | Array<OchreProperty>;
1068
- };
1069
-
1070
- /**
1071
- * Raw identification structure corresponding to the parsed Identification type
1072
- */
1073
- type OchreIdentification = {
1074
- label: OchreStringContent | FakeString;
1075
- abbreviation?: OchreStringContent | FakeString;
1076
- MIMEType?: string;
1077
- widthPreview?: number;
1078
- heightPreview?: number;
1079
- height?: number;
1080
- width?: number;
1081
- email?: FakeString;
1082
- website?: string;
1083
- };
1084
-
1085
- /**
1086
- * Raw license structure corresponding to the parsed License type
1087
- */
1088
- type OchreLicense = {
1089
- license: {
1090
- content: string;
1091
- target: string;
1092
- } | string;
1093
- };
1094
-
1095
- /**
1096
- * Raw language structure for specifying content languages
1097
- */
1098
- type OchreLanguage = {
1099
- default?: boolean;
1100
- content: string; // 3 character code
1101
- };
1102
-
1103
- /**
1104
- * Raw link item structure for various linked content types
1105
- */
1106
- type OchreLinkItem = {
1107
- uuid: string;
1108
- publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
1109
- type?: string;
1110
- identification?: OchreIdentification;
1111
- rend?: "inline";
1112
- content?: FakeString;
1113
- heightPreview?: number;
1114
- widthPreview?: number;
1115
- height?: number;
1116
- width?: number;
1117
- href?: string;
1118
- isPrimary?: boolean;
1119
- };
1120
-
1121
- /**
1122
- * Raw link structure corresponding to the parsed Link type
1123
- */
1124
- type OchreLink = {
1125
- resource: OchreLinkItem | Array<OchreLinkItem>;
1126
- } | {
1127
- spatialUnit: OchreLinkItem | Array<OchreLinkItem>;
1128
- } | {
1129
- concept: OchreLinkItem | Array<OchreLinkItem>;
1130
- } | {
1131
- set: OchreLinkItem | Array<OchreLinkItem>;
1132
- } | {
1133
- tree: OchreLinkItem | Array<OchreLinkItem>;
1134
- } | {
1135
- person: OchreLinkItem | Array<OchreLinkItem>;
1136
- } | {
1137
- epigraphicUnit: OchreLinkItem | Array<OchreLinkItem>;
1138
- } | {
1139
- bibliography: OchreBibliography | Array<OchreBibliography>;
1140
- } | {
1141
- propertyValue: OchreLinkItem | Array<OchreLinkItem>;
1142
- };
1143
-
1144
- /**
1145
- * Raw image structure corresponding to the parsed Image type
1146
- */
1147
- type OchreImage = {
1148
- publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
1149
- identification?: OchreIdentification;
1150
- href?: string;
1151
- htmlImgSrcPrefix?: string;
1152
- content?: FakeString;
1153
- widthPreview?: number;
1154
- heightPreview?: number;
1155
- width?: number;
1156
- height?: number;
1157
- };
1158
-
1159
- /**
1160
- * Raw bibliography structure corresponding to the parsed Bibliography type
1161
- */
1162
- type OchreBibliography = {
1163
- uuid: string;
1164
- publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
1165
- type?: string;
1166
- n?: number;
1167
- identification?: OchreIdentification;
1168
- project?: {
1169
- identification: OchreIdentification;
1170
- };
1171
- context?: OchreContext;
1172
- sourceDocument?: {
1173
- uuid: string;
1174
- content: FakeString;
1175
- };
1176
- publicationInfo?: {
1177
- publishers?: {
1178
- publishers: {
1179
- person: OchrePerson | Array<OchrePerson>;
1180
- };
1181
- };
1182
- startDate?: {
1183
- month: number;
1184
- year: number;
1185
- day: number;
1186
- };
1187
- };
1188
- entryInfo?: {
1189
- startIssue: FakeString;
1190
- startVolume: FakeString;
1191
- };
1192
- citationFormat?: string;
1193
- citationFormatSpan?: {
1194
- span: {
1195
- content: FakeString;
1196
- };
1197
- } | {
1198
- "default:span": {
1199
- content: FakeString;
1200
- };
1201
- };
1202
- referenceFormatDiv?: {
1203
- div: {
1204
- div: {
1205
- class: string;
1206
- content: FakeString;
1207
- };
1208
- style: string;
1209
- class: string;
1210
- };
1211
- } | {
1212
- "default:div": {
1213
- "default:div": {
1214
- class: string;
1215
- content: FakeString;
1216
- };
1217
- style: string;
1218
- class: string;
1219
- };
1220
- };
1221
- source?: {
1222
- resource: Pick<OchreResource, "uuid" | "type" | "publicationDateTime" | "identification">;
1223
- };
1224
- periods?: {
1225
- period: OchrePeriod | Array<OchrePeriod>;
1226
- };
1227
- authors?: {
1228
- person: OchrePerson | Array<OchrePerson>;
1229
- };
1230
- properties?: {
1231
- property: OchreProperty | Array<OchreProperty>;
1232
- };
1233
- };
1234
-
1235
- /**
1236
- * Raw note structure corresponding to the parsed Note type
1237
- */
1238
- type OchreNote = string | {
1239
- noteNo: number;
1240
- content: OchreStringRichText | Array<OchreStringRichText>;
1241
- };
1242
-
1243
- /**
1244
- * Raw period structure corresponding to the parsed Period type
1245
- */
1246
- type OchrePeriod = {
1247
- uuid: string;
1248
- publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
1249
- type?: string;
1250
- n?: number;
1251
- identification: OchreIdentification;
1252
- description?: OchreStringContent;
1253
- };
1254
-
1255
- /**
1256
- * Raw image map area structure corresponding to the parsed ImageMapArea type
1257
- */
1258
- type OchreImageMapArea = {
1259
- uuid: string;
1260
- publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
1261
- type: string;
1262
- title: FakeString;
1263
- shape: "rect" | "poly";
1264
- coords: string; // comma separated list of numbers
1265
- };
1266
-
1267
- /**
1268
- * Raw image map structure corresponding to the parsed ImageMap type
1269
- */
1270
- type OchreImageMap = {
1271
- area: OchreImageMapArea | Array<OchreImageMapArea>;
1272
- width: number;
1273
- height: number;
1274
- };
1275
-
1276
- /**
1277
- * Raw context structure corresponding to the parsed Context type
1278
- */
1279
- type OchreContext = {
1280
- context: OchreContextValue | Array<OchreContextValue>;
1281
- displayPath: string;
1282
- };
1283
-
1284
- /**
1285
- * Raw context value structure containing tree, project and spatial unit information
1286
- */
1287
- type OchreContextValue = {
1288
- tree: OchreContextItem;
1289
- project: OchreContextItem;
1290
- spatialUnit?: OchreContextItem | Array<OchreContextItem>;
1291
- displayPath: string;
1292
- };
1293
-
1294
- /**
1295
- * Raw context item structure corresponding to the parsed ContextItem type
1296
- */
1297
- type OchreContextItem = {
1298
- uuid: string;
1299
- publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
1300
- n: number; // negative number
1301
- content: FakeString;
1302
- };
1303
-
1304
- /**
1305
- * Raw person structure corresponding to the parsed Person type
1306
- */
1307
- type OchrePerson = {
1308
- uuid: string;
1309
- publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
1310
- type?: string;
1311
- date?: string; // YYYY-MM-DD
1312
- identification?: OchreIdentification;
1313
- n?: number;
1314
- context?: OchreContext;
1315
- availability?: OchreLicense;
1316
- address?: {
1317
- country?: string;
1318
- city?: string;
1319
- state?: string;
1320
- };
1321
- coordinates?: OchreCoordinates;
1322
- content?: FakeString | null;
1323
- events?: {
1324
- event: OchreEvent | Array<OchreEvent>;
1325
- };
1326
- properties?: {
1327
- property: OchreProperty | Array<OchreProperty>;
1328
- };
1329
- };
1330
-
1331
- /**
1332
- * Raw observation structure corresponding to the parsed Observation type
1333
- */
1334
- type OchreObservation = {
1335
- observationNo: number;
1336
- date?: string; // YYYY-MM-DD
1337
- observers?: FakeString;
1338
- notes?: {
1339
- note: OchreNote | Array<OchreNote>;
1340
- };
1341
- links?: OchreLink | Array<OchreLink>;
1342
- properties?: {
1343
- property: OchreProperty | Array<OchreProperty>;
1344
- };
1345
- };
1346
-
1347
- /**
1348
- * Raw coordinates structure corresponding to the parsed Coordinates type
1349
- */
1350
- type OchreCoordinates = {
1351
- latitude: number;
1352
- longitude: number;
1353
- elevation?: number;
1354
- coordinatesArray?: string;
1355
- coord?: {
1356
- coordLatitude: number;
1357
- coordLongitude: number;
1358
- coordType: string;
1359
- coordLabel: FakeString;
1360
- arrayString: string;
1361
- uuid: string;
1362
- };
1363
- };
1364
-
1365
- /**
1366
- * Raw event structure corresponding to the parsed Event type
1367
- */
1368
- type OchreEvent = {
1369
- dateTime?: string; // YYYY-MM-DD
1370
- agent?: {
1371
- uuid: string;
1372
- content: FakeString;
1373
- };
1374
- comment?: FakeString;
1375
- label: OchreStringContent;
1376
- };
1377
-
1378
- /**
1379
- * Raw interpretation structure corresponding to the parsed Interpretation type
1380
- */
1381
- type OchreInterpretation = {
1382
- date: string; // YYYY-MM-DD
1383
- interpretationNo: number;
1384
- properties?: {
1385
- property: OchreProperty | Array<OchreProperty>;
1386
- };
1387
- };
1388
-
1389
- /**
1390
- * Raw property value structure corresponding to the parsed PropertyValue type
1391
- */
1392
- type OchrePropertyValue = {
1393
- uuid: string;
1394
- publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
1395
- n: number;
1396
- context?: OchreContext;
1397
- availability?: OchreLicense;
1398
- identification: OchreIdentification;
1399
- date?: string; // YYYY-MM-DD
1400
- creators?: {
1401
- creator: OchrePerson | Array<OchrePerson>;
1402
- };
1403
- description?: OchreStringContent | FakeString;
1404
- notes?: {
1405
- note: OchreNote | Array<OchreNote>;
1406
- };
1407
- links?: OchreLink | Array<OchreLink>;
1408
- };
1409
-
1410
- //#endregion
1411
- //#region src/utils/fetchers/uuid.d.ts
1412
- /**
1413
- * Raw gallery response structure
1414
- */
1415
- /**
1416
- * Fetches raw OCHRE data by UUID from the OCHRE API
1417
- *
1418
- * @param uuid - The UUID of the OCHRE item to fetch
1419
- * @returns A tuple containing either [null, OchreData] on success or [error message, null] on failure
1420
- *
1421
- * @example
1422
- * ```ts
1423
- * const [error, data] = await fetchByUuid("123e4567-e89b-12d3-a456-426614174000");
1424
- * if (error !== null) {
1425
- * console.error(`Failed to fetch: ${error}`);
1426
- * return;
1427
- * }
1428
- * // Process data...
1429
- * ```
1430
- *
1431
- * @internal
1432
- */
1433
- declare function fetchByUuid(uuid: string): Promise<[null, OchreData] | [string, null]>;
1434
-
1435
744
  //#endregion
1436
745
  //#region src/utils/fetchers/website.d.ts
1437
746
  /**
@@ -1568,296 +877,4 @@ declare function filterProperties(property: Property, filter: {
1568
877
  }, options?: PropertyOptions): boolean;
1569
878
 
1570
879
  //#endregion
1571
- //#region src/utils/parse.d.ts
1572
- /**
1573
- * Parses raw identification data into the standardized Identification type
1574
- *
1575
- * @param identification - Raw identification data from OCHRE format
1576
- * @returns Parsed Identification object with label and abbreviation
1577
- */
1578
- declare function parseIdentification(identification: OchreIdentification): Identification;
1579
- /**
1580
- * Parses raw language data into an array of language codes
1581
- *
1582
- * @param language - Raw language data, either single or array
1583
- * @returns Array of language codes as strings
1584
- */
1585
- declare function parseLanguages(language: OchreLanguage | Array<OchreLanguage> | undefined): Array<string>;
1586
- /**
1587
- * Parses raw metadata into the standardized Metadata type
1588
- *
1589
- * @param metadata - Raw metadata from OCHRE format
1590
- * @returns Parsed Metadata object
1591
- */
1592
- declare function parseMetadata(metadata: OchreMetadata): Metadata;
1593
- /**
1594
- * Parses raw context data into the standardized Context type
1595
- *
1596
- * @param context - Raw context data from OCHRE format
1597
- * @returns Parsed Context object
1598
- */
1599
- declare function parseContext(context: OchreContext): Context;
1600
- /**
1601
- * Parses raw license data into the standardized License type
1602
- *
1603
- * @param license - Raw license data from OCHRE format
1604
- * @returns Parsed License object or null if invalid
1605
- */
1606
- declare function parseLicense(license: OchreLicense): License | null;
1607
- /**
1608
- * Parses raw person data into the standardized Person type
1609
- *
1610
- * @param person - Raw person data from OCHRE format
1611
- * @returns Parsed Person object
1612
- */
1613
- declare function parsePerson(person: OchrePerson): Person;
1614
- /**
1615
- * Parses raw person data into the standardized Person type
1616
- *
1617
- * @param persons - Array of raw person data from OCHRE format
1618
- * @returns Array of parsed Person objects
1619
- */
1620
- declare function parsePersons(persons: Array<OchrePerson>): Array<Person>;
1621
- /**
1622
- * Parses an array of raw links into standardized Link objects
1623
- *
1624
- * @param linkRaw - Raw OCHRE link
1625
- * @returns Parsed Link object
1626
- */
1627
- declare function parseLink(linkRaw: OchreLink): Array<Link>;
1628
- /**
1629
- * Parses an array of raw links into standardized Link objects
1630
- *
1631
- * @param links - Array of raw OCHRE links
1632
- * @returns Array of parsed Link objects
1633
- */
1634
- declare function parseLinks(links: Array<OchreLink>): Array<Link>;
1635
- /**
1636
- * Parses raw document content into a standardized Document structure
1637
- *
1638
- * @param document - Raw document content in OCHRE format
1639
- * @param language - Language code to use for content selection (defaults to "eng")
1640
- * @returns Parsed Document object with content and footnotes
1641
- */
1642
- declare function parseDocument(document: OchreStringRichText | Array<OchreStringRichText>, language?: string): Document;
1643
- /**
1644
- * Parses raw image data into a standardized Image structure
1645
- *
1646
- * @param image - Raw image data in OCHRE format
1647
- * @returns Parsed Image object or null if invalid
1648
- */
1649
- declare function parseImage(image: OchreImage): Image | null;
1650
- /**
1651
- * Parses raw notes into standardized Note objects
1652
- *
1653
- * @param notes - Array of raw notes in OCHRE format
1654
- * @param language - Language code for content selection (defaults to "eng")
1655
- * @returns Array of parsed Note objects
1656
- */
1657
- declare function parseNotes(notes: Array<OchreNote>, language?: string): Array<Note>;
1658
- /**
1659
- * Parses raw coordinates data into a standardized Coordinates structure
1660
- *
1661
- * @param coordinates - Raw coordinates data in OCHRE format
1662
- * @returns Parsed Coordinates object
1663
- */
1664
- declare function parseCoordinates(coordinates: OchreCoordinates | string): Coordinates;
1665
- /**
1666
- * Parses a raw observation into a standardized Observation structure
1667
- *
1668
- * @param observation - Raw observation data in OCHRE format
1669
- * @returns Parsed Observation object
1670
- */
1671
- declare function parseObservation(observation: OchreObservation): Observation;
1672
- /**
1673
- * Parses an array of raw observations into standardized Observation objects
1674
- *
1675
- * @param observations - Array of raw observations in OCHRE format
1676
- * @returns Array of parsed Observation objects
1677
- */
1678
- declare function parseObservations(observations: Array<OchreObservation>): Array<Observation>;
1679
- /**
1680
- * Parses an array of raw events into standardized Event objects
1681
- *
1682
- * @param events - Array of raw events in OCHRE format
1683
- * @returns Array of parsed Event objects
1684
- */
1685
- declare function parseEvents(events: Array<OchreEvent>): Array<Event>;
1686
- declare function parseProperty(property: OchreProperty, language?: string): Property;
1687
- /**
1688
- * Parses raw properties into standardized Property objects
1689
- *
1690
- * @param properties - Array of raw properties in OCHRE format
1691
- * @param language - Language code for content selection (defaults to "eng")
1692
- * @returns Array of parsed Property objects
1693
- */
1694
- declare function parseProperties(properties: Array<OchreProperty>, language?: string): Array<Property>;
1695
- /**
1696
- * Parses raw interpretations into standardized Interpretation objects
1697
- *
1698
- * @param interpretations - Array of raw interpretations in OCHRE format
1699
- * @returns Array of parsed Interpretation objects
1700
- */
1701
- declare function parseInterpretations(interpretations: Array<OchreInterpretation>): Array<Interpretation>;
1702
- /**
1703
- * Parses raw image map data into a standardized ImageMap structure
1704
- *
1705
- * @param imageMap - Raw image map data in OCHRE format
1706
- * @returns Parsed ImageMap object
1707
- */
1708
- declare function parseImageMap(imageMap: OchreImageMap): ImageMap;
1709
- /**
1710
- * Parses raw period data into a standardized Period structure
1711
- *
1712
- * @param period - Raw period data in OCHRE format
1713
- * @returns Parsed Period object
1714
- */
1715
- declare function parsePeriod(period: OchrePeriod): Period;
1716
- /**
1717
- * Parses an array of raw periods into standardized Period objects
1718
- *
1719
- * @param periods - Array of raw periods in OCHRE format
1720
- * @returns Array of parsed Period objects
1721
- */
1722
- declare function parsePeriods(periods: Array<OchrePeriod>): Array<Period>;
1723
- /**
1724
- * Parses raw bibliography data into a standardized Bibliography structure
1725
- *
1726
- * @param bibliography - Raw bibliography data in OCHRE format
1727
- * @returns Parsed Bibliography object
1728
- */
1729
- declare function parseBibliography(bibliography: OchreBibliography): Bibliography;
1730
- /**
1731
- * Parses an array of raw bibliographies into standardized Bibliography objects
1732
- *
1733
- * @param bibliographies - Array of raw bibliographies in OCHRE format
1734
- * @returns Array of parsed Bibliography objects
1735
- */
1736
- declare function parseBibliographies(bibliographies: Array<OchreBibliography>): Array<Bibliography>;
1737
- /**
1738
- * Parses raw property value data into a standardized PropertyValue structure
1739
- *
1740
- * @param propertyValue - Raw property value data in OCHRE format
1741
- * @returns Parsed PropertyValue object
1742
- */
1743
- declare function parsePropertyValue(propertyValue: OchrePropertyValue): PropertyValue;
1744
- /**
1745
- * Parses an array of raw property values into standardized PropertyValue objects
1746
- *
1747
- * @param propertyValues - Array of raw property values in OCHRE format
1748
- * @returns Array of parsed PropertyValue objects
1749
- */
1750
- declare function parsePropertyValues(propertyValues: Array<OchrePropertyValue>): Array<PropertyValue>;
1751
- /**
1752
- * Parses a raw tree structure into a standardized Tree object
1753
- *
1754
- * @param tree - Raw tree data in OCHRE format
1755
- * @returns Parsed Tree object or null if invalid
1756
- */
1757
- declare function parseTree(tree: OchreTree): Tree;
1758
- /**
1759
- * Parses raw set data into a standardized Set structure
1760
- *
1761
- * @param set - Raw set data in OCHRE format
1762
- * @returns Parsed Set object
1763
- */
1764
- declare function parseSet<T extends DataCategory>(set: OchreSet, itemCategory?: T): Set<T>;
1765
- /**
1766
- * Parses raw resource data into a standardized Resource structure
1767
- *
1768
- * @param resource - Raw resource data in OCHRE format
1769
- * @returns Parsed Resource object
1770
- */
1771
- declare function parseResource(resource: OchreResource): Resource;
1772
- /**
1773
- * Parses raw resource data into a standardized Resource structure
1774
- *
1775
- * @param resources - Raw resource data in OCHRE format
1776
- * @returns Parsed Resource object
1777
- */
1778
- declare function parseResources(resources: Array<OchreResource>): Array<Resource>;
1779
- /**
1780
- * Parses raw spatial units into standardized SpatialUnit objects
1781
- *
1782
- * @param spatialUnit - Raw spatial unit in OCHRE format
1783
- * @returns Parsed SpatialUnit object
1784
- */
1785
- declare function parseSpatialUnit(spatialUnit: OchreSpatialUnit): SpatialUnit;
1786
- /**
1787
- * Parses an array of raw spatial units into standardized SpatialUnit objects
1788
- *
1789
- * @param spatialUnits - Array of raw spatial units in OCHRE format
1790
- * @returns Array of parsed SpatialUnit objects
1791
- */
1792
- declare function parseSpatialUnits(spatialUnits: Array<OchreSpatialUnit>): Array<SpatialUnit>;
1793
- /**
1794
- * Parses a raw concept into a standardized Concept object
1795
- *
1796
- * @param concept - Raw concept data in OCHRE format
1797
- * @returns Parsed Concept object
1798
- */
1799
- declare function parseConcept(concept: OchreConcept): Concept;
1800
- /**
1801
- * Parses raw concept data into standardized Concept objects
1802
- *
1803
- * @param concepts - Array of raw concept data in OCHRE format
1804
- * @returns Array of parsed Concept objects
1805
- */
1806
- declare function parseConcepts(concepts: Array<OchreConcept>): Array<Concept>;
1807
- declare function parseWebsite(websiteTree: OchreTree, projectName: FakeString, website: FakeString | null): Promise<Website>;
1808
-
1809
- //#endregion
1810
- //#region src/utils/string.d.ts
1811
- /**
1812
- * Parses email addresses in a string into HTML links
1813
- *
1814
- * @param string - Input string to parse
1815
- * @returns String with emails converted to HTML links
1816
- *
1817
- * @example
1818
- * ```ts
1819
- * const parsed = parseEmail("Contact us at info@example.com");
1820
- * // Returns: "Contact us at <ExternalLink href="mailto:info@example.com">info@example.com</ExternalLink>"
1821
- * ```
1822
- */
1823
- declare function parseEmail(string: string): string;
1824
- /**
1825
- * Converts a FakeString (string|number|boolean) to a proper string
1826
- *
1827
- * @param string - FakeString value to convert
1828
- * @returns Converted string value
1829
- *
1830
- * @example
1831
- * ```ts
1832
- * parseFakeString(true); // Returns "Yes"
1833
- * parseFakeString(123); // Returns "123"
1834
- * parseFakeString("test"); // Returns "test"
1835
- * ```
1836
- */
1837
- declare function parseFakeString(string: FakeString): string;
1838
- /**
1839
- * Parses an OchreStringItem into a formatted string
1840
- *
1841
- * @param item - OchreStringItem to parse
1842
- * @returns Formatted string with applied rendering and whitespace
1843
- */
1844
- declare function parseStringItem(item: OchreStringItem): string;
1845
- /**
1846
- * Parses rich text content into a formatted string with links and annotations
1847
- *
1848
- * @param item - Rich text item to parse
1849
- * @param footnotes - Optional array to collect footnotes during parsing
1850
- * @returns Formatted string with HTML/markdown elements
1851
- */
1852
- declare function parseStringDocumentItem(item: OchreStringRichTextItem, footnotes?: Array<Footnote>): string;
1853
- /**
1854
- * Parses raw string content into a formatted string
1855
- *
1856
- * @param content - Raw string content to parse
1857
- * @param language - Optional language code for content selection (defaults to "eng")
1858
- * @returns Parsed and formatted string
1859
- */
1860
- declare function parseStringContent(content: OchreStringContent, language?: string): string;
1861
-
1862
- //#endregion
1863
- export { Bibliography, Concept, Context, ContextItem, ContextNode, Coordinates, Data, DataCategory, Document, Event, Footnote, Gallery, Identification, Image, ImageMap, ImageMapArea, Interpretation, License, Link, Metadata, Note, Observation, Period, Person, Property, PropertyValue, PropertyValueContent, PropertyValueContentType, Resource, Set, SpatialUnit, Style, Tree, WebBlock, WebElement, WebElementComponent, WebImage, WebSectionSidebarItem, Webpage, WebpageProperties, Website, WebsiteProperties, fetchByUuid, fetchGallery, fetchItem, fetchWebsite, filterProperties, getPropertyByLabel, getPropertyValueByLabel, getPropertyValuesByLabel, getUniqueProperties, parseBibliographies, parseBibliography, parseConcept, parseConcepts, parseContext, parseCoordinates, parseDocument, parseEmail, parseEvents, parseFakeString, parseIdentification, parseImage, parseImageMap, parseInterpretations, parseLanguages, parseLicense, parseLink, parseLinks, parseMetadata, parseNotes, parseObservation, parseObservations, parsePeriod, parsePeriods, parsePerson, parsePersons, parseProperties, parseProperty, parsePropertyValue, parsePropertyValues, parseResource, parseResources, parseSet, parseSpatialUnit, parseSpatialUnits, parseStringContent, parseStringDocumentItem, parseStringItem, parseTree, parseWebsite };
880
+ 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, fetchGallery, fetchItem, fetchWebsite, filterProperties, getPropertyByLabel, getPropertyValueByLabel, getPropertyValuesByLabel, getUniqueProperties };