import type { Composable, FieldState } from '@validup/vue'; import type { FieldTranslations } from '@ilingo/validup-vue'; import type { GetContextReactive } from '@ilingo/vue'; import type { GetContext } from 'ilingo'; import type { ObjectLiteral } from 'validup'; import type { Ref } from 'vue'; export declare function injectTranslatorLocale(): Ref; /** * Reactive translation lookup. * * `@ilingo/vue` resolves through ilingo's async `get()`, seeding the ref * with what the synchronous `getSync()` can answer (tada5hi/ilingo#988). * Authup's catalogs are a `MemoryStore`, so that seed IS the translation and * both the server-rendered markup and the render the client hydrates it * against hold the real string. * * A store that needs I/O (a cold `FSStore`/`LoaderStore`, a remote adapter a * consumer registers ahead of the kit's own) declines the synchronous read, * and the seed stays the `.` placeholder until the async * lookup settles a microtask later. That is a mismatch for every translated * string in a server-rendered subtree, so for those the server records what * it resolved and the hydrating client shows it until its own lookup * settles. Nothing is recorded when the seed already answered, which is * every authup key. */ export declare function useTranslation(input: GetContextReactive): Ref; /** * Imperative counterpart to {@see useTranslation} for non-reactive, * event-time lookups — toast bodies built when a mutation resolves, or * nav-label resolution inside the async `Navigation.reduce()` pipeline, * where a render-time `Ref` is the wrong shape. Captures the injected * ilingo instance + locale `Ref` at call site (so it must run in * `setup()`), then returns a translate function that reads the current * `locale.value` on each invocation. Missing keys resolve to the bare * key value rather than `undefined`. */ export declare function useTranslator(): (ctx: GetContext) => Promise; /** * Translate the visible errors of a `@validup/vue` `FieldState` to * localized messages. Successor to the previous * `useTranslationsForBaseValidation` — reads `fieldState.$errors` * (already dirty-gated by `@validup/vue`), so the returned * `Ref` only carries entries the user should see. */ export declare function useTranslationsForField(fieldState: FieldState): FieldTranslations; /** * Translate the form-level `$errors` of a `@validup/vue` `Composable`. * Successor to the previous `useTranslationsForNestedValidation` — sugar * for the common "render all dirty-gated field errors" pattern. */ export declare function useTranslationsForComposable(composable: Composable): FieldTranslations; //# sourceMappingURL=singleton.d.ts.map