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