UNPKG

932 BTypeScriptView Raw
1import * as React from 'react';
2import { Locale } from '.';
3export interface LocaleReceiverProps {
4 componentName?: string;
5 defaultLocale?: object | Function;
6 children: (locale: object, localeCode?: string, fullLocale?: object) => React.ReactNode;
7}
8interface LocaleInterface {
9 [key: string]: any;
10}
11export interface LocaleReceiverContext {
12 antLocale?: LocaleInterface;
13}
14export 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}
25declare type LocaleComponent = keyof Locale;
26export declare function useLocaleReceiver<T extends LocaleComponent>(componentName: T, defaultLocale?: Locale[T] | Function): [Locale[T]];
27export {};