import { type Accessor } from '@nano_kit/store'; import type { Format } from './types.js'; type ReadValue = Exclude>; export type WrapValues = A extends Accessor ? V : A extends Record ? { [K in keyof A]: ReadValue; } : A; export type WrapArgs = [R] extends [(arg: infer A) => unknown] ? [message: R, values: WrapValues, locale: string] : [message: R, locale: string]; export type Wrapped = [R] extends [(arg: infer A) => unknown] ? (arg: A) => O : O; /** * Creates a formatter that wraps a message with a function deciding what it renders. * @param format - Formatter of the message to wrap. * @param fn - Function that receives the wrapped message and the active locale and returns what the message renders. A message function is passed as is, followed by the values of its call read from signals and accessors, for `fn` to call with the values it chooses. * @returns Formatter that returns what `fn` returns, or a message function returning it. */ export declare function wrap(format: Format, fn: (...args: WrapArgs) => O): Format>; export {}; //# sourceMappingURL=wrap.d.ts.map