@umituz/web-seo 2.0.21 → 2.1.0

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 (103) hide show
  1. package/dist/domains/seo/components/JsonLd.d.ts +7 -6
  2. package/dist/domains/seo/components/JsonLd.js +26 -77
  3. package/dist/domains/seo/components/SEO.d.ts +7 -0
  4. package/dist/domains/seo/components/SEO.js +10 -33
  5. package/dist/domains/seo/core/constants.d.ts +15 -0
  6. package/dist/domains/seo/core/constants.js +15 -0
  7. package/dist/domains/seo/core/deep-equal.d.ts +8 -0
  8. package/dist/domains/seo/core/deep-equal.js +28 -0
  9. package/dist/domains/seo/core/dom-queue.d.ts +10 -0
  10. package/dist/domains/seo/core/dom-queue.js +37 -0
  11. package/dist/domains/seo/core/escape.d.ts +12 -0
  12. package/dist/domains/seo/core/escape.js +41 -0
  13. package/dist/domains/seo/core/hash.d.ts +9 -0
  14. package/dist/domains/seo/core/hash.js +29 -0
  15. package/dist/domains/seo/core/init.d.ts +15 -2
  16. package/dist/domains/seo/core/init.js +38 -18
  17. package/dist/domains/seo/core/seo-strategies.d.ts +29 -0
  18. package/dist/domains/seo/core/seo-strategies.js +694 -0
  19. package/dist/domains/seo/core/seo-strategy.d.ts +37 -0
  20. package/dist/domains/seo/core/seo-strategy.js +14 -0
  21. package/dist/domains/seo/hooks/useJsonLd.d.ts +6 -7
  22. package/dist/domains/seo/hooks/useJsonLd.js +27 -61
  23. package/dist/domains/seo/hooks/useSEO.d.ts +6 -0
  24. package/dist/domains/seo/hooks/useSEO.js +7 -29
  25. package/dist/domains/seo/ssr/helmet.d.ts +25 -0
  26. package/dist/domains/seo/ssr/helmet.js +23 -0
  27. package/dist/domains/seo/ssr/index.d.ts +10 -0
  28. package/dist/domains/seo/ssr/index.js +8 -0
  29. package/dist/domains/seo/ssr/renderer.d.ts +11 -36
  30. package/dist/domains/seo/ssr/renderer.js +51 -285
  31. package/dist/domains/seo/ssr/serializer.d.ts +5 -60
  32. package/dist/domains/seo/ssr/serializer.js +26 -166
  33. package/dist/domains/seo/types/index.d.ts +0 -4
  34. package/dist/domains/seo/types/schema.d.ts +22 -1
  35. package/dist/domains/seo/utils/dom/dom-context.d.ts +13 -0
  36. package/dist/domains/seo/utils/dom/dom-context.js +62 -0
  37. package/dist/domains/seo/utils/dom/dom-mutator.d.ts +31 -0
  38. package/dist/domains/seo/utils/dom/dom-mutator.js +89 -0
  39. package/dist/domains/seo/utils/dom/index.d.ts +1 -0
  40. package/dist/domains/seo/utils/dom/index.js +1 -0
  41. package/dist/domains/seo/utils/index.d.ts +3 -4
  42. package/dist/domains/seo/utils/index.js +3 -5
  43. package/dist/domains/seo/utils/schema-generators/base.d.ts +25 -0
  44. package/dist/domains/seo/utils/schema-generators/base.js +50 -0
  45. package/dist/domains/seo/utils/schema-generators/factory.d.ts +27 -0
  46. package/dist/domains/seo/utils/schema-generators/factory.js +49 -0
  47. package/dist/domains/seo/utils/schema-generators/generators/article.d.ts +4 -0
  48. package/dist/domains/seo/utils/schema-generators/generators/article.js +39 -0
  49. package/dist/domains/seo/utils/schema-generators/generators/breadcrumb.d.ts +6 -0
  50. package/dist/domains/seo/utils/schema-generators/generators/breadcrumb.js +18 -0
  51. package/dist/domains/seo/utils/schema-generators/generators/course.d.ts +3 -0
  52. package/dist/domains/seo/utils/schema-generators/generators/course.js +70 -0
  53. package/dist/domains/seo/utils/schema-generators/generators/faq.d.ts +3 -0
  54. package/dist/domains/seo/utils/schema-generators/generators/faq.js +21 -0
  55. package/dist/domains/seo/utils/schema-generators/generators/local-business.d.ts +3 -0
  56. package/dist/domains/seo/utils/schema-generators/generators/local-business.js +45 -0
  57. package/dist/domains/seo/utils/schema-generators/generators/organization.d.ts +3 -0
  58. package/dist/domains/seo/utils/schema-generators/generators/organization.js +25 -0
  59. package/dist/domains/seo/utils/schema-generators/generators/person.d.ts +3 -0
  60. package/dist/domains/seo/utils/schema-generators/generators/person.js +27 -0
  61. package/dist/domains/seo/utils/schema-generators/generators/product.d.ts +3 -0
  62. package/dist/domains/seo/utils/schema-generators/generators/product.js +40 -0
  63. package/dist/domains/seo/utils/schema-generators/generators/video.d.ts +3 -0
  64. package/dist/domains/seo/utils/schema-generators/generators/video.js +23 -0
  65. package/dist/domains/seo/utils/schema-generators/generators/website.d.ts +3 -0
  66. package/dist/domains/seo/utils/schema-generators/generators/website.js +30 -0
  67. package/dist/domains/seo/utils/schema-generators/index.d.ts +15 -2
  68. package/dist/domains/seo/utils/schema-generators/index.js +13 -2
  69. package/dist/domains/seo/utils/schema-generators/types.d.ts +142 -0
  70. package/dist/domains/seo/utils/schema-generators/types.js +5 -0
  71. package/dist/domains/seo/utils/validation/hreflang-validator.d.ts +7 -0
  72. package/dist/domains/seo/utils/validation/hreflang-validator.js +13 -0
  73. package/dist/domains/seo/utils/validation/image-validator.d.ts +7 -0
  74. package/dist/domains/seo/utils/validation/image-validator.js +24 -0
  75. package/dist/domains/seo/utils/validation/index.d.ts +10 -2
  76. package/dist/domains/seo/utils/validation/index.js +10 -2
  77. package/dist/domains/seo/utils/validation/jsonld-validator.d.ts +9 -0
  78. package/dist/domains/seo/utils/validation/jsonld-validator.js +74 -0
  79. package/dist/domains/seo/utils/validation/language-code.d.ts +7 -0
  80. package/dist/domains/seo/utils/validation/language-code.js +8 -0
  81. package/dist/domains/seo/utils/validation/length-validator.d.ts +10 -0
  82. package/dist/domains/seo/utils/validation/length-validator.js +40 -0
  83. package/dist/domains/seo/utils/validation/seo-auditor.d.ts +17 -0
  84. package/dist/domains/seo/utils/validation/seo-auditor.js +144 -0
  85. package/dist/domains/seo/utils/validation/text-helpers.d.ts +7 -0
  86. package/dist/domains/seo/utils/validation/text-helpers.js +12 -0
  87. package/dist/domains/seo/utils/validation/url-validator.d.ts +8 -0
  88. package/dist/domains/seo/utils/validation/url-validator.js +26 -0
  89. package/dist/domains/seo/vite/index.d.ts +6 -4
  90. package/dist/domains/seo/vite/index.js +5 -3
  91. package/dist/domains/seo/vite/plugin.d.ts +3 -55
  92. package/dist/domains/seo/vite/plugin.js +28 -186
  93. package/dist/domains/seo/vite/presets.d.ts +14 -0
  94. package/dist/domains/seo/vite/presets.js +33 -0
  95. package/dist/domains/seo/vite/robots-generator.d.ts +9 -0
  96. package/dist/domains/seo/vite/robots-generator.js +36 -0
  97. package/dist/domains/seo/vite/sitemap-generator.d.ts +15 -0
  98. package/dist/domains/seo/vite/sitemap-generator.js +56 -0
  99. package/dist/domains/seo/vite/types.d.ts +29 -0
  100. package/dist/domains/seo/vite/types.js +4 -0
  101. package/dist/index.d.ts +8 -7
  102. package/dist/index.js +7 -6
  103. package/package.json +1 -1
@@ -0,0 +1,37 @@
1
+ /**
2
+ * SEO rendering strategies.
3
+ *
4
+ * A strategy encapsulates one piece of SEO output (title, robots, OG tags,
5
+ * hreflang, etc.). The same strategy is consumed by:
6
+ * - `dom/dom-mutator.ts` – applies the change to the live DOM
7
+ * - `ssr/renderer.ts` – serializes the change to an HTML string
8
+ *
9
+ * This is the Strategy pattern: a list of small, focused objects, each
10
+ * responsible for one concern, dispatched by a single orchestrator. It
11
+ * eliminates the historical bug where SSR and the DOM output diverged
12
+ * (e.g. SSR dropped OG image width/height/type).
13
+ */
14
+ import type { SEOptions } from "../types/index.js";
15
+ /** Output for the DOM: a side-effect applied to `document.head`. */
16
+ export interface DOMContext {
17
+ /** Apply or update a `<meta>` tag. `undefined` content is a no-op. */
18
+ setMeta: (name: string, content: string | undefined) => void;
19
+ /** Apply or update a `<link>` tag. */
20
+ setLink: (attrs: Record<string, string>) => void;
21
+ }
22
+ /** Output for SSR: a builder that collects tags as HTML strings. */
23
+ export interface HTMLContext {
24
+ meta: string[];
25
+ link: string[];
26
+ jsonLd: string[];
27
+ }
28
+ export interface Strategy {
29
+ /** Stable key, useful for debugging and tests. */
30
+ readonly id: string;
31
+ /** Returns true when the strategy has work to do for these options. */
32
+ applies(options: SEOptions): boolean;
33
+ /** Apply to the live DOM. */
34
+ applyDOM(options: SEOptions, ctx: DOMContext): void;
35
+ /** Append HTML strings to the SSR context. */
36
+ applyHTML(options: SEOptions, ctx: HTMLContext): void;
37
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * SEO rendering strategies.
3
+ *
4
+ * A strategy encapsulates one piece of SEO output (title, robots, OG tags,
5
+ * hreflang, etc.). The same strategy is consumed by:
6
+ * - `dom/dom-mutator.ts` – applies the change to the live DOM
7
+ * - `ssr/renderer.ts` – serializes the change to an HTML string
8
+ *
9
+ * This is the Strategy pattern: a list of small, focused objects, each
10
+ * responsible for one concern, dispatched by a single orchestrator. It
11
+ * eliminates the historical bug where SSR and the DOM output diverged
12
+ * (e.g. SSR dropped OG image width/height/type).
13
+ */
14
+ export {};
@@ -1,18 +1,17 @@
1
1
  /**
2
- * useJsonLd Hook
2
+ * `useJsonLd(data, options?)` hook.
3
3
  *
4
- * React hook for managing JSON-LD structured data.
5
- * Provides a programmatic way to add/update/remove structured data.
4
+ * Programmatic JSON-LD injection. Returns `inject`/`remove` callbacks
5
+ * so the caller can re-fire the injection on demand (e.g. after a route
6
+ * transition) or clean up manually.
6
7
  */
7
8
  import type { JsonLdTypes } from "../types/schema.js";
8
9
  interface UseJsonLdOptions {
9
- /** Strategy for when to inject the script tag */
10
10
  strategy?: "afterInteractive" | "beforeInteractive" | "idle";
11
- /** Unique identifier for this JSON-LD block */
12
11
  id?: string;
13
12
  }
14
13
  export declare const useJsonLd: (data: JsonLdTypes | JsonLdTypes[], options?: UseJsonLdOptions) => {
15
- injectJsonLd: (jsonData: JsonLdTypes | JsonLdTypes[]) => void;
14
+ injectJsonLd: (payload: JsonLdTypes | JsonLdTypes[]) => void;
16
15
  removeJsonLd: () => void;
17
16
  };
18
- export default useJsonLd;
17
+ export {};
@@ -1,58 +1,32 @@
1
1
  /**
2
- * useJsonLd Hook
2
+ * `useJsonLd(data, options?)` hook.
3
3
  *
4
- * React hook for managing JSON-LD structured data.
5
- * Provides a programmatic way to add/update/remove structured data.
4
+ * Programmatic JSON-LD injection. Returns `inject`/`remove` callbacks
5
+ * so the caller can re-fire the injection on demand (e.g. after a route
6
+ * transition) or clean up manually.
6
7
  */
7
- import { useEffect, useCallback, useMemo } from "react";
8
- // Generate a stable hash from JSON-LD data for consistent identification
9
- // Optimized with better hashing algorithm and memoization
10
- const hashCache = new WeakMap();
11
- const generateDataId = (data) => {
12
- // Check cache first for better performance
13
- if (hashCache.has(data)) {
14
- return hashCache.get(data);
15
- }
16
- // Use base64 encoding for faster, more reliable hashing
17
- const str = JSON.stringify(data);
18
- // Optimized hashing using cyrb53 algorithm (better distribution & performance)
19
- let h1 = 0xdeadbeef, h2 = 0x41c6ce57;
20
- for (let i = 0, ch; i < str.length; i++) {
21
- ch = str.charCodeAt(i);
22
- h1 = Math.imul(h1 ^ ch, 2654435761);
23
- h2 = Math.imul(h2 ^ ch, 1597334677);
24
- }
25
- h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);
26
- h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);
27
- const hash = (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(36);
28
- const result = `jsonld-${hash}`;
29
- // Cache the result for future use
30
- hashCache.set(data, result);
31
- return result;
32
- };
8
+ import { useCallback, useEffect, useMemo } from "react";
9
+ import { generateDataId } from "../core/hash.js";
10
+ const SCRIPT_TYPE = "application/ld+json";
33
11
  export const useJsonLd = (data, options) => {
34
- const { strategy = "afterInteractive", id } = options || {};
35
- // Generate stable IDs for data items
12
+ const { strategy = "afterInteractive", id } = options ?? {};
36
13
  const dataIds = useMemo(() => {
37
- const dataArray = Array.isArray(data) ? data : [data];
38
- return dataArray.map((item) => id ? `${id}-${dataArray.indexOf(item)}` : generateDataId(item));
14
+ const items = Array.isArray(data) ? data : [data];
15
+ return items.map((item, index) => id ? `${id}-${index}` : generateDataId(item));
39
16
  }, [data, id]);
40
- const injectJsonLd = useCallback((jsonData) => {
17
+ const injectJsonLd = useCallback((payload) => {
41
18
  if (typeof document === "undefined")
42
19
  return;
43
- const dataArray = Array.isArray(jsonData) ? jsonData : [jsonData];
44
- const ids = Array.isArray(jsonData) && !id
45
- ? dataArray.map(generateDataId)
20
+ const items = Array.isArray(payload) ? payload : [payload];
21
+ const ids = Array.isArray(payload) && !id
22
+ ? items.map(generateDataId)
46
23
  : dataIds;
47
- dataArray.forEach((item, index) => {
48
- // Remove existing script if present
49
- const existingScript = document.querySelector(`script[type="application/ld+json"][data-seo-id="${ids[index]}"]`);
50
- if (existingScript) {
51
- existingScript.remove();
52
- }
53
- // Create and inject new script
24
+ items.forEach((item, index) => {
25
+ document
26
+ .querySelector(`script[type="${SCRIPT_TYPE}"][data-seo-id="${ids[index]}"]`)
27
+ ?.remove();
54
28
  const script = document.createElement("script");
55
- script.type = "application/ld+json";
29
+ script.type = SCRIPT_TYPE;
56
30
  script.textContent = JSON.stringify(item);
57
31
  script.setAttribute("data-seo-id", ids[index]);
58
32
  script.setAttribute("data-seo-strategy", strategy);
@@ -62,24 +36,16 @@ export const useJsonLd = (data, options) => {
62
36
  const removeJsonLd = useCallback(() => {
63
37
  if (typeof document === "undefined")
64
38
  return;
65
- dataIds.forEach((dataId) => {
66
- const script = document.querySelector(`script[type="application/ld+json"][data-seo-id="${dataId}"]`);
67
- if (script) {
68
- script.remove();
69
- }
70
- });
39
+ for (const dataId of dataIds) {
40
+ document
41
+ .querySelector(`script[type="${SCRIPT_TYPE}"][data-seo-id="${dataId}"]`)
42
+ ?.remove();
43
+ }
71
44
  }, [dataIds]);
72
45
  useEffect(() => {
73
- if (data) {
46
+ if (data)
74
47
  injectJsonLd(data);
75
- }
76
- return () => {
77
- removeJsonLd();
78
- };
48
+ return () => removeJsonLd();
79
49
  }, [data, injectJsonLd, removeJsonLd]);
80
- return {
81
- injectJsonLd,
82
- removeJsonLd,
83
- };
50
+ return { injectJsonLd, removeJsonLd };
84
51
  };
85
- export default useJsonLd;
@@ -1,2 +1,8 @@
1
+ /**
2
+ * `useSEO(options)` hook.
3
+ *
4
+ * Imperative alternative to the `<SEO>` component for callers that need
5
+ * to derive SEO options from arbitrary React state without a wrapper.
6
+ */
1
7
  import type { SEOptions } from "../types/index.js";
2
8
  export declare const useSEO: (options: SEOptions) => void;
@@ -1,37 +1,15 @@
1
- import { useEffect, useRef } from "react";
2
- import { updateSEO } from "../utils/dom.js";
3
1
  /**
4
- * Deep comparison function for objects and arrays
5
- * Performs efficient structural equality check
2
+ * `useSEO(options)` hook.
3
+ *
4
+ * Imperative alternative to the `<SEO>` component for callers that need
5
+ * to derive SEO options from arbitrary React state without a wrapper.
6
6
  */
7
- const deepEqual = (a, b) => {
8
- // Primitive values and same reference
9
- if (a === b)
10
- return true;
11
- // Handle null/undefined
12
- if (a == null || b == null)
13
- return a === b;
14
- // Handle arrays
15
- if (Array.isArray(a) && Array.isArray(b)) {
16
- if (a.length !== b.length)
17
- return false;
18
- return a.every((item, index) => deepEqual(item, b[index]));
19
- }
20
- // Handle objects
21
- if (typeof a === 'object' && typeof b === 'object' && a !== null && b !== null) {
22
- const keysA = Object.keys(a);
23
- const keysB = Object.keys(b);
24
- if (keysA.length !== keysB.length)
25
- return false;
26
- return keysA.every(key => keysB.includes(key) && deepEqual(a[key], b[key]));
27
- }
28
- return false;
29
- };
7
+ import { useEffect, useRef } from "react";
8
+ import { deepEqual } from "../core/deep-equal.js";
9
+ import { updateSEO } from "../utils/dom/index.js";
30
10
  export const useSEO = (options) => {
31
- // Use ref to store the previous options for deep comparison
32
11
  const prevOptionsRef = useRef(null);
33
12
  useEffect(() => {
34
- // Only update if options have actually changed
35
13
  if (!prevOptionsRef.current || !deepEqual(prevOptionsRef.current, options)) {
36
14
  prevOptionsRef.current = options;
37
15
  updateSEO(options);
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Helmet-compatible output for libraries that expect a `react-helmet`-style
3
+ * data shape (e.g. older Next.js APIs).
4
+ *
5
+ * This module is intentionally minimal: it only reports the title and html
6
+ * attributes. The full meta/link/JSON-LD output is available via `renderSEO`.
7
+ */
8
+ import type { SEOptions } from "../types/index.js";
9
+ export interface RenderedMetaTag {
10
+ toString(): string;
11
+ toComponent(): unknown;
12
+ }
13
+ export interface HelmetData {
14
+ base: RenderedMetaTag[];
15
+ bodyAttributes: Record<string, string>;
16
+ htmlAttributes: Record<string, string>;
17
+ link: RenderedMetaTag[];
18
+ meta: RenderedMetaTag[];
19
+ noscript: RenderedMetaTag[];
20
+ script: RenderedMetaTag[];
21
+ style: RenderedMetaTag[];
22
+ title: string;
23
+ titleAttributes: Record<string, string>;
24
+ }
25
+ export declare const renderAsHelmet: (options: SEOptions) => HelmetData;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Helmet-compatible output for libraries that expect a `react-helmet`-style
3
+ * data shape (e.g. older Next.js APIs).
4
+ *
5
+ * This module is intentionally minimal: it only reports the title and html
6
+ * attributes. The full meta/link/JSON-LD output is available via `renderSEO`.
7
+ */
8
+ import { renderSEO } from "./renderer.js";
9
+ export const renderAsHelmet = (options) => {
10
+ const rendered = renderSEO(options);
11
+ return {
12
+ base: [],
13
+ bodyAttributes: {},
14
+ htmlAttributes: options.lang ? { lang: options.lang } : {},
15
+ link: [],
16
+ meta: [],
17
+ noscript: [],
18
+ script: [],
19
+ style: [],
20
+ title: rendered.title,
21
+ titleAttributes: {},
22
+ };
23
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * SSR entry point.
3
+ *
4
+ * Re-exports the renderer, helmet adapter, and serializer.
5
+ */
6
+ export { renderSEO, generateHead, extractSEOData, hydrateSEO } from "./renderer.js";
7
+ export { renderAsHelmet } from "./helmet.js";
8
+ export type { HelmetData, RenderedMetaTag } from "./helmet.js";
9
+ export type { RenderedSEO } from "./renderer.js";
10
+ export { serializeSEO, deserializeSEO, serializeSEOToBase64, deserializeSEOFromBase64, safeDeserializeSEO, } from "./serializer.js";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * SSR entry point.
3
+ *
4
+ * Re-exports the renderer, helmet adapter, and serializer.
5
+ */
6
+ export { renderSEO, generateHead, extractSEOData, hydrateSEO } from "./renderer.js";
7
+ export { renderAsHelmet } from "./helmet.js";
8
+ export { serializeSEO, deserializeSEO, serializeSEOToBase64, deserializeSEOFromBase64, safeDeserializeSEO, } from "./serializer.js";
@@ -1,59 +1,34 @@
1
1
  /**
2
- * SEO SSR Renderer
2
+ * SEO SSR Renderer.
3
3
  *
4
- * Server-side rendering utilities for SEO.
5
- * Generates HTML strings for meta tags and structured data.
4
+ * Generates HTML strings for meta tags and structured data. Uses the same
5
+ * strategy registry as the DOM mutator, so DOM and SSR output are
6
+ * guaranteed to stay in sync.
6
7
  */
7
8
  import type { SEOptions } from "../types/index.js";
8
9
  export interface RenderedSEO {
9
- /** Title tag */
10
10
  title: string;
11
- /** All meta tags as HTML */
12
11
  meta: string;
13
- /** All link tags as HTML */
14
12
  link: string;
15
- /** All JSON-LD scripts as HTML */
16
13
  jsonLd: string;
17
- /** Complete HTML head content */
18
14
  toHTML(): string;
19
- /** Convert to string (same as toHTML) */
20
15
  toString(): string;
21
16
  }
22
17
  /**
23
- * Render SEO options to HTML strings for server-side rendering
24
- * Optimized with caching and efficient string building
18
+ * Render SEO options to HTML strings for server-side rendering.
25
19
  */
26
- export declare const renderSEO: (options: SEOptions, useCache?: boolean) => RenderedSEO;
20
+ export declare const renderSEO: (options: SEOptions) => RenderedSEO;
27
21
  /**
28
- * Generate complete HTML head with SEO tags
22
+ * Generate a complete `<head>` block for the given SEO options.
29
23
  */
30
24
  export declare const generateHead: (options: SEOptions) => string;
31
25
  /**
32
- * Extract SEO data for hydration
26
+ * Extract SEO options as a JSON string for client-side hydration.
33
27
  */
34
28
  export declare const extractSEOData: (options: SEOptions) => string;
35
29
  /**
36
- * Hydrate SEO on client side
37
- * @throws {SyntaxError} If serializedData is not valid JSON
30
+ * Hydrate SEO on the client by applying the deserialized options to the DOM.
31
+ * Swallows JSON parse errors and dynamic-import errors with a console error
32
+ * — the page should still render even if hydration fails.
38
33
  */
39
34
  export declare const hydrateSEO: (serializedData: string) => void;
40
- export interface RenderedMetaTag {
41
- toString(): string;
42
- toComponent(): unknown;
43
- }
44
- export interface HelmetData {
45
- base: RenderedMetaTag[];
46
- bodyAttributes: Record<string, string>;
47
- htmlAttributes: Record<string, string>;
48
- link: RenderedMetaTag[];
49
- meta: RenderedMetaTag[];
50
- noscript: RenderedMetaTag[];
51
- script: RenderedMetaTag[];
52
- style: RenderedMetaTag[];
53
- title: string;
54
- titleAttributes: Record<string, string>;
55
- }
56
- /**
57
- * Render SEO in Helmet-compatible format
58
- */
59
- export declare const renderAsHelmet: (options: SEOptions) => HelmetData;