import { h, ComponentChildren, Component } from "preact"; import { I18n } from "./controller"; import { Formatter, FormatterMap } from "./interpolation"; export declare class Language { constructor(options: Language.Options); readonly controller: I18n; readonly name: string; resources: Language.Resources; private readonly _pluralProcessor?; private readonly _interpolationProcessor?; addResources(resources: Language.Resources): void; t(namespace: string, id: string): string | string[] | undefined; pluralize(value: string[], count: number): string; interpolate(value: string, fields: Language.InterpolationFields, formatters?: FormatterMap): string; } export declare namespace Language { interface Options { readonly controller: I18n; readonly name: string; readonly resources?: Resources; readonly pluralProcessor?: PluralProcessor; readonly interpolationProcessor?: InterpolationProcessor; } interface PluralProcessor { (value: string[], count: number): string; } interface InterpolationFields { [name: string]: any; } interface InterpolationProcessor { (value: string, fields: InterpolationFields, language: Language, formatters?: Map): string; } interface Resources { [namespace: string]: { [id: string]: string | string[]; }; } namespace Resources { function parse(data: string): Resources; } class Provider extends Component { constructor(props?: Provider.Props); private readonly handleLanguageChange; componentDidMount(): void; componentWillUnmount(): void; render(props: Provider.Props, state: Provider.State): h.JSX.Element; } namespace Provider { interface Props { readonly children: ComponentChildren; readonly use: I18n; } interface State { readonly language: Language | null; } } const Consumer: import("preact").Consumer; }