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