///
///
import type { ParsedUrlQueryInput } from 'node:querystring';
import type { UrlObject } from 'url';
import { AllLocales, Pathnames } from '../shared/types';
import StrictParams from './StrictParams';
type SearchParamValue = ParsedUrlQueryInput[keyof ParsedUrlQueryInput];
type HrefOrHrefWithParamsImpl = Pathname extends `${string}[[...${string}` ? // Optional catch-all
Pathname | ({
pathname: Pathname;
params?: StrictParams;
} & Other) : Pathname extends `${string}[${string}` ? // Required catch-all & regular params
{
pathname: Pathname;
params: StrictParams;
} & Other : // No params
Pathname | ({
pathname: Pathname;
} & Other);
export type HrefOrUrlObjectWithParams = HrefOrHrefWithParamsImpl>;
export type HrefOrHrefWithParams = HrefOrHrefWithParamsImpl;
}>;
export declare function normalizeNameOrNameWithParams(href: HrefOrHrefWithParams): {
pathname: Pathname;
params?: StrictParams;
};
export declare function serializeSearchParams(searchParams: Record): string;
type StrictUrlObject = Omit & {
pathname: Pathname;
};
export declare function compileLocalizedPathname(opts: {
locale: Locales[number];
pathname: Pathname;
params?: StrictParams;
pathnames: Pathnames;
query?: Record;
}): string;
export declare function compileLocalizedPathname(opts: {
locale: Locales[number];
pathname: StrictUrlObject;
params?: StrictParams;
pathnames: Pathnames;
query?: Record;
}): UrlObject;
export declare function getRoute({ locale, pathname, pathnames }: {
locale: Locales[number];
pathname: string;
pathnames: Pathnames;
}): string;
export {};