import { type Signalish } from '@nano_kit/store'; import type { FormatContext } from '../types.js'; import type { AnyFormat, FnWithParams, Format, FormatsInput, UnionToIntersection, ParamsOf } from './types.js'; type CaseParams = F extends AnyFormat ? ParamsOf : {}; export type MatchParams>> = { [P in K]: Signalish; } & UnionToIntersection>; export type ArgMatchFn = FnWithParams>; export type MatchFn>> = FnWithParams | Signalish>; export type CasesFn>> = ((ctx: FormatContext, input: FormatsInput | undefined, resolvedCases: Record>) => void) & { s: true; }; type CaseFormat = AnyFormat>; type GetKey = (param: any, locale: string, cases: Record) => string; /** * Creates a reusable cases resolver for `match`. * @param cases - Case formatters keyed by possible resolved values. * @returns Resolver that formats all cases for the current context and translation input. */ export declare function cases>>(cases: B): CasesFn; /** * Creates a case key resolver that falls back to a known case when the parameter value is missing. * @param key - Case key used when the parameter value does not exist in resolved cases. * @returns Resolver that keeps existing case keys and falls back to `key` for unknown values. */ export declare function other(key: string): GetKey; /** * Creates a formatter that selects one case by parameter value. * @param param - Parameter name used to select a case and replace `{param}` placeholders. * @param getKey - Optional resolver used to map the parameter value to a case key. * @returns Formatter that resolves cases and returns a parameterized message function. */ export declare function match>>(param: K, getKey?: GetKey): Format | string, MatchFn>; /** * Creates a formatter that selects one case by parameter value. * @param param - Parameter name used to select a case and replace `{param}` placeholders. * @param cases - Case formatters keyed by possible resolved values. * @param getKey - Optional resolver used to map the parameter value to a case key. * @returns Formatter that resolves cases and returns a parameterized message function. */ export declare function match>>(param: K, cases?: CasesFn, getKey?: GetKey): Format | string, MatchFn>; export {}; //# sourceMappingURL=match.d.ts.map