@koine/i18n 2.0.0-beta.96 → 2.0.0-beta.99

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.
@@ -1,3 +1,3 @@
1
1
  import type { I18nCompiler } from "../../compiler/types";
2
- declare const _default: ({}: I18nCompiler.AdapterArg<"next">) => string;
2
+ declare const _default: ({}: I18nCompiler.AdapterArg<"js">) => string;
3
3
  export default _default;
@@ -0,0 +1,3 @@
1
+ import type { I18nCompiler } from "../../compiler/types";
2
+ declare const _default: ({ config: { baseUrl, trailingSlash }, }: I18nCompiler.AdapterArg<"js">) => string;
3
+ export default _default;
@@ -1,3 +1,3 @@
1
1
  import type { I18nCompiler } from "../../compiler/types";
2
- declare const _default: ({}: I18nCompiler.AdapterArg<"next">) => string;
2
+ declare const _default: ({}: I18nCompiler.AdapterArg<"js">) => string;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
1
  import type { I18nCompiler } from "../../compiler/types";
2
- declare const _default: ({ config: { single } }: I18nCompiler.AdapterArg<"next">) => string;
2
+ declare const _default: ({ config: { single }, options: { routes: { localeParamName }, }, }: I18nCompiler.AdapterArg<"next">) => string;
3
3
  export default _default;
@@ -0,0 +1,3 @@
1
+ import type { I18nCompiler } from "../../compiler/types";
2
+ declare const _default: ({ config: { single } }: I18nCompiler.AdapterArg<"next">) => string;
3
+ export default _default;
@@ -1,3 +1,3 @@
1
1
  import type { I18nCompiler } from "../../compiler/types";
2
- declare const _default: ({ config, routes, options, }: I18nCompiler.AdapterArg<"next">) => string;
2
+ declare const _default: ({ config, options, routes, }: I18nCompiler.AdapterArg<"next">) => string;
3
3
  export default _default;
@@ -1,4 +1,6 @@
1
1
  import type { NextConfig } from "next";
2
+ import type { CodeDataRoutesOptions } from "../compiler/code/data-routes";
3
+ import type { I18nCompilerConfig } from "../compiler/config";
2
4
  type Route = string | {
3
5
  [key: string]: Route | string;
4
6
  };
@@ -7,13 +9,8 @@ type Locale = string;
7
9
  type Routes = Record<Locale, RoutesByLocale>;
8
10
  type I18nRoutesOptions = {
9
11
  routes: Routes;
10
- permanent?: boolean;
11
- locales?: Locale[];
12
- defaultLocale?: Locale;
13
- hideDefaultLocaleInUrl?: boolean;
14
- localeParam?: string;
15
12
  debug?: boolean;
16
- };
13
+ } & Pick<I18nCompilerConfig, "locales" | "defaultLocale" | "hideDefaultLocaleInUrl" | "trailingSlash"> & Pick<CodeDataRoutesOptions, "localeParamName" | "permanentRedirects">;
17
14
  export type WithI18nLegacyOptions = NextConfig & {
18
15
  i18nRoutes?: I18nRoutesOptions;
19
16
  };
@@ -1,5 +1,5 @@
1
1
  import type { Redirect } from "next/dist/lib/load-custom-routes";
2
2
  import type { CodeDataRoutesOptions } from "../compiler/code/data-routes";
3
3
  import type { I18nCompiler } from "../compiler/types";
4
- export declare function generateRedirectForPathname(config: Pick<I18nCompiler.Config, "defaultLocale" | "hideDefaultLocaleInUrl">, localeParam: string | undefined, locale: string, template: string, pathname: string, redirects: (Redirect | undefined)[], permanentRedirects?: boolean): void;
5
- export declare let generateRedirects: (config: I18nCompiler.Config, routes: I18nCompiler.DataRoutes["byId"], options: CodeDataRoutesOptions) => Redirect[];
4
+ export declare function generateRedirectForPathname(config: Pick<I18nCompiler.Config, "defaultLocale" | "hideDefaultLocaleInUrl" | "trailingSlash"> & Pick<CodeDataRoutesOptions, "localeParamName" | "permanentRedirects">, locale: string, template: string, pathname: string, redirects: (Redirect | undefined)[]): void;
5
+ export declare let generateRedirects: (config: I18nCompiler.Config, { localeParamName, permanentRedirects, tokens }: CodeDataRoutesOptions, routes: I18nCompiler.DataRoutes["byId"]) => Redirect[];
@@ -1,5 +1,5 @@
1
1
  import type { Rewrite } from "next/dist/lib/load-custom-routes";
2
2
  import type { CodeDataRoutesOptions } from "../compiler/code/data-routes";
3
3
  import type { I18nCompiler } from "../compiler/types";
4
- export declare const generateRewriteForPathname: (config: Pick<I18nCompiler.Config, "defaultLocale" | "hideDefaultLocaleInUrl">, localeParam: string | undefined, locale: string, template: string, pathname: string, rewrites: (Rewrite | undefined)[]) => void;
5
- export declare let generateRewrites: (config: I18nCompiler.Config, routes: I18nCompiler.DataRoutes["byId"], options: CodeDataRoutesOptions) => Rewrite[];
4
+ export declare const generateRewriteForPathname: (config: Pick<I18nCompiler.Config, "defaultLocale" | "hideDefaultLocaleInUrl" | "trailingSlash"> & Pick<CodeDataRoutesOptions, "localeParamName">, locale: string, template: string, pathname: string, rewrites: (Rewrite | undefined)[]) => void;
5
+ export declare let generateRewrites: (config: I18nCompiler.Config, { tokens, localeParamName, permanentRedirects }: CodeDataRoutesOptions, routes: I18nCompiler.DataRoutes["byId"]) => Rewrite[];
@@ -0,0 +1,3 @@
1
+ import type { I18nCompiler } from "../../compiler/types";
2
+ declare const _default: ({}: I18nCompiler.AdapterArg<"react">) => string;
3
+ export default _default;