@koine/i18n 2.0.0-beta.85 → 2.0.0-beta.87
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/adapter-js/code/_routesSlimLookup.d.ts +1 -0
- package/adapter-js/code/createT.d.ts +3 -0
- package/adapter-js/code/getAlternates.d.ts +3 -0
- package/adapter-js/code/getAlternatesFromDom.d.ts +3 -0
- package/adapter-js/code/getI18nDictionaries.d.ts +3 -0
- package/adapter-js/code/getT.d.ts +3 -0
- package/adapter-js/code/index.d.ts +2 -2
- package/adapter-js/code/loadTranslations.d.ts +3 -0
- package/adapter-js/code/pathnames.d.ts +3 -0
- package/adapter-js/index.d.ts +5 -0
- package/adapter-js/options.d.ts +4 -0
- package/adapter-next/code/I18nAlternates.d.ts +3 -0
- package/adapter-next/code/I18nApp.d.ts +3 -0
- package/adapter-next/code/I18nHead.d.ts +3 -0
- package/adapter-next/code/I18nLayout.d.ts +3 -0
- package/adapter-next/code/I18nPage.d.ts +3 -0
- package/adapter-next/code/I18nRoot.d.ts +3 -0
- package/adapter-next/code/getI18nMetadata.d.ts +3 -0
- package/adapter-next/code/i18nProps.d.ts +3 -0
- package/adapter-next/code/index.d.ts +2 -2
- package/adapter-next/code/useRouteId.d.ts +1 -1
- package/adapter-next/index.d.ts +5 -0
- package/adapter-next/options.d.ts +4 -0
- package/adapter-next/plugin-async.d.ts +1 -1
- package/adapter-next/plugin-legacy.d.ts +3 -4
- package/adapter-next/redirects.d.ts +1 -0
- package/adapter-next/rewrites.d.ts +1 -0
- package/adapter-next-translate/code/index.d.ts +2 -2
- package/adapter-next-translate/index.d.ts +5 -0
- package/adapter-next-translate/options.d.ts +3 -0
- package/adapter-react/code/I18nAlternatesContext.d.ts +3 -0
- package/adapter-react/code/I18nAlternatesProvider.d.ts +3 -0
- package/adapter-react/code/I18nAlternatesSetter.d.ts +3 -0
- package/adapter-react/code/I18nContext.d.ts +3 -0
- package/adapter-react/code/I18nEffects.d.ts +3 -0
- package/adapter-react/code/I18nProvider.d.ts +3 -0
- package/adapter-react/code/I18nRouteContext.d.ts +3 -0
- package/adapter-react/code/I18nRouteProvider.d.ts +3 -0
- package/adapter-react/code/T.d.ts +3 -0
- package/adapter-react/code/TransText.d.ts +3 -0
- package/adapter-react/code/formatElements.d.ts +3 -0
- package/adapter-react/code/index.d.ts +2 -0
- package/adapter-react/code/useAlternates.d.ts +3 -0
- package/adapter-react/code/useLocale.d.ts +3 -0
- package/adapter-react/code/useT.d.ts +3 -0
- package/adapter-react/index.d.ts +5 -0
- package/adapter-react/options.d.ts +2 -0
- package/api.cjs.js +1784 -352
- package/api.esm.js +1792 -362
- package/compiler/api.d.ts +9 -8
- package/compiler/code/data-translations.d.ts +8 -5
- package/compiler/code/data.d.ts +14 -32
- package/compiler/code/generate.d.ts +4 -8
- package/compiler/code/index.d.ts +2 -2
- package/compiler/code/write.d.ts +2 -3
- package/compiler/config.d.ts +13 -5
- package/compiler/createAdapter.d.ts +5 -0
- package/compiler/helpers.d.ts +1 -0
- package/compiler/summary/generate.d.ts +1 -2
- package/compiler/summary/index.d.ts +0 -1
- package/compiler/summary/write.d.ts +3 -3
- package/compiler/types.d.ts +19 -25
- package/next.cjs.js +77 -171
- package/next.esm.js +78 -172
- package/package.json +3 -3
- /package/adapter-js/code/{tFns.d.ts → t.d.ts} +0 -0
- /package/adapter-next/code/{useLocale.d.ts → deprecated_useLocale.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { I18nCompiler } from "../../compiler/types";
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const _default: (data: I18nCompiler.DataCode, adapterOptions: import("type-fest/source/partial-deep").PartialObjectDeep<import("../options").AdapterJsOptions, {}>) => I18nCompiler.Adapter<"js" | "react" | "next" | "next-translate"> | Promise<I18nCompiler.Adapter<"js" | "react" | "next" | "next-translate">>;
|
|
3
|
+
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { I18nCompiler } from "../../compiler/types";
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const _default: (data: I18nCompiler.DataCode, adapterOptions: import("type-fest/source/partial-deep").PartialObjectDeep<import("../options").AdapterNextOptions, {}>) => I18nCompiler.Adapter<"js" | "react" | "next" | "next-translate"> | Promise<I18nCompiler.Adapter<"js" | "react" | "next" | "next-translate">>;
|
|
3
|
+
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { I18nCompiler } from "../../compiler/types";
|
|
2
|
-
declare const _default: ({ options: { routes: { localeParamName }, }, }: I18nCompiler.AdapterArg<"next">) => string;
|
|
2
|
+
declare const _default: ({ options: { routes: { localeParamName }, }, adapterOptions: { router }, }: I18nCompiler.AdapterArg<"next">) => string;
|
|
3
3
|
export default _default;
|
|
@@ -4,5 +4,5 @@ type NextConfigFn = (phase: string, context?: any) => Promise<NextConfig> | Next
|
|
|
4
4
|
export type WithI18nAsyncOptions = NextConfig & {
|
|
5
5
|
i18nCompiler?: I18nCompilerOptions;
|
|
6
6
|
};
|
|
7
|
-
export declare let withI18nAsync: <TAdapterName extends "js" | "next" | "next-translate">(config?: WithI18nAsyncOptions) => NextConfigFn;
|
|
7
|
+
export declare let withI18nAsync: <TAdapterName extends "js" | "react" | "next" | "next-translate">(config?: WithI18nAsyncOptions) => NextConfigFn;
|
|
8
8
|
export {};
|
|
@@ -8,15 +8,14 @@ type Routes = Record<Locale, RoutesByLocale>;
|
|
|
8
8
|
type I18nRoutesOptions = {
|
|
9
9
|
routes: Routes;
|
|
10
10
|
permanent?: boolean;
|
|
11
|
-
locales
|
|
12
|
-
defaultLocale
|
|
11
|
+
locales?: Locale[];
|
|
12
|
+
defaultLocale?: Locale;
|
|
13
13
|
hideDefaultLocaleInUrl?: boolean;
|
|
14
14
|
localeParam?: string;
|
|
15
15
|
debug?: boolean;
|
|
16
16
|
};
|
|
17
|
-
type I18nRoutesNextOptions = Omit<I18nRoutesOptions, "locales" | "defaultLocale">;
|
|
18
17
|
export type WithI18nLegacyOptions = NextConfig & {
|
|
19
|
-
i18nRoutes?:
|
|
18
|
+
i18nRoutes?: I18nRoutesOptions;
|
|
20
19
|
};
|
|
21
20
|
export declare let withI18nLegacy: (config: WithI18nLegacyOptions) => NextConfig;
|
|
22
21
|
export {};
|
|
@@ -1,4 +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;
|
|
4
5
|
export declare let generateRedirects: (config: I18nCompiler.Config, routes: I18nCompiler.DataRoutes["byId"], options: CodeDataRoutesOptions) => Redirect[];
|
|
@@ -1,4 +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;
|
|
4
5
|
export declare let generateRewrites: (config: I18nCompiler.Config, routes: I18nCompiler.DataRoutes["byId"], options: CodeDataRoutesOptions) => Rewrite[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { I18nCompiler } from "../../compiler/types";
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const _default: (data: I18nCompiler.DataCode, adapterOptions: import("type-fest/source/partial-deep").PartialObjectDeep<Partial<Pick<import("next-translate").I18nConfig, "loader">>, {}>) => I18nCompiler.Adapter<"js" | "react" | "next" | "next-translate"> | Promise<I18nCompiler.Adapter<"js" | "react" | "next" | "next-translate">>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: (data: import("../../compiler-sync").I18nCompiler.DataCode, adapterOptions: import("type-fest/source/partial-deep").PartialObjectDeep<import("../options").AdapterReactOptions, {}>) => import("../../compiler-sync").I18nCompiler.Adapter<"js" | "react" | "next" | "next-translate"> | Promise<import("../../compiler-sync").I18nCompiler.Adapter<"js" | "react" | "next" | "next-translate">>;
|
|
2
|
+
export default _default;
|