nuxtseo-shared 0.1.8 → 0.2.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 (55) hide show
  1. package/dist/content.d.mts +37 -37
  2. package/dist/content.d.ts +75 -0
  3. package/dist/content.mjs +31 -55
  4. package/dist/devtools.d.mts +10 -10
  5. package/dist/devtools.d.ts +14 -0
  6. package/dist/devtools.mjs +43 -37
  7. package/dist/i18n.d.mts +19 -19
  8. package/dist/i18n.d.ts +44 -0
  9. package/dist/i18n.mjs +117 -105
  10. package/dist/kit.d.mts +29 -14
  11. package/dist/kit.d.ts +57 -0
  12. package/dist/kit.mjs +105 -77
  13. package/dist/module.d.mts +4 -13
  14. package/dist/module.d.ts +5 -0
  15. package/dist/module.json +12 -0
  16. package/dist/module.mjs +31 -32
  17. package/dist/pro.d.mts +2 -16
  18. package/dist/pro.d.ts +3 -0
  19. package/dist/pro.mjs +66 -68
  20. package/dist/runtime/pure.d.ts +0 -0
  21. package/dist/runtime/pure.js +36 -0
  22. package/dist/runtime/server/kit.d.ts +0 -0
  23. package/dist/runtime/server/kit.js +22 -0
  24. package/dist/telemetry.d.mts +4 -4
  25. package/dist/telemetry.d.ts +11 -0
  26. package/dist/telemetry.mjs +58 -45
  27. package/dist/types.d.mts +7 -0
  28. package/package.json +23 -21
  29. package/src/runtime/pure.ts +57 -0
  30. package/src/runtime/server/kit.ts +26 -0
  31. package/dist/index.d.mts +0 -3
  32. package/dist/index.mjs +0 -3
  33. package/dist/layer-devtools/app.config.ts +0 -27
  34. package/dist/layer-devtools/assets/css/global.css +0 -593
  35. package/dist/layer-devtools/components/DevtoolsAlert.vue +0 -101
  36. package/dist/layer-devtools/components/DevtoolsCopyButton.vue +0 -20
  37. package/dist/layer-devtools/components/DevtoolsDocs.vue +0 -11
  38. package/dist/layer-devtools/components/DevtoolsEmptyState.vue +0 -105
  39. package/dist/layer-devtools/components/DevtoolsError.vue +0 -78
  40. package/dist/layer-devtools/components/DevtoolsKeyValue.vue +0 -109
  41. package/dist/layer-devtools/components/DevtoolsLayout.vue +0 -219
  42. package/dist/layer-devtools/components/DevtoolsLoading.vue +0 -8
  43. package/dist/layer-devtools/components/DevtoolsMetric.vue +0 -96
  44. package/dist/layer-devtools/components/DevtoolsPanel.vue +0 -76
  45. package/dist/layer-devtools/components/DevtoolsProductionError.vue +0 -41
  46. package/dist/layer-devtools/components/DevtoolsSnippet.vue +0 -51
  47. package/dist/layer-devtools/components/DevtoolsToolbar.vue +0 -42
  48. package/dist/layer-devtools/components/NuxtSeoLogo.vue +0 -77
  49. package/dist/layer-devtools/components/OCodeBlock.vue +0 -23
  50. package/dist/layer-devtools/components/OSectionBlock.vue +0 -139
  51. package/dist/layer-devtools/composables/clipboard.ts +0 -21
  52. package/dist/layer-devtools/composables/rpc.ts +0 -39
  53. package/dist/layer-devtools/composables/shiki.ts +0 -46
  54. package/dist/layer-devtools/composables/state.ts +0 -33
  55. package/dist/layer-devtools/nuxt.config.ts +0 -26
@@ -1,15 +1,14 @@
1
- //#region src/content.d.ts
2
1
  interface ContentSchemaOptions {
3
- /**
4
- * Pass the `z` instance from `@nuxt/content` to ensure `.editor()` works
5
- * across Zod versions. When omitted, the module's bundled `z` is used.
6
- */
7
- z?: any;
2
+ /**
3
+ * Pass the `z` instance from `@nuxt/content` to ensure `.editor()` works
4
+ * across Zod versions. When omitted, the module's bundled `z` is used.
5
+ */
6
+ z?: any;
8
7
  }
9
8
  interface ContentEditorConfig {
10
- hidden?: boolean;
11
- input?: 'media' | 'icon' | 'textarea';
12
- iconLibraries?: string[];
9
+ hidden?: boolean;
10
+ input?: 'media' | 'icon' | 'textarea';
11
+ iconLibraries?: string[];
13
12
  }
14
13
  /**
15
14
  * Apply Nuxt Content `.editor()` metadata to a zod schema field.
@@ -21,28 +20,28 @@ declare function withEditor<T>(schema: T, config: ContentEditorConfig): T;
21
20
  */
22
21
  declare function withEditorHidden<T>(schema: T): T;
23
22
  interface DefineContentSchemaConfig<TSchema = any, TDefineOptions extends ContentSchemaOptions = ContentSchemaOptions> {
24
- /**
25
- * The field name used in frontmatter (e.g. 'robots', 'sitemap', 'ogImage').
26
- */
27
- fieldName: string;
28
- /**
29
- * Build the zod schema for this field. Receives the zod instance
30
- * (either the user's `@nuxt/content` patched version or the module's bundled one).
31
- */
32
- buildSchema: (z: any) => TSchema;
33
- /**
34
- * Module label for deprecation warnings (e.g. 'robots', 'sitemap').
35
- */
36
- label: string;
37
- /**
38
- * Documentation URL for migration guidance.
39
- */
40
- docsUrl?: string;
41
- /**
42
- * Hook called when `defineSchema()` is invoked. Use for validation or
43
- * registering module-specific side effects (e.g. sitemap filter/onUrl).
44
- */
45
- onDefineSchema?: (options: TDefineOptions) => void;
23
+ /**
24
+ * The field name used in frontmatter (e.g. 'robots', 'sitemap', 'ogImage').
25
+ */
26
+ fieldName: string;
27
+ /**
28
+ * Build the zod schema for this field. Receives the zod instance
29
+ * (either the user's `@nuxt/content` patched version or the module's bundled one).
30
+ */
31
+ buildSchema: (z: any) => TSchema;
32
+ /**
33
+ * Module label for deprecation warnings (e.g. 'robots', 'sitemap').
34
+ */
35
+ label: string;
36
+ /**
37
+ * Documentation URL for migration guidance.
38
+ */
39
+ docsUrl?: string;
40
+ /**
41
+ * Hook called when `defineSchema()` is invoked. Use for validation or
42
+ * registering module-specific side effects (e.g. sitemap filter/onUrl).
43
+ */
44
+ onDefineSchema?: (options: TDefineOptions) => void;
46
45
  }
47
46
  /**
48
47
  * Factory for creating a module's `define*Schema()` and deprecated `as*Collection()` exports.
@@ -66,10 +65,11 @@ interface DefineContentSchemaConfig<TSchema = any, TDefineOptions extends Conten
66
65
  * export { defineSchema as defineRobotsSchema, asCollection as asRobotsCollection, schema }
67
66
  */
68
67
  declare function createContentSchemaFactory<TSchema, TDefineOptions extends ContentSchemaOptions = ContentSchemaOptions>(config: DefineContentSchemaConfig<TSchema, TDefineOptions>, defaultZ: any): {
69
- defineSchema: (options?: TDefineOptions) => TSchema;
70
- asCollection: <T>(collection: any) => T;
71
- schema: any;
72
- fieldSchema: TSchema;
68
+ defineSchema: (options?: TDefineOptions) => TSchema;
69
+ asCollection: <T>(collection: any) => T;
70
+ schema: any;
71
+ fieldSchema: TSchema;
73
72
  };
74
- //#endregion
75
- export { ContentEditorConfig, ContentSchemaOptions, DefineContentSchemaConfig, createContentSchemaFactory, withEditor, withEditorHidden };
73
+
74
+ export { createContentSchemaFactory, withEditor, withEditorHidden };
75
+ export type { ContentEditorConfig, ContentSchemaOptions, DefineContentSchemaConfig };
@@ -0,0 +1,75 @@
1
+ interface ContentSchemaOptions {
2
+ /**
3
+ * Pass the `z` instance from `@nuxt/content` to ensure `.editor()` works
4
+ * across Zod versions. When omitted, the module's bundled `z` is used.
5
+ */
6
+ z?: any;
7
+ }
8
+ interface ContentEditorConfig {
9
+ hidden?: boolean;
10
+ input?: 'media' | 'icon' | 'textarea';
11
+ iconLibraries?: string[];
12
+ }
13
+ /**
14
+ * Apply Nuxt Content `.editor()` metadata to a zod schema field.
15
+ * No-ops gracefully when `.editor()` is not patched onto ZodType (outside Nuxt Content).
16
+ */
17
+ declare function withEditor<T>(schema: T, config: ContentEditorConfig): T;
18
+ /**
19
+ * Hide a zod schema field from the Nuxt Content / Studio editor.
20
+ */
21
+ declare function withEditorHidden<T>(schema: T): T;
22
+ interface DefineContentSchemaConfig<TSchema = any, TDefineOptions extends ContentSchemaOptions = ContentSchemaOptions> {
23
+ /**
24
+ * The field name used in frontmatter (e.g. 'robots', 'sitemap', 'ogImage').
25
+ */
26
+ fieldName: string;
27
+ /**
28
+ * Build the zod schema for this field. Receives the zod instance
29
+ * (either the user's `@nuxt/content` patched version or the module's bundled one).
30
+ */
31
+ buildSchema: (z: any) => TSchema;
32
+ /**
33
+ * Module label for deprecation warnings (e.g. 'robots', 'sitemap').
34
+ */
35
+ label: string;
36
+ /**
37
+ * Documentation URL for migration guidance.
38
+ */
39
+ docsUrl?: string;
40
+ /**
41
+ * Hook called when `defineSchema()` is invoked. Use for validation or
42
+ * registering module-specific side effects (e.g. sitemap filter/onUrl).
43
+ */
44
+ onDefineSchema?: (options: TDefineOptions) => void;
45
+ }
46
+ /**
47
+ * Factory for creating a module's `define*Schema()` and deprecated `as*Collection()` exports.
48
+ *
49
+ * Each module provides its own schema builder. The factory handles:
50
+ * - Zod instance passthrough for `@nuxt/content` version compatibility
51
+ * - Consistent `DefineSchemaOptions` interface
52
+ * - Deprecated `asXxxCollection()` wrapper with migration warning
53
+ *
54
+ * @example
55
+ * import { z } from 'zod'
56
+ * import { createContentSchemaFactory } from 'nuxtseo-shared/content'
57
+ *
58
+ * const { defineSchema, asCollection, schema } = createContentSchemaFactory({
59
+ * fieldName: 'robots',
60
+ * label: 'robots',
61
+ * docsUrl: 'https://nuxtseo.com/robots/guides/content',
62
+ * buildSchema: (z) => z.union([z.string(), z.boolean()]).optional(),
63
+ * }, z)
64
+ *
65
+ * export { defineSchema as defineRobotsSchema, asCollection as asRobotsCollection, schema }
66
+ */
67
+ declare function createContentSchemaFactory<TSchema, TDefineOptions extends ContentSchemaOptions = ContentSchemaOptions>(config: DefineContentSchemaConfig<TSchema, TDefineOptions>, defaultZ: any): {
68
+ defineSchema: (options?: TDefineOptions) => TSchema;
69
+ asCollection: <T>(collection: any) => T;
70
+ schema: any;
71
+ fieldSchema: TSchema;
72
+ };
73
+
74
+ export { createContentSchemaFactory, withEditor, withEditorHidden };
75
+ export type { ContentEditorConfig, ContentSchemaOptions, DefineContentSchemaConfig };
package/dist/content.mjs CHANGED
@@ -1,64 +1,40 @@
1
- //#region src/content.ts
2
- /**
3
- * Apply Nuxt Content `.editor()` metadata to a zod schema field.
4
- * No-ops gracefully when `.editor()` is not patched onto ZodType (outside Nuxt Content).
5
- */
6
1
  function withEditor(schema, config) {
7
- if (typeof schema.editor === "function") return schema.editor(config);
8
- return schema;
2
+ if (typeof schema.editor === "function")
3
+ return schema.editor(config);
4
+ return schema;
9
5
  }
10
- /**
11
- * Hide a zod schema field from the Nuxt Content / Studio editor.
12
- */
13
6
  function withEditorHidden(schema) {
14
- return withEditor(schema, { hidden: true });
7
+ return withEditor(schema, { hidden: true });
15
8
  }
16
- /**
17
- * Factory for creating a module's `define*Schema()` and deprecated `as*Collection()` exports.
18
- *
19
- * Each module provides its own schema builder. The factory handles:
20
- * - Zod instance passthrough for `@nuxt/content` version compatibility
21
- * - Consistent `DefineSchemaOptions` interface
22
- * - Deprecated `asXxxCollection()` wrapper with migration warning
23
- *
24
- * @example
25
- * import { z } from 'zod'
26
- * import { createContentSchemaFactory } from 'nuxtseo-shared/content'
27
- *
28
- * const { defineSchema, asCollection, schema } = createContentSchemaFactory({
29
- * fieldName: 'robots',
30
- * label: 'robots',
31
- * docsUrl: 'https://nuxtseo.com/robots/guides/content',
32
- * buildSchema: (z) => z.union([z.string(), z.boolean()]).optional(),
33
- * }, z)
34
- *
35
- * export { defineSchema as defineRobotsSchema, asCollection as asRobotsCollection, schema }
36
- */
37
9
  function createContentSchemaFactory(config, defaultZ) {
38
- const { fieldName, buildSchema, label, docsUrl, onDefineSchema } = config;
39
- const defaultSchema = buildSchema(defaultZ);
40
- const schemaObject = defaultZ.object({ [fieldName]: defaultSchema });
41
- function defineSchema(options) {
42
- if (options && onDefineSchema) onDefineSchema(options);
43
- const _z = options?.z ?? defaultZ;
44
- if (_z === defaultZ) return defaultSchema;
45
- return buildSchema(_z);
46
- }
47
- function asCollection(collection) {
48
- const migrationHint = docsUrl ? ` See ${docsUrl}` : "";
49
- console.warn(`[${label}] \`as${capitalize(label)}Collection()\` is deprecated. Use \`define${capitalize(label)}Schema()\` in your collection schema instead.${migrationHint}`);
50
- if (collection.type === "page") collection.schema = collection.schema ? schemaObject.extend(collection.schema.shape) : schemaObject;
51
- return collection;
52
- }
53
- return {
54
- defineSchema,
55
- asCollection,
56
- schema: schemaObject,
57
- fieldSchema: defaultSchema
58
- };
10
+ const { fieldName, buildSchema, label, docsUrl, onDefineSchema } = config;
11
+ const defaultSchema = buildSchema(defaultZ);
12
+ const schemaObject = defaultZ.object({ [fieldName]: defaultSchema });
13
+ function defineSchema(options) {
14
+ if (options && onDefineSchema)
15
+ onDefineSchema(options);
16
+ const _z = options?.z ?? defaultZ;
17
+ if (_z === defaultZ)
18
+ return defaultSchema;
19
+ return buildSchema(_z);
20
+ }
21
+ function asCollection(collection) {
22
+ const migrationHint = docsUrl ? ` See ${docsUrl}` : "";
23
+ console.warn(`[${label}] \`as${capitalize(label)}Collection()\` is deprecated. Use \`define${capitalize(label)}Schema()\` in your collection schema instead.${migrationHint}`);
24
+ if (collection.type === "page") {
25
+ collection.schema = collection.schema ? schemaObject.extend(collection.schema.shape) : schemaObject;
26
+ }
27
+ return collection;
28
+ }
29
+ return {
30
+ defineSchema,
31
+ asCollection,
32
+ schema: schemaObject,
33
+ fieldSchema: defaultSchema
34
+ };
59
35
  }
60
36
  function capitalize(s) {
61
- return s.charAt(0).toUpperCase() + s.slice(1);
37
+ return s.charAt(0).toUpperCase() + s.slice(1);
62
38
  }
63
- //#endregion
39
+
64
40
  export { createContentSchemaFactory, withEditor, withEditorHidden };
@@ -1,14 +1,14 @@
1
- import { Resolver } from "@nuxt/kit";
2
- import { Nuxt } from "nuxt/schema";
1
+ import { Resolver } from '@nuxt/kit';
2
+ import { Nuxt } from 'nuxt/schema';
3
3
 
4
- //#region src/devtools.d.ts
5
4
  interface DevToolsUIConfig {
6
- route: string;
7
- name: string;
8
- title: string;
9
- icon: string;
10
- devPort?: number;
5
+ route: string;
6
+ name: string;
7
+ title: string;
8
+ icon: string;
9
+ devPort?: number;
11
10
  }
12
11
  declare function setupDevToolsUI(config: DevToolsUIConfig, resolve: Resolver['resolve'], nuxt?: Nuxt): void;
13
- //#endregion
14
- export { DevToolsUIConfig, setupDevToolsUI };
12
+
13
+ export { setupDevToolsUI };
14
+ export type { DevToolsUIConfig };
@@ -0,0 +1,14 @@
1
+ import { Resolver } from '@nuxt/kit';
2
+ import { Nuxt } from 'nuxt/schema';
3
+
4
+ interface DevToolsUIConfig {
5
+ route: string;
6
+ name: string;
7
+ title: string;
8
+ icon: string;
9
+ devPort?: number;
10
+ }
11
+ declare function setupDevToolsUI(config: DevToolsUIConfig, resolve: Resolver['resolve'], nuxt?: Nuxt): void;
12
+
13
+ export { setupDevToolsUI };
14
+ export type { DevToolsUIConfig };
package/dist/devtools.mjs CHANGED
@@ -1,40 +1,46 @@
1
- import { existsSync } from "node:fs";
2
- import { addCustomTab } from "@nuxt/devtools-kit";
3
- import { useNuxt } from "@nuxt/kit";
4
- //#region src/devtools.ts
1
+ import { existsSync } from 'node:fs';
2
+ import { addCustomTab } from '@nuxt/devtools-kit';
3
+ import { useNuxt } from '@nuxt/kit';
4
+ import sirv from 'sirv';
5
+
5
6
  function setupDevToolsUI(config, resolve, nuxt = useNuxt()) {
6
- const { route, name, title, icon, devPort = 3030 } = config;
7
- const clientPath = resolve("./client");
8
- if (existsSync(clientPath)) nuxt.hook("vite:serverCreated", async (server) => {
9
- const sirv = await import("sirv").then((r) => r.default || r);
10
- server.middlewares.use(route, sirv(clientPath, {
11
- dev: true,
12
- single: true
13
- }));
14
- });
15
- else nuxt.hook("vite:extendConfig", (config) => {
16
- Object.assign(config, { server: {
17
- ...config.server,
18
- proxy: {
19
- ...config.server?.proxy,
20
- [route]: {
21
- target: `http://localhost:${devPort}${route}`,
22
- changeOrigin: true,
23
- followRedirects: true,
24
- rewrite: (p) => p.replace(route, "")
25
- }
26
- }
27
- } });
28
- });
29
- addCustomTab({
30
- name,
31
- title,
32
- icon,
33
- view: {
34
- type: "iframe",
35
- src: route
36
- }
37
- });
7
+ const { route, name, title, icon, devPort = 3030 } = config;
8
+ const clientPath = resolve("./client");
9
+ const isProductionBuild = existsSync(clientPath);
10
+ if (isProductionBuild) {
11
+ nuxt.hook("vite:serverCreated", (server) => {
12
+ server.middlewares.use(
13
+ route,
14
+ sirv(clientPath, { dev: true, single: true })
15
+ );
16
+ });
17
+ } else {
18
+ nuxt.hook("vite:extendConfig", (config2) => {
19
+ Object.assign(config2, {
20
+ server: {
21
+ ...config2.server,
22
+ proxy: {
23
+ ...config2.server?.proxy,
24
+ [route]: {
25
+ target: `http://localhost:${devPort}${route}`,
26
+ changeOrigin: true,
27
+ followRedirects: true,
28
+ rewrite: (p) => p.replace(route, "")
29
+ }
30
+ }
31
+ }
32
+ });
33
+ });
34
+ }
35
+ addCustomTab({
36
+ name,
37
+ title,
38
+ icon,
39
+ view: {
40
+ type: "iframe",
41
+ src: route
42
+ }
43
+ });
38
44
  }
39
- //#endregion
45
+
40
46
  export { setupDevToolsUI };
package/dist/i18n.d.mts CHANGED
@@ -1,34 +1,33 @@
1
- import { LocaleObject, NuxtI18nOptions } from "@nuxtjs/i18n";
1
+ import { LocaleObject, NuxtI18nOptions } from '@nuxtjs/i18n';
2
2
 
3
- //#region src/i18n.d.ts
4
3
  declare const I18N_MODULES: readonly ["@nuxtjs/i18n", "nuxt-i18n-micro"];
5
4
  type I18nModuleName = typeof I18N_MODULES[number];
6
5
  type Strategies = 'no_prefix' | 'prefix_except_default' | 'prefix' | 'prefix_and_default';
7
6
  type NormalisedLocale = LocaleObject & {
8
- _sitemap: string;
9
- _hreflang: string;
7
+ _sitemap: string;
8
+ _hreflang: string;
10
9
  };
11
10
  interface AutoI18nConfig {
12
- locales: NormalisedLocale[];
13
- defaultLocale: string;
14
- strategy: Strategies;
15
- differentDomains?: boolean;
16
- pages?: Record<string, Record<string, string | false>>;
11
+ locales: NormalisedLocale[];
12
+ defaultLocale: string;
13
+ strategy: Strategies;
14
+ differentDomains?: boolean;
15
+ pages?: Record<string, Record<string, string | false>>;
17
16
  }
18
17
  interface StrategyProps {
19
- localeCode: string;
20
- pageLocales: string;
21
- nuxtI18nConfig: NuxtI18nOptions;
22
- forcedStrategy?: Strategies;
23
- normalisedLocales: AutoI18nConfig['locales'];
18
+ localeCode: string;
19
+ pageLocales: string;
20
+ nuxtI18nConfig: NuxtI18nOptions;
21
+ forcedStrategy?: Strategies;
22
+ normalisedLocales: AutoI18nConfig['locales'];
24
23
  }
25
24
  declare function generatePathForI18nPages(ctx: StrategyProps): string;
26
25
  declare function splitPathForI18nLocales(path: string, autoI18n: AutoI18nConfig): string | string[];
27
26
  declare function normalizeLocales(nuxtI18nConfig: NuxtI18nOptions): AutoI18nConfig['locales'];
28
27
  declare function mapPathForI18nPages(path: string, autoI18n: AutoI18nConfig): string[] | false;
29
28
  interface I18nModuleResolution {
30
- module: I18nModuleName;
31
- isMicro: boolean;
29
+ module: I18nModuleName;
30
+ isMicro: boolean;
32
31
  }
33
32
  /**
34
33
  * Detect which i18n module is installed (@nuxtjs/i18n or nuxt-i18n-micro).
@@ -37,8 +36,9 @@ interface I18nModuleResolution {
37
36
  */
38
37
  declare function resolveI18nModule(): false | I18nModuleResolution;
39
38
  declare function resolveI18nConfig(logger?: {
40
- warn: (msg: string) => void;
39
+ warn: (msg: string) => void;
41
40
  }): Promise<false | AutoI18nConfig>;
42
41
  declare function mergeOnKey<T extends Record<string, any>>(arr: T[], key: keyof T): T[];
43
- //#endregion
44
- export { AutoI18nConfig, I18nModuleResolution, NormalisedLocale, Strategies, StrategyProps, generatePathForI18nPages, mapPathForI18nPages, mergeOnKey, normalizeLocales, resolveI18nConfig, resolveI18nModule, splitPathForI18nLocales };
42
+
43
+ export { generatePathForI18nPages, mapPathForI18nPages, mergeOnKey, normalizeLocales, resolveI18nConfig, resolveI18nModule, splitPathForI18nLocales };
44
+ export type { AutoI18nConfig, I18nModuleResolution, NormalisedLocale, Strategies, StrategyProps };
package/dist/i18n.d.ts ADDED
@@ -0,0 +1,44 @@
1
+ import { LocaleObject, NuxtI18nOptions } from '@nuxtjs/i18n';
2
+
3
+ declare const I18N_MODULES: readonly ["@nuxtjs/i18n", "nuxt-i18n-micro"];
4
+ type I18nModuleName = typeof I18N_MODULES[number];
5
+ type Strategies = 'no_prefix' | 'prefix_except_default' | 'prefix' | 'prefix_and_default';
6
+ type NormalisedLocale = LocaleObject & {
7
+ _sitemap: string;
8
+ _hreflang: string;
9
+ };
10
+ interface AutoI18nConfig {
11
+ locales: NormalisedLocale[];
12
+ defaultLocale: string;
13
+ strategy: Strategies;
14
+ differentDomains?: boolean;
15
+ pages?: Record<string, Record<string, string | false>>;
16
+ }
17
+ interface StrategyProps {
18
+ localeCode: string;
19
+ pageLocales: string;
20
+ nuxtI18nConfig: NuxtI18nOptions;
21
+ forcedStrategy?: Strategies;
22
+ normalisedLocales: AutoI18nConfig['locales'];
23
+ }
24
+ declare function generatePathForI18nPages(ctx: StrategyProps): string;
25
+ declare function splitPathForI18nLocales(path: string, autoI18n: AutoI18nConfig): string | string[];
26
+ declare function normalizeLocales(nuxtI18nConfig: NuxtI18nOptions): AutoI18nConfig['locales'];
27
+ declare function mapPathForI18nPages(path: string, autoI18n: AutoI18nConfig): string[] | false;
28
+ interface I18nModuleResolution {
29
+ module: I18nModuleName;
30
+ isMicro: boolean;
31
+ }
32
+ /**
33
+ * Detect which i18n module is installed (@nuxtjs/i18n or nuxt-i18n-micro).
34
+ *
35
+ * Returns `false` when neither is installed.
36
+ */
37
+ declare function resolveI18nModule(): false | I18nModuleResolution;
38
+ declare function resolveI18nConfig(logger?: {
39
+ warn: (msg: string) => void;
40
+ }): Promise<false | AutoI18nConfig>;
41
+ declare function mergeOnKey<T extends Record<string, any>>(arr: T[], key: keyof T): T[];
42
+
43
+ export { generatePathForI18nPages, mapPathForI18nPages, mergeOnKey, normalizeLocales, resolveI18nConfig, resolveI18nModule, splitPathForI18nLocales };
44
+ export type { AutoI18nConfig, I18nModuleResolution, NormalisedLocale, Strategies, StrategyProps };