/
index.d.ts
36 lines (27 loc) · 997 Bytes
/
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
import { CSSProperties } from 'react';
import { Theme } from 'antd/lib/config-provider/context';
export as namespace ReactUmdDemo;
export default ReactUmdDemo;
export interface AnyObj {
[props: string]: any;
}
declare class ReactUmdDemo {
constructor(options: ReactUmdDemo.ReactUmdDemoOptions);
setTheme(theme: Theme): void; // 设置 antd 主题
render(options: ReactUmdDemo.RenderOptions): void; // 生成渲染
}
declare namespace ReactUmdDemo {
type PageName = 'NotFound' | 'ReduxTest' | 'Page1' | 'Page2';
interface ReactUmdDemoOptions {
container: string | HTMLElement; // 渲染节点 id 或 元素
}
// render 方法的参数,同时也是 react 组件形式时的组件属性
interface RenderOptions {
type: PageName; // 渲染哪一个页面
className?: string; // 包裹元素 className
style?: CSSProperties; // 包裹元素 style
theme?: Theme; // antd 主题配置
// 当前渲染组件的属性
componentProps?: AnyObj;
}
}