ochre-sdk 1.3.24 → 1.3.26

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.
Files changed (97) hide show
  1. package/dist/categories.d.mts +56 -56
  2. package/dist/categories.mjs +39 -39
  3. package/dist/constants.d.mts +8 -8
  4. package/dist/constants.mjs +6 -6
  5. package/dist/errors.d.mts +12 -12
  6. package/dist/errors.mjs +22 -23
  7. package/dist/fetchers/container-items.d.mts +28 -28
  8. package/dist/fetchers/container-items.mjs +27 -27
  9. package/dist/fetchers/gallery.d.mts +13 -13
  10. package/dist/fetchers/gallery.mjs +2 -2
  11. package/dist/fetchers/item-children.d.mts +12 -12
  12. package/dist/fetchers/item-children.mjs +2 -2
  13. package/dist/fetchers/item-links.d.mts +10 -10
  14. package/dist/fetchers/item-links.mjs +6 -6
  15. package/dist/fetchers/item-locations.d.mts +20 -20
  16. package/dist/fetchers/item-locations.mjs +3 -3
  17. package/dist/fetchers/item-ocr-data.d.mts +23 -23
  18. package/dist/fetchers/item-ocr-data.mjs +44 -44
  19. package/dist/fetchers/item.d.mts +14 -14
  20. package/dist/fetchers/item.mjs +14 -14
  21. package/dist/fetchers/map-layers.d.mts +15 -15
  22. package/dist/fetchers/map-layers.mjs +12 -11
  23. package/dist/fetchers/request.d.mts +40 -40
  24. package/dist/fetchers/request.mjs +37 -37
  25. package/dist/fetchers/set/items.d.mts +15 -15
  26. package/dist/fetchers/set/items.mjs +1 -1
  27. package/dist/fetchers/set/property-values.d.mts +16 -16
  28. package/dist/fetchers/set/property-values.mjs +43 -43
  29. package/dist/fetchers/tree/items.d.mts +27 -27
  30. package/dist/fetchers/tree/items.mjs +1 -1
  31. package/dist/fetchers/website-metadata.d.mts +4 -4
  32. package/dist/fetchers/website-metadata.mjs +9 -9
  33. package/dist/fetchers/website.d.mts +10 -10
  34. package/dist/fetchers/website.mjs +12 -12
  35. package/dist/getters.d.mts +83 -83
  36. package/dist/getters.mjs +74 -74
  37. package/dist/helpers.d.mts +4 -4
  38. package/dist/helpers.mjs +7 -7
  39. package/dist/index.d.mts +3 -3
  40. package/dist/index.mjs +5 -5
  41. package/dist/languages.d.mts +58 -58
  42. package/dist/languages.mjs +21 -21
  43. package/dist/ocr.d.mts +27 -27
  44. package/dist/ocr.mjs +29 -29
  45. package/dist/parsers/helpers.d.mts +23 -23
  46. package/dist/parsers/helpers.mjs +8 -8
  47. package/dist/parsers/index.d.mts +2 -2
  48. package/dist/parsers/index.mjs +15 -15
  49. package/dist/parsers/languages.d.mts +49 -49
  50. package/dist/parsers/languages.mjs +49 -49
  51. package/dist/parsers/multilingual.d.mts +174 -174
  52. package/dist/parsers/multilingual.mjs +146 -146
  53. package/dist/parsers/partial-date.d.mts +12 -12
  54. package/dist/parsers/partial-date.mjs +11 -11
  55. package/dist/parsers/property-token.d.mts +20 -20
  56. package/dist/parsers/property-token.mjs +16 -16
  57. package/dist/parsers/string.d.mts +33 -33
  58. package/dist/parsers/string.mjs +62 -64
  59. package/dist/parsers/website/bounds.d.mts +6 -6
  60. package/dist/parsers/website/bounds.mjs +5 -5
  61. package/dist/parsers/website/components.d.mts +50 -31
  62. package/dist/parsers/website/components.mjs +79 -51
  63. package/dist/parsers/website/index.d.mts +1 -1
  64. package/dist/parsers/website/index.mjs +43 -47
  65. package/dist/parsers/website/links.d.mts +24 -24
  66. package/dist/parsers/website/links.mjs +18 -18
  67. package/dist/parsers/website/messages.d.mts +16 -16
  68. package/dist/parsers/website/messages.mjs +14 -14
  69. package/dist/parsers/website/options.d.mts +1 -1
  70. package/dist/parsers/website/properties.d.mts +17 -8
  71. package/dist/parsers/website/properties.mjs +23 -11
  72. package/dist/parsers/website/reader.d.mts +55 -46
  73. package/dist/parsers/website/reader.mjs +64 -46
  74. package/dist/parsers/website/slug.d.mts +50 -50
  75. package/dist/parsers/website/slug.mjs +36 -36
  76. package/dist/parsers/website/styles.d.mts +18 -18
  77. package/dist/parsers/website/styles.mjs +19 -19
  78. package/dist/parsers/website/walk.d.mts +46 -46
  79. package/dist/parsers/website/walk.mjs +34 -34
  80. package/dist/query.d.mts +63 -63
  81. package/dist/query.mjs +137 -140
  82. package/dist/reflection.d.mts +51 -51
  83. package/dist/reflection.mjs +45 -45
  84. package/dist/schemas.d.mts +44 -44
  85. package/dist/schemas.mjs +50 -50
  86. package/dist/types/index.d.mts +192 -192
  87. package/dist/types/utilities.d.mts +5 -5
  88. package/dist/types/website.d.mts +67 -62
  89. package/dist/xml/dates.d.mts +9 -9
  90. package/dist/xml/dates.mjs +9 -9
  91. package/dist/xml/metadata.d.mts +14 -14
  92. package/dist/xml/metadata.mjs +18 -18
  93. package/dist/xml/schemas.mjs +24 -24
  94. package/dist/xml/types.d.mts +9 -9
  95. package/dist/xquery.d.mts +49 -49
  96. package/dist/xquery.mjs +50 -50
  97. package/package.json +10 -10
@@ -1,47 +1,47 @@
1
1
  import { MultilingualString, MultilingualStringText } from "./multilingual.mjs";
2
2
  import { XMLContent, XMLString } from "../xml/types.mjs";
3
3
  /**
4
- * Rewrite a permanent identification URL as an OCHRE API endpoint
5
- *
6
- * The counterpart of {@link transformPermanentIdentificationUrlToItemLink}:
7
- * the same prefix becomes an API call here and a route into a consuming
8
- * website there, so which one a caller wants depends on who reads the result.
9
- * @param url - The permanent identification URL
10
- * @returns The API URL
11
- * @internal
12
- */
4
+ Rewrite a permanent identification URL as an OCHRE API endpoint
5
+
6
+ The counterpart of {@link transformPermanentIdentificationUrlToItemLink}:
7
+ the same prefix becomes an API call here and a route into a consuming
8
+ website there, so which one a caller wants depends on who reads the result.
9
+ @param url - The permanent identification URL
10
+ @returns The API URL
11
+ @internal
12
+ */
13
13
  export declare function transformPermanentIdentificationUrl(url: string): string;
14
14
  /**
15
- * Rewrite a permanent identification URL as a website item route
16
- * @param url - The permanent identification URL
17
- * @returns The item route
18
- * @internal
19
- */
15
+ Rewrite a permanent identification URL as a website item route
16
+ @param url - The permanent identification URL
17
+ @returns The item route
18
+ @internal
19
+ */
20
20
  export declare function transformPermanentIdentificationUrlToItemLink(url: string): string;
21
21
  export declare function parseXMLString(string: XMLString): MultilingualStringText;
22
22
  /**
23
- * Parses rich text content into a formatted string with links and annotations
24
- *
25
- * @param item - XML-based rich text item to parse
26
- * @param options - Options for parsing
27
- * @param options.languages - Languages of the content
28
- * @param options.defaultLanguage - The language the dataset declares as its default
29
- * @returns Plain and rich formatted strings
30
- *
31
- * @internal
32
- */
23
+ Parses rich text content into a formatted string with links and annotations
24
+
25
+ @param item - XML-based rich text item to parse
26
+ @param options - Options for parsing
27
+ @param options.languages - Languages of the content
28
+ @param options.defaultLanguage - The language the dataset declares as its default
29
+ @returns Plain and rich formatted strings
30
+
31
+ @internal
32
+ */
33
33
  export declare function parseXMLContent<V extends ReadonlyArray<string>>(item: XMLContent, options: {
34
34
  languages: V;
35
35
  defaultLanguage?: V[number];
36
36
  }): MultilingualString<V>;
37
37
  /**
38
- * Extracts alias strings from XMLContent where lang="zxx"
39
- *
40
- * They are aliases only beside another language; parseXMLContent reads
41
- * `zxx` content standing alone as non-linguistic text instead.
42
- * @param content - The XMLContent to extract aliases from
43
- * @returns Array of alias strings, or null if none found
44
- *
45
- * @internal
46
- */
38
+ Extracts alias strings from XMLContent where lang="zxx"
39
+
40
+ They are aliases only beside another language; parseXMLContent reads
41
+ `zxx` content standing alone as non-linguistic text instead.
42
+ @param content - The XMLContent to extract aliases from
43
+ @returns Array of alias strings, or null if none found
44
+
45
+ @internal
46
+ */
47
47
  export declare function extractAliases(content: XMLContent | undefined): Array<string> | null;
@@ -1,10 +1,10 @@
1
1
  import { OCHRE_ENDPOINT, PERMANENT_IDENTIFICATION_URL_PREFIX, TEXT_ANNOTATION_UUID, getOchreItemUrl } from "../constants.mjs";
2
2
  import { normalizePropertyVariableLabel } from "../getters.mjs";
3
- import { getXMLSourceIndex } from "../xml/metadata.mjs";
4
3
  import { serializeMDXContent, serializeMDXText } from "./mdx.mjs";
5
4
  import { MultilingualString } from "./multilingual.mjs";
6
5
  import { readPropertyValueText, readPropertyValueUuid } from "./property-token.mjs";
7
6
  import { renderOptionsSchema } from "../schemas.mjs";
7
+ import { getXMLSourceIndex } from "../xml/metadata.mjs";
8
8
  import * as v from "valibot";
9
9
  // src/parsers/string.ts
10
10
  const TEXT_ANNOTATION_TOKEN = "text-annotation";
@@ -32,35 +32,35 @@ function getLinkStringProperty(link, property) {
32
32
  }
33
33
  }
34
34
  /**
35
- * Rewrite a permanent identification URL as an OCHRE API endpoint
36
- *
37
- * The counterpart of {@link transformPermanentIdentificationUrlToItemLink}:
38
- * the same prefix becomes an API call here and a route into a consuming
39
- * website there, so which one a caller wants depends on who reads the result.
40
- * @param url - The permanent identification URL
41
- * @returns The API URL
42
- * @internal
35
+ Rewrite a permanent identification URL as an OCHRE API endpoint
36
+
37
+ The counterpart of {@link transformPermanentIdentificationUrlToItemLink}:
38
+ the same prefix becomes an API call here and a route into a consuming
39
+ website there, so which one a caller wants depends on who reads the result.
40
+ @param url - The permanent identification URL
41
+ @returns The API URL
42
+ @internal
43
43
  */
44
44
  function transformPermanentIdentificationUrl(url) {
45
45
  return url.replace(PERMANENT_IDENTIFICATION_URL_PREFIX, () => `${OCHRE_ENDPOINT}?uuid=`);
46
46
  }
47
47
  /**
48
- * Rewrite a permanent identification URL as a website item route
49
- * @param url - The permanent identification URL
50
- * @returns The item route
51
- * @internal
48
+ Rewrite a permanent identification URL as a website item route
49
+ @param url - The permanent identification URL
50
+ @returns The item route
51
+ @internal
52
52
  */
53
53
  function transformPermanentIdentificationUrlToItemLink(url) {
54
54
  return url.replace(PERMANENT_IDENTIFICATION_URL_PREFIX, "/item/");
55
55
  }
56
56
  /**
57
- * Applies text rendering options (bold, italic, underline) to a string
58
- *
59
- * @param contentString - The string content to render
60
- * @param renderString - Space-separated string of render options
61
- * @param rendering - Which text rendering to produce
62
- * @returns String with rich-text formatting applied
63
- * @internal
57
+ Applies text rendering options (bold, italic, underline) to a string
58
+
59
+ @param contentString - The string content to render
60
+ @param renderString - Space-separated string of render options
61
+ @param rendering - Which text rendering to produce
62
+ @returns String with rich-text formatting applied
63
+ @internal
64
64
  */
65
65
  function parseRenderOptions(contentString, renderString, rendering) {
66
66
  const { success, output } = v.safeParse(renderOptionsSchema, renderString);
@@ -85,20 +85,19 @@ function applyMDXRenderElements(contentString, options) {
85
85
  return result;
86
86
  }
87
87
  function applyNewlineWhitespace(contentString, whitespace, rendering) {
88
- if (whitespace == null) return contentString;
89
- if (!whitespace.split(" ").includes("newline")) return contentString;
88
+ if (!whitespace?.split(" ").includes("newline")) return contentString;
90
89
  if (rendering === "rich") return contentString.trim() === "***" ? `${contentString}\n` : `<br />\n${contentString}`;
91
90
  return `\n${contentString}`;
92
91
  }
93
92
  /**
94
- * Parses XML string into a formatted string with rendering options
95
- *
96
- * @param string - XML string to parse
97
- * @param options - Options for parsing
98
- * @param options.rendering - Which text rendering to produce
99
- * @returns Formatted string with rendering options
100
- *
101
- * @internal
93
+ Parses XML string into a formatted string with rendering options
94
+
95
+ @param string - XML string to parse
96
+ @param options - Options for parsing
97
+ @param options.rendering - Which text rendering to produce
98
+ @returns Formatted string with rendering options
99
+
100
+ @internal
102
101
  */
103
102
  function parseXMLStringVariant(string, options) {
104
103
  let returnString = parseXMLStringPayload(string, options);
@@ -116,26 +115,26 @@ function parseXMLString(string) {
116
115
  };
117
116
  }
118
117
  /**
119
- * Creates an MDX component based on the variant
120
- *
121
- * @param variant - The variant of the component
122
- * @param properties - The properties of the component
123
- * @param properties.uuid - The UUID of the component
124
- * @param properties.href - The href of the component
125
- * @param properties.height - The height of the component
126
- * @param properties.width - The width of the component
127
- * @param properties.content - The content of the component
128
- * @param properties.text - The text of the component
129
- * @returns The MDX component as a string
130
- *
131
- * @internal
118
+ Creates an MDX component based on the variant
119
+
120
+ @param variant - The variant of the component
121
+ @param properties - The properties of the component
122
+ @param properties.uuid - The UUID of the component
123
+ @param properties.href - The href of the component
124
+ @param properties.height - The height of the component
125
+ @param properties.width - The width of the component
126
+ @param properties.content - The content of the component
127
+ @param properties.text - The text of the component
128
+ @returns The MDX component as a string
129
+
130
+ @internal
132
131
  */
133
132
  function createMDXComponent(variant, properties) {
134
- const { uuid, href, height, width, content, text } = properties;
133
+ const { uuid, href, height = "null", width = "null", content, text } = properties;
135
134
  let returnString = "";
136
135
  switch (variant) {
137
136
  case "inlineImage":
138
- returnString = `<InlineImage${createMDXStringAttribute("uuid", uuid ?? "null")}${createMDXStringAttribute("content", content)} height={${height ?? "null"}} width={${width ?? "null"}} />`;
137
+ returnString = `<InlineImage${createMDXStringAttribute("uuid", uuid ?? "null")}${createMDXStringAttribute("content", content)} height={${height}} width={${width}} />`;
139
138
  break;
140
139
  case "internalLink":
141
140
  returnString = `<InternalLink${createMDXStringAttribute("uuid", uuid ?? "null")}>${text}</InternalLink>`;
@@ -228,8 +227,7 @@ function extractAnnotationMetadata(item, options) {
228
227
  textStyling: null
229
228
  };
230
229
  const itemProperty = item.properties?.property[0];
231
- if (itemProperty == null) return result;
232
- if (!hasMatchingPropertyLabel(itemProperty, "f1c131b6-1498-48a4-95bf-a9edae9fd518", ["presentation"], options) || !hasMatchingPropertyValue(itemProperty, "b9ca2732-78f4-416e-b77f-dae7647e68a9", [TEXT_ANNOTATION_TOKEN], options)) return result;
230
+ if (itemProperty == null || !hasMatchingPropertyLabel(itemProperty, "f1c131b6-1498-48a4-95bf-a9edae9fd518", ["presentation"], options) || !hasMatchingPropertyValue(itemProperty, "b9ca2732-78f4-416e-b77f-dae7647e68a9", [TEXT_ANNOTATION_TOKEN], options)) return result;
233
231
  const textAnnotationProperties = itemProperty.property ?? [];
234
232
  for (const textAnnotationProperty of textAnnotationProperties) {
235
233
  if (hasMatchingPropertyValue(textAnnotationProperty, "c7f6a08a-f07b-49b6-bcb1-af485da3c58f", [HOVER_CARD_TOKEN], options)) {
@@ -424,15 +422,15 @@ function renderRichTextItem(item, linkString, contentItem, options) {
424
422
  return applyNewlineWhitespace(result, item.whitespace, rendering);
425
423
  }
426
424
  /**
427
- * Parses rich text content into a formatted string with links and annotations
428
- *
429
- * @param item - XML-based rich text item to parse
430
- * @param options - Options for parsing
431
- * @param options.languages - Languages of the content
432
- * @param options.defaultLanguage - The language the dataset declares as its default
433
- * @returns Plain and rich formatted strings
434
- *
435
- * @internal
425
+ Parses rich text content into a formatted string with links and annotations
426
+
427
+ @param item - XML-based rich text item to parse
428
+ @param options - Options for parsing
429
+ @param options.languages - Languages of the content
430
+ @param options.defaultLanguage - The language the dataset declares as its default
431
+ @returns Plain and rich formatted strings
432
+
433
+ @internal
436
434
  */
437
435
  function parseXMLContent(item, options) {
438
436
  const { languages } = options;
@@ -488,14 +486,14 @@ function parseXMLContentItem(contentItem, options) {
488
486
  };
489
487
  }
490
488
  /**
491
- * Extracts alias strings from XMLContent where lang="zxx"
492
- *
493
- * They are aliases only beside another language; parseXMLContent reads
494
- * `zxx` content standing alone as non-linguistic text instead.
495
- * @param content - The XMLContent to extract aliases from
496
- * @returns Array of alias strings, or null if none found
497
- *
498
- * @internal
489
+ Extracts alias strings from XMLContent where lang="zxx"
490
+
491
+ They are aliases only beside another language; parseXMLContent reads
492
+ `zxx` content standing alone as non-linguistic text instead.
493
+ @param content - The XMLContent to extract aliases from
494
+ @returns Array of alias strings, or null if none found
495
+
496
+ @internal
499
497
  */
500
498
  function extractAliases(content) {
501
499
  if (content == null) return null;
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Parses raw bounds data into a standardized bounds structure
3
- *
4
- * @param bounds - Raw bounds data in OCHRE format
5
- * @returns Parsed bounds object
6
- * @internal
7
- */
2
+ Parses raw bounds data into a standardized bounds structure
3
+
4
+ @param bounds - Raw bounds data in OCHRE format
5
+ @returns Parsed bounds object
6
+ @internal
7
+ */
8
8
  export declare function parseBounds(bounds: string): [[number, number], [number, number]];
@@ -1,10 +1,10 @@
1
1
  // src/parsers/website/bounds.ts
2
2
  /**
3
- * Parses raw bounds data into a standardized bounds structure
4
- *
5
- * @param bounds - Raw bounds data in OCHRE format
6
- * @returns Parsed bounds object
7
- * @internal
3
+ Parses raw bounds data into a standardized bounds structure
4
+
5
+ @param bounds - Raw bounds data in OCHRE format
6
+ @returns Parsed bounds object
7
+ @internal
8
8
  */
9
9
  function parseBounds(bounds) {
10
10
  const [southWest, northEast] = bounds.trimStart().startsWith("[") ? parseJsonBounds(bounds) : bounds.split(";").map((pair) => pair.split(",").map((coordinate) => Number(coordinate.trim())));
@@ -1,24 +1,43 @@
1
- import { WebElement, WebElementComponent, WebTitle } from "../../types/website.mjs";
2
- import { Identification, ItemLinks, SimplifiedProperty } from "../../types/index.mjs";
3
- import { XMLWebsiteResource } from "../../xml/types.mjs";
4
1
  import { ParserOptions } from "../helpers.mjs";
5
2
  import { WebsitePresentationReader } from "./reader.mjs";
6
3
  import { WebsitePageSlugs } from "./slug.mjs";
4
+ import { Identification, ItemLinks, SimplifiedProperty } from "../../types/index.mjs";
5
+ import { WebElement, WebElementComponent, WebTitle } from "../../types/website.mjs";
6
+ import { XMLWebsiteResource } from "../../xml/types.mjs";
7
+ /**
8
+ The component settings a website gives every element of a component, keyed
9
+ by component name, each reader falling back to the enclosing website's
10
+ */
11
+ export type WebComponentDefaults<T extends ReadonlyArray<string>> = ReadonlyMap<WebElementComponent["component"], WebsitePresentationReader<T>>;
12
+ /**
13
+ What the element parsers read from the enclosing website
14
+
15
+ Passed on its own rather than as a wider parse context, which keeps this
16
+ module reachable from a test without a whole OCHRE website envelope.
17
+ */
18
+ export type WebElementContext<T extends ReadonlyArray<string>> = {
19
+ pageSlugs?: WebsitePageSlugs;
20
+ componentDefaults: WebComponentDefaults<T>;
21
+ };
22
+ /**
23
+ Reads the "customize-special" "element" properties of a website, each
24
+ holding "component" properties whose settings every element of that
25
+ component starts from
26
+
27
+ @param websiteReader - Reader over the website's "presentation" properties
28
+ @param parent - The defaults of the enclosing website, which these extend
29
+ @returns The component defaults in effect for the website's elements
30
+ */
31
+ export declare function parseComponentDefaults<T extends ReadonlyArray<string>>(websiteReader: WebsitePresentationReader<T>, parent: WebComponentDefaults<T>): WebComponentDefaults<T>;
7
32
  /**
8
- * What every component parser is handed
9
- *
10
- * `pageSlugs` is the only thing the component, element and block parsers read
11
- * from the enclosing website, so it is passed on its own rather than as part
12
- * of a wider parse context. That keeps this module reachable from a test with
13
- * a six-field object instead of a whole OCHRE website envelope.
14
- */
15
- export type WebElementComponentParameters<T extends ReadonlyArray<string>> = {
33
+ What every component parser is handed
34
+ */
35
+ export type WebElementComponentParameters<T extends ReadonlyArray<string>> = WebElementContext<T> & {
16
36
  componentProperty: SimplifiedProperty<T>;
17
37
  componentReader: WebsitePresentationReader<T>;
18
38
  elementResource: XMLWebsiteResource;
19
39
  websiteLinks: ItemLinks<T>;
20
40
  options: ParserOptions<T>;
21
- pageSlugs: WebsitePageSlugs | undefined;
22
41
  };
23
42
  declare function parse3dViewerComponent<T extends ReadonlyArray<string>>(parameters: WebElementComponentParameters<T>): WebElementComponent<T>;
24
43
  declare function parseAdvancedSearchComponent<T extends ReadonlyArray<string>>(parameters: WebElementComponentParameters<T>): WebElementComponent<T>;
@@ -42,20 +61,20 @@ declare function parseTextComponent<T extends ReadonlyArray<string>>(parameters:
42
61
  declare function parseTimelineComponent<T extends ReadonlyArray<string>>(parameters: WebElementComponentParameters<T>): WebElementComponent<T>;
43
62
  declare function parseVideoComponent<T extends ReadonlyArray<string>>(parameters: WebElementComponentParameters<T>): WebElementComponent<T>;
44
63
  /**
45
- * Parses raw web element properties into a standardized WebElementComponent structure
46
- *
47
- * @param componentProperty - Raw component property data in OCHRE format
48
- * @param elementResource - Raw element resource data in OCHRE format
49
- * @returns Parsed WebElementComponent object
50
- */
64
+ Parses raw web element properties into a standardized WebElementComponent structure
65
+
66
+ @param componentProperty - Raw component property data in OCHRE format
67
+ @param elementResource - Raw element resource data in OCHRE format
68
+ @returns Parsed WebElementComponent object
69
+ */
51
70
  /**
52
- * The parser for each web element component, keyed by its OCHRE component name
53
- *
54
- * Every component parser takes the same {@link WebElementComponentParameters}
55
- * bag, so this is a table rather than a `switch`: a missing component is a type
56
- * error here instead of a runtime throw, and each parser can be exercised on
57
- * its own.
58
- */
71
+ The parser for each web element component, keyed by its OCHRE component name
72
+
73
+ Every component parser takes the same {@link WebElementComponentParameters}
74
+ bag, so this is a table rather than a `switch`: a missing component is a type
75
+ error here instead of a runtime throw, and each parser can be exercised on
76
+ its own.
77
+ */
59
78
  export declare const WEB_ELEMENT_COMPONENT_PARSERS: {
60
79
  readonly "3d-viewer": typeof parse3dViewerComponent;
61
80
  readonly "advanced-search": typeof parseAdvancedSearchComponent;
@@ -81,10 +100,10 @@ export declare const WEB_ELEMENT_COMPONENT_PARSERS: {
81
100
  };
82
101
  export declare function parseWebTitle<T extends ReadonlyArray<string>>(properties: Array<SimplifiedProperty<T>>, identification: Identification<T>, overrides?: Partial<WebTitle<T>["properties"]>): WebTitle<T>;
83
102
  /**
84
- * Parses raw web element data into a standardized WebElement structure
85
- *
86
- * @param elementResource - Raw element resource data in OCHRE format
87
- * @returns Parsed WebElement object
88
- */
89
- export declare function parseWebElement<T extends ReadonlyArray<string>>(elementResource: XMLWebsiteResource, options: ParserOptions<T>, pageSlugs: WebsitePageSlugs | undefined): WebElement<T>;
103
+ Parses raw web element data into a standardized WebElement structure
104
+
105
+ @param elementResource - Raw element resource data in OCHRE format
106
+ @returns Parsed WebElement object
107
+ */
108
+ export declare function parseWebElement<T extends ReadonlyArray<string>>(elementResource: XMLWebsiteResource, options: ParserOptions<T>, context: WebElementContext<T>): WebElement<T>;
90
109
  export {};