import React from "react"; export declare type TranslationValues = string | Array; export interface Translation { [key: string]: TranslationValues; } export interface TranslationContextInterface { /** * A boolean flag to indicate the translation fetching is in progress. */ isLoading: boolean; /** * The translation helper method that returns the translation text * corresponding to the translation key provided. * * @param {string} key - The translation text key * @param {object} [data] - The data to be interpolated * @returns {(string|Array)} the translation values correspond to the key provided */ t: (key: string, data?: { [key: string]: any; }) => TranslationValues; } export interface TranslationProviderProps { /** * The translation source URL. */ url: string; /** * The fallback translation if translation fetching fails. This is useful * when either network fail or the translation source is unreachable. */ fallbackTranslation?: Translation; /** * The response path to the translation, defaulted to `result.content`. * This is to map the response into actual translation key mapping. */ translationPath?: string; } declare const TranslationProvider: React.FC>; declare function useTranslationContext(): TranslationContextInterface; export { TranslationProvider, useTranslationContext };