choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
81 lines (80 loc) • 3.88 kB
TypeScript
import { Component, ReactElement } from 'react';
import PropTypes from 'prop-types';
import { ModalLocale } from '../modal/locale';
export interface Locale {
locale: string;
Pagination?: Object;
Cascader?: Object;
DatePicker?: Object;
TimePicker?: Object;
Calendar?: Object;
Table?: Object;
Modal?: ModalLocale;
Popconfirm?: Object;
Transfer?: Object;
Select?: Object;
Upload?: Object;
imageCrop?: imageCrop;
performanceTable?: PerformanceTable;
}
export interface imageCrop {
editImage: string;
avatarUploadError: string;
avatarServerError: string;
avatarUpload: string;
avatarReminder: string;
preview: string;
reUpload: string;
imageTooLarge: string;
imageUploadError: string;
imageDragHere: string;
pleaseUpload: string;
uploadType: string;
picture: string;
cancelButton: string;
saveButton: string;
changeAvatar: string;
}
export interface PerformanceTable {
emptyMessage: string;
loading: string;
}
export interface LocaleProviderProps {
locale: Locale;
children?: ReactElement<any>;
}
export default class LocaleProvider extends Component<LocaleProviderProps, any> {
static propTypes: {
locale: PropTypes.Requireable<object>;
};
static defaultProps: {
locale: {};
};
static childContextTypes: {
c7nLocale: PropTypes.Requireable<object>;
};
getChildContext(): {
c7nLocale: {
exist: boolean;
locale: string;
Pagination?: Object | undefined;
Cascader?: Object | undefined;
DatePicker?: Object | undefined;
TimePicker?: Object | undefined;
Calendar?: Object | undefined;
Table?: Object | undefined;
Modal?: ModalLocale | undefined;
Popconfirm?: Object | undefined;
Transfer?: Object | undefined;
Select?: Object | undefined;
Upload?: Object | undefined;
imageCrop?: imageCrop | undefined;
performanceTable?: PerformanceTable | undefined;
};
};
componentWillMount(): void;
componentWillReceiveProps(nextProps: LocaleProviderProps): void;
componentDidUpdate(): void;
componentWillUnmount(): void;
render(): ReactElement<any, string | ((props: any) => ReactElement<any, string | any | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)> | (ReactElement<any, string | ((props: any) => ReactElement<any, string | any | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)> & string) | (ReactElement<any, string | ((props: any) => ReactElement<any, string | any | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)> & number) | (ReactElement<any, string | ((props: any) => ReactElement<any, string | any | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)> & false) | (ReactElement<any, string | ((props: any) => ReactElement<any, string | any | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)> & true) | (ReactElement<any, string | ((props: any) => ReactElement<any, string | any | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)> & ReactElement<any, string | ((props: any) => ReactElement<any, string | any | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>) | (ReactElement<any, string | ((props: any) => ReactElement<any, string | any | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)> & import("react").ReactPortal) | undefined;
}