1 | import * as React from 'react';
|
2 | import { Locale } from '.';
|
3 | export interface LocaleReceiverProps {
|
4 | componentName?: string;
|
5 | defaultLocale?: object | Function;
|
6 | children: (locale: object, localeCode?: string, fullLocale?: object) => React.ReactNode;
|
7 | }
|
8 | interface LocaleInterface {
|
9 | [key: string]: any;
|
10 | }
|
11 | export interface LocaleReceiverContext {
|
12 | antLocale?: LocaleInterface;
|
13 | }
|
14 | export default class LocaleReceiver extends React.Component<LocaleReceiverProps> {
|
15 | static defaultProps: {
|
16 | componentName: string;
|
17 | };
|
18 | static contextType: React.Context<(Partial<Locale> & {
|
19 | exist?: boolean | undefined;
|
20 | }) | undefined>;
|
21 | getLocale(): any;
|
22 | getLocaleCode(): any;
|
23 | render(): React.ReactNode;
|
24 | }
|
25 | declare type LocaleComponent = keyof Locale;
|
26 | export declare function useLocaleReceiver<T extends LocaleComponent>(componentName: T, defaultLocale?: Locale[T] | Function): [Locale[T]];
|
27 | export {};
|