forked from alibaba-fusion/next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
72 lines (63 loc) · 2.08 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/// <reference types="react" />
import * as React from 'react';
export interface ConfigProviderProps {
/**
* 样式类名的品牌前缀
*/
prefix?: string;
/**
* 国际化文案对象,属性为组件的 displayName
*/
locale?: Record<string, unknown>;
/**
* 是否开启错误捕捉 errorBoundary
* 如需自定义参数,请传入对象 对象接受参数列表如下:
*
* fallbackUI `Function(error?: {}, errorInfo?: {}) => Element` 捕获错误后的展示
* afterCatch `Function(error?: {}, errorInfo?: {})` 捕获错误后的行为, 比如埋点上传
*/
errorBoundary?: boolean | {
afterCatch?: (error: Error, errorInfo: React.ErrorInfo) => void;
fallbackUI?: (error: Error, errorInfo: React.ErrorInfo) => React.ReactElement<any>;
};
/**
* 是否开启 Pure Render 模式,会提高性能,但是也会带来副作用
*/
pure?: boolean;
/**
* 是否在开发模式下显示组件属性被废弃的 warning 提示
*/
warning?: boolean;
/**
* 是否开启 rtl 模式
*/
rtl?: boolean;
/**
* 设备类型,针对不同的设备类型组件做出对应的响应式变化
*/
device?: 'tablet' | 'desktop' | 'phone';
/**
* 组件树
*/
children?: React.ReactNode;
/**
* 弹层挂载的容器节点
*/
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);
}
export default class ConfigProvider extends React.Component<
ConfigProviderProps,
any
> {
static config(Component: any, options?: any): any;
static getContextProps(props: {}, displayName: string): any;
static initLocales(locales: any): any;
static setLanguage(language: string): any;
static setLocale(locale: any): any;
static setDirection(dir: string): any;
static getLocale(): any;
static getLanguage(): string;
static getDirection(): string;
static clearCache(): any;
static Consumer(props: { children: (ctx: ConfigProviderProps) => React.ReactNode }): JSX.Element;
}