@digitalculture/ochre-sdk 0.7.13 → 0.7.15

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