// Type definitions for i18n/I18nDecorator type Omit = Pick>; type Merge = Omit> & N; export interface I18nDecoratorConfig extends Object { /** * Array of locales that should be treated as latin regardless of their script. */ latinLanguageOverrides?: string[]; /** * Array of locales that should be treated as non-latin regardless of their script. */ nonLatinLanguageOverrides?: string[]; /** * Array of resource loaders to be invoked after a locale change. * * Each loader must be a function which accepts an object and returns either the resource when `options.sync` is `true` or a `Promise` for the resource when `options.sync` is `false` . * ``` resources: [ (options) => new Promise((resolve, reject) => { fetchResource({onLoad: resolve, onError: reject}); }) ] ``` * If you need to handle the resource in some way on load, you can pass an object with an `onLoad` member that will be called once all resources have been loaded. This should be used if loading a resource has side effects that should only be applied once all loading has completed. * ``` resources: [ {resource: (options) => { ... fetch ... }, onLoad: (res) => { ... apply side effect ... }} ] ``` */ resources?: Function | object[]; /** * Retrieve i18n resource files synchronously. */ sync?: boolean; } export interface I18nDecoratorProps { /** * Classes to apply to the wrapped component. */ className?: string; /** * The locale to use. * * A string with a . The system locale will be used by default. */ locale?: string; } export function I18nDecorator

( config: I18nDecoratorConfig, Component: React.ComponentType

| string, ): React.ComponentType

; export function I18nDecorator

( Component: React.ComponentType

| string, ): React.ComponentType

; export interface I18nContextDecoratorConfig extends Object { /** * The prop name for `locale` property of i18nContext. */ localeProp?: string; /** * The prop name for `rtl` property of i18nContext. */ rtlProp?: string; /** * The prop name for `updateLocale` property of i18nContext. */ updateLocaleProp?: string; } export interface I18nContextDecoratorProps {} export function I18nContextDecorator

( config: I18nContextDecoratorConfig, Component: React.ComponentType

| string, ): React.ComponentType

; export function I18nContextDecorator

( Component: React.ComponentType

| string, ): React.ComponentType

; export default I18nDecorator;