Add ReactShallowRenderer types

See http://facebook.github.io/react/docs/test-utils.html#shallow-rendering
This commit is contained in:
Vincent Siao
2015-03-14 15:29:40 -07:00
parent 0213f7c10e
commit d3584fa716
3 changed files with 21 additions and 0 deletions
+8
View File
@@ -179,6 +179,8 @@ declare module React {
findRenderedComponentWithType<C extends Component<any, any>>(
tree: Component<any, any>,
type: ComponentClass<any>): C;
createRenderer(): ShallowRenderer;
}
interface SyntheticEventData {
@@ -255,5 +257,11 @@ declare module React {
touchStart: EventSimulator;
wheel: EventSimulator;
}
class ShallowRenderer {
getRenderOutput<C extends Component<any, any>>(): C;
render(element: ReactElement<any>, context?: any): void;
unmount(): void;
}
}