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