1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export as namespace ReactDOM;
|
17 |
|
18 | import {
|
19 | ReactInstance, Component, ComponentState,
|
20 | ReactElement, SFCElement, CElement,
|
21 | DOMAttributes, DOMElement, ReactNode, ReactPortal
|
22 | } from 'react';
|
23 |
|
24 | export function findDOMNode(instance: ReactInstance | null | undefined): Element | null | Text;
|
25 | export function unmountComponentAtNode(container: Element | DocumentFragment): boolean;
|
26 |
|
27 | export function createPortal(children: ReactNode, container: Element, key?: null | string): ReactPortal;
|
28 |
|
29 | export const version: string;
|
30 | export const render: Renderer;
|
31 | export const hydrate: Renderer;
|
32 |
|
33 | export function unstable_batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void;
|
34 | export function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void;
|
35 | export function unstable_batchedUpdates(callback: () => any): void;
|
36 |
|
37 | export function unstable_renderSubtreeIntoContainer<T extends Element>(
|
38 | parentComponent: Component<any>,
|
39 | element: DOMElement<DOMAttributes<T>, T>,
|
40 | container: Element,
|
41 | callback?: (element: T) => any): T;
|
42 | export function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
|
43 | parentComponent: Component<any>,
|
44 | element: CElement<P, T>,
|
45 | container: Element,
|
46 | callback?: (component: T) => any): T;
|
47 | export function unstable_renderSubtreeIntoContainer<P>(
|
48 | parentComponent: Component<any>,
|
49 | element: ReactElement<P>,
|
50 | container: Element,
|
51 | callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
|
52 |
|
53 | export interface Renderer {
|
54 |
|
55 |
|
56 |
|
57 | <T extends Element>(
|
58 | element: DOMElement<DOMAttributes<T>, T>,
|
59 | container: Element | DocumentFragment | null,
|
60 | callback?: () => void
|
61 | ): T;
|
62 |
|
63 | (
|
64 | element: Array<DOMElement<DOMAttributes<any>, any>>,
|
65 | container: Element | DocumentFragment | null,
|
66 | callback?: () => void
|
67 | ): Element;
|
68 |
|
69 | (
|
70 | element: SFCElement<any> | Array<SFCElement<any>>,
|
71 | container: Element | DocumentFragment | null,
|
72 | callback?: () => void
|
73 | ): void;
|
74 |
|
75 | <P, T extends Component<P, ComponentState>>(
|
76 | element: CElement<P, T>,
|
77 | container: Element | DocumentFragment | null,
|
78 | callback?: () => void
|
79 | ): T;
|
80 |
|
81 | (
|
82 | element: Array<CElement<any, Component<any, ComponentState>>>,
|
83 | container: Element | DocumentFragment | null,
|
84 | callback?: () => void
|
85 | ): Component<any, ComponentState>;
|
86 |
|
87 | <P>(
|
88 | element: ReactElement<P>,
|
89 | container: Element | DocumentFragment | null,
|
90 | callback?: () => void
|
91 | ): Component<P, ComponentState> | Element | void;
|
92 |
|
93 | (
|
94 | element: ReactElement[],
|
95 | container: Element | DocumentFragment | null,
|
96 | callback?: () => void
|
97 | ): Component<any, ComponentState> | Element | void;
|
98 | }
|