forked from Zerthox/betterdiscord-types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreactutils.d.ts
26 lines (21 loc) · 816 Bytes
/
reactutils.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { Fiber } from "react-reconciler";
export interface ReactUtils {
get rootInstance(): any;
/** Gets the internal react data of a specified node. */
getInternalInstance(node: HTMLElement): Fiber | undefined;
/**
* Attempts to find the "owner" node to the current node.
* This is generally a node with an instance of a class component as `stateNode`.
*/
getOwnerInstance(
node: HTMLElement,
options?: GetOwnerInstanceOptions,
): React.Component<any, any> | null;
/** Creates an unrendered react component that wraps dom elements. */
wrapElement(element: HTMLElement): React.ComponentClass;
}
export interface GetOwnerInstanceOptions {
include?: string[];
exclude?: string[];
filter?: (node: React.Component<any, any>) => boolean;
}