import { App, Ref } from 'vue'; export type Locale = string; export interface I18n { /** * Locale message translation * * @param key - The translation key * @param params - A values of named interpolation * * @returns translation message * @example `t('Hello {user}!', { user: 'John Doe' })` - returns: 'Hello John Doe!' */ t: (key: string, params?: Record) => string; /** * Change the locale dynamically * * @param newLocale - The locale to switch to */ setLocale: (newLocale: Locale) => Promise; /** * Get the current locale * * @returns Current locale */ locale: Ref; } export interface TranslateTextResponseList { translations: TranslateTextResponseTranslation[]; } export interface TranslateTextResponseTranslation { translatedText: string; } export interface GoogleTranslationResponse { data: TranslateTextResponseList; } /** * Query parameters for making a request to the Google Cloud Translate API v2. * Reference: https://cloud.google.com/translate/docs/reference/rest/v2/translate */ export interface GoogleTranslateRequestQueryParams { /** * The input text to translate. * Can be a single string or an array of strings (up to 128 items). * Example: "Hello world" or ["Hello", "How are you?"] */ q: string | string[]; /** * The target language code to translate the input text into. * Must be a supported language code from: * https://cloud.google.com/translate/docs/languages * Example: "id" for Indonesian, "es" for Spanish. */ target: string; /** * (Optional) The format of the source text. * Use `"text"` for plain text or `"html"` if the source contains HTML tags. * Default is `"html"`. */ format?: 'html' | 'text'; /** * (Optional) The source language code of the input text. * If omitted, the API will automatically detect the source language. * Supported language codes: https://cloud.google.com/translate/docs/languages * Example: "en" for English. */ source?: string; /** * A valid API key for authenticating the request. * You can generate and manage API keys in the Google Cloud Console: * https://console.cloud.google.com/apis/credentials */ key: string; } export declare const useI18n: () => I18n; declare const _default: { install: (app: App) => void; }; export default _default; declare module 'vue' { interface ComponentCustomProperties { $i18n: I18n; $t: I18n['t']; } }