1 |
|
2 |
|
3 |
|
4 |
|
5 | export as namespace ReactDOM;
|
6 |
|
7 | import {
|
8 | CElement,
|
9 | Component,
|
10 | ComponentState,
|
11 | DOMAttributes,
|
12 | DOMElement,
|
13 | FunctionComponentElement,
|
14 | ReactElement,
|
15 | ReactInstance,
|
16 | ReactNode,
|
17 | ReactPortal,
|
18 | } from "react";
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | export function findDOMNode(instance: ReactInstance | null | undefined): Element | null | Text;
|
24 |
|
25 |
|
26 |
|
27 | export function unmountComponentAtNode(container: Element | DocumentFragment): boolean;
|
28 |
|
29 | export function createPortal(
|
30 | children: ReactNode,
|
31 | container: Element | DocumentFragment,
|
32 | key?: null | string,
|
33 | ): ReactPortal;
|
34 |
|
35 | export const version: string;
|
36 |
|
37 |
|
38 |
|
39 | export const render: Renderer;
|
40 |
|
41 |
|
42 |
|
43 | export const hydrate: Renderer;
|
44 |
|
45 | export function flushSync<R>(fn: () => R): R;
|
46 |
|
47 | export function unstable_batchedUpdates<A, R>(callback: (a: A) => R, a: A): R;
|
48 | export function unstable_batchedUpdates<R>(callback: () => R): R;
|
49 |
|
50 |
|
51 |
|
52 |
|
53 | export function unstable_renderSubtreeIntoContainer<T extends Element>(
|
54 | parentComponent: Component<any>,
|
55 | element: DOMElement<DOMAttributes<T>, T>,
|
56 | container: Element,
|
57 | callback?: (element: T) => any,
|
58 | ): T;
|
59 |
|
60 |
|
61 |
|
62 | export function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
|
63 | parentComponent: Component<any>,
|
64 | element: CElement<P, T>,
|
65 | container: Element,
|
66 | callback?: (component: T) => any,
|
67 | ): T;
|
68 |
|
69 |
|
70 |
|
71 | export function unstable_renderSubtreeIntoContainer<P>(
|
72 | parentComponent: Component<any>,
|
73 | element: ReactElement<P>,
|
74 | container: Element,
|
75 | callback?: (component?: Component<P, ComponentState> | Element) => any,
|
76 |
|
77 | ): Component<P, ComponentState> | Element | void;
|
78 |
|
79 | export type Container = Element | Document | DocumentFragment;
|
80 |
|
81 | export interface Renderer {
|
82 |
|
83 |
|
84 |
|
85 | |
86 |
|
87 |
|
88 | <T extends Element>(
|
89 | element: DOMElement<DOMAttributes<T>, T>,
|
90 | container: Container | null,
|
91 | callback?: () => void,
|
92 | ): T;
|
93 |
|
94 | |
95 |
|
96 |
|
97 | (
|
98 | element: Array<DOMElement<DOMAttributes<any>, any>>,
|
99 | container: Container | null,
|
100 | callback?: () => void,
|
101 | ): Element;
|
102 |
|
103 | |
104 |
|
105 |
|
106 | (
|
107 | element: FunctionComponentElement<any> | Array<FunctionComponentElement<any>>,
|
108 | container: Container | null,
|
109 | callback?: () => void,
|
110 | ): void;
|
111 |
|
112 | |
113 |
|
114 |
|
115 | <P, T extends Component<P, ComponentState>>(
|
116 | element: CElement<P, T>,
|
117 | container: Container | null,
|
118 | callback?: () => void,
|
119 | ): T;
|
120 |
|
121 | |
122 |
|
123 |
|
124 | (
|
125 | element: Array<CElement<any, Component<any, ComponentState>>>,
|
126 | container: Container | null,
|
127 | callback?: () => void,
|
128 | ): Component<any, ComponentState>;
|
129 |
|
130 | |
131 |
|
132 |
|
133 | <P>(
|
134 | element: ReactElement<P>,
|
135 | container: Container | null,
|
136 | callback?: () => void,
|
137 |
|
138 | ): Component<P, ComponentState> | Element | void;
|
139 |
|
140 | |
141 |
|
142 |
|
143 | (
|
144 | element: ReactElement[],
|
145 | container: Container | null,
|
146 | callback?: () => void,
|
147 |
|
148 | ): Component<any, ComponentState> | Element | void;
|
149 | }
|