UNPKG

@intl-t/next

Version:

A Fully-Typed Object-Based i18n Translation Library for Next.js

21 lines (20 loc) 974 B
import type { Locale } from "@intl-t/locales"; import { ResolveConfig } from "@intl-t/tools/resolvers"; import { default as NL, LinkProps as LP } from "next/link"; import type { FC, ReactNode, ComponentProps } from "react"; import { LC } from "./link_client"; export type NL = typeof NL; export interface LinkConfig<LC extends FC<any> = NL> { Link?: LC; preventDynamic?: boolean; } export interface LinkProps<L extends Locale = Locale, LC extends FC<any> = NL> extends LinkConfig<LC>, Omit<LP, "href"> { href?: string; locale?: L; currentLocale?: L; config?: ResolveConfig<L> & LinkConfig<LC>; children?: ReactNode; } export { LC }; export declare function LS<L extends Locale, L_ extends string, LC extends FC<any>>({ href, locale, currentLocale, config, Link, preventDynamic, ...props }: LinkProps<L | L_, LC> & Omit<ComponentProps<LC>, keyof LinkProps>): Promise<import("react/jsx-runtime").JSX.Element>; export declare const Link: typeof LS;