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 | export function findDOMNode(instance: ReactInstance | null | undefined): Element | null | Text;
|
21 | export function unmountComponentAtNode(container: Element | DocumentFragment): boolean;
|
22 |
|
23 | export function createPortal(
|
24 | children: ReactNode,
|
25 | container: Element | DocumentFragment,
|
26 | key?: null | string,
|
27 | ): ReactPortal;
|
28 |
|
29 | export const version: string;
|
30 | export const render: Renderer;
|
31 | export const hydrate: Renderer;
|
32 |
|
33 | export function flushSync<R>(fn: () => R): R;
|
34 | export function flushSync<A, R>(fn: (a: A) => R, a: A): R;
|
35 |
|
36 | export function unstable_batchedUpdates<A, R>(callback: (a: A) => R, a: A): R;
|
37 | export function unstable_batchedUpdates<R>(callback: () => R): R;
|
38 |
|
39 | export function unstable_renderSubtreeIntoContainer<T extends Element>(
|
40 | parentComponent: Component<any>,
|
41 | element: DOMElement<DOMAttributes<T>, T>,
|
42 | container: Element,
|
43 | callback?: (element: T) => any,
|
44 | ): T;
|
45 | export function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
|
46 | parentComponent: Component<any>,
|
47 | element: CElement<P, T>,
|
48 | container: Element,
|
49 | callback?: (component: T) => any,
|
50 | ): 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,
|
56 |
|
57 | ): Component<P, ComponentState> | Element | void;
|
58 |
|
59 | export type Container = Element | Document | DocumentFragment;
|
60 |
|
61 | export interface Renderer {
|
62 |
|
63 |
|
64 |
|
65 | <T extends Element>(
|
66 | element: DOMElement<DOMAttributes<T>, T>,
|
67 | container: Container | null,
|
68 | callback?: () => void,
|
69 | ): T;
|
70 |
|
71 | (
|
72 | element: Array<DOMElement<DOMAttributes<any>, any>>,
|
73 | container: Container | null,
|
74 | callback?: () => void,
|
75 | ): Element;
|
76 |
|
77 | (
|
78 | element: FunctionComponentElement<any> | Array<FunctionComponentElement<any>>,
|
79 | container: Container | null,
|
80 | callback?: () => void,
|
81 | ): void;
|
82 |
|
83 | <P, T extends Component<P, ComponentState>>(
|
84 | element: CElement<P, T>,
|
85 | container: Container | null,
|
86 | callback?: () => void,
|
87 | ): T;
|
88 |
|
89 | (
|
90 | element: Array<CElement<any, Component<any, ComponentState>>>,
|
91 | container: Container | null,
|
92 | callback?: () => void,
|
93 | ): Component<any, ComponentState>;
|
94 |
|
95 | <P>(
|
96 | element: ReactElement<P>,
|
97 | container: Container | null,
|
98 | callback?: () => void,
|
99 |
|
100 | ): Component<P, ComponentState> | Element | void;
|
101 |
|
102 | (
|
103 | element: ReactElement[],
|
104 | container: Container | null,
|
105 | callback?: () => void,
|
106 |
|
107 | ): Component<any, ComponentState> | Element | void;
|
108 | }
|