-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathreact-addons-test-utils_v15.x.x.js
66 lines (65 loc) · 2.45 KB
/
react-addons-test-utils_v15.x.x.js
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// flow-typed signature: 323fcc1a3353d5f7a36c5f1edcd963ef
// flow-typed version: 41f45a7d8c/react-addons-test-utils_v15.x.x/flow_>=v0.23.x
declare type ReactAddonTest$FunctionOrComponentClass =
| React$Component<any, any, any>
| Function;
declare module "react-addons-test-utils" {
declare var Simulate: {
[eventName: string]: (element: Element, eventData?: Object) => void
};
declare function renderIntoDocument(
instance: React$Element<any>
): React$Component<any, any, any>;
declare function mockComponent(
componentClass: ReactAddonTest$FunctionOrComponentClass,
mockTagName?: string
): Object;
declare function isElement(element: React$Element<any>): boolean;
declare function isElementOfType(
element: React$Element<any>,
componentClass: ReactAddonTest$FunctionOrComponentClass
): boolean;
declare function isDOMComponent(
instance: React$Component<any, any, any>
): boolean;
declare function isCompositeComponent(
instance: React$Component<any, any, any>
): boolean;
declare function isCompositeComponentWithType(
instance: React$Component<any, any, any>,
componentClass: ReactAddonTest$FunctionOrComponentClass
): boolean;
declare function findAllInRenderedTree(
tree: React$Component<any, any, any>,
test: (child: React$Component<any, any, any>) => boolean
): Array<React$Component<any, any, any>>;
declare function scryRenderedDOMComponentsWithClass(
tree: React$Component<any, any, any>,
className: string
): Array<Element>;
declare function findRenderedDOMComponentWithClass(
tree: React$Component<any, any, any>,
className: string
): ?Element;
declare function scryRenderedDOMComponentsWithTag(
tree: React$Component<any, any, any>,
tagName: string
): Array<Element>;
declare function findRenderedDOMComponentWithTag(
tree: React$Component<any, any, any>,
tagName: string
): ?Element;
declare function scryRenderedComponentsWithType(
tree: React$Component<any, any, any>,
componentClass: ReactAddonTest$FunctionOrComponentClass
): Array<React$Component<any, any, any>>;
declare function findRenderedComponentWithType(
tree: React$Component<any, any, any>,
componentClass: ReactAddonTest$FunctionOrComponentClass
): ?React$Component<any, any, any>;
declare class ReactShallowRender {
render(element: React$Element<any>): void,
getRenderOutput(): React$Element<any>
}
declare function createRenderer(): ReactShallowRender;
}