-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathskin-deep.d.ts
23 lines (19 loc) · 876 Bytes
/
skin-deep.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
import { ReactElement, ComponentClass } from 'react';
export type Selector = string | ComponentClass<{}>;
export type Matcher = {} | ((node: JSX.Element) => boolean);
export interface Tree<P, C> {
type: ComponentClass<P> | string;
props: P;
reRender(props: P, context?: C): void;
getMountedInstance(): {};
subTree(query: Selector, predicate?: Matcher): Tree<{}, C>;
everySubTree(query: Selector, predicate?: Matcher): Tree<{}, C>[];
dive(paths: Selector[]): Tree<{}, {}>;
dive<C>(paths: Selector[], context: C): Tree<{}, C>;
text(): string;
getRenderOutput(): ReactElement<P>;
toString(): string;
}
export function shallowRender<P>(element: ReactElement<P>|JSX.Element): Tree<P, {}>;
export function shallowRender<P, C>(element: ReactElement<P>|JSX.Element, context: C): Tree<P, C>;
export function hasClass(node: JSX.Element, cls: string): boolean;