diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/@types/react-dom | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) | |
download | wallet-core-363723fc84f7b8477592e0105aeb331ec9a017af.tar.xz |
node_modules
Diffstat (limited to 'node_modules/@types/react-dom')
-rw-r--r-- | node_modules/@types/react-dom/LICENSE | 42 | ||||
-rw-r--r-- | node_modules/@types/react-dom/README.md | 6 | ||||
-rw-r--r-- | node_modules/@types/react-dom/index.d.ts | 137 | ||||
-rw-r--r-- | node_modules/@types/react-dom/node-stream/index.d.ts | 20 | ||||
-rw-r--r-- | node_modules/@types/react-dom/package.json | 9 | ||||
-rw-r--r-- | node_modules/@types/react-dom/server/index.d.ts | 48 | ||||
-rw-r--r-- | node_modules/@types/react-dom/test-utils/index.d.ts | 484 |
7 files changed, 385 insertions, 361 deletions
diff --git a/node_modules/@types/react-dom/LICENSE b/node_modules/@types/react-dom/LICENSE index 21071075c..4b1ad51b2 100644 --- a/node_modules/@types/react-dom/LICENSE +++ b/node_modules/@types/react-dom/LICENSE @@ -1,21 +1,21 @@ - MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE + MIT License
+
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/node_modules/@types/react-dom/README.md b/node_modules/@types/react-dom/README.md index 25281a394..27c51e66c 100644 --- a/node_modules/@types/react-dom/README.md +++ b/node_modules/@types/react-dom/README.md @@ -8,9 +8,9 @@ This package contains type definitions for React (react-dom) (http://facebook.gi Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom
Additional Details
- * Last updated: Tue, 18 Apr 2017 18:28:36 GMT
- * Dependencies: react
- * Global values: ReactDOM, ReactDOMServer
+ * Last updated: Thu, 03 Aug 2017 13:57:01 GMT
+ * Dependencies: react, stream, node
+ * Global values: ReactDOM, ReactDOMNodeStream, ReactDOMServer
# Credits
These definitions were written by Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>, MartynasZilinskas <https://github.com/MartynasZilinskas>.
diff --git a/node_modules/@types/react-dom/index.d.ts b/node_modules/@types/react-dom/index.d.ts index 6adb9da76..fe1e3bb4b 100644 --- a/node_modules/@types/react-dom/index.d.ts +++ b/node_modules/@types/react-dom/index.d.ts @@ -1,67 +1,70 @@ -// Type definitions for React (react-dom) 15.5 -// Project: http://facebook.github.io/react/ -// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>, MartynasZilinskas <https://github.com/MartynasZilinskas> -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -export as namespace ReactDOM; - -import { - ReactInstance, Component, ComponentState, - ReactElement, SFCElement, CElement, - DOMAttributes, DOMElement -} from 'react'; - -export function findDOMNode<E extends Element>(instance: ReactInstance): E; -export function findDOMNode(instance: ReactInstance): Element; - -export function render<P extends DOMAttributes<T>, T extends Element>( - element: DOMElement<P, T>, - container: Element | null, - callback?: (element: T) => any -): T; -export function render<P>( - element: SFCElement<P>, - container: Element | null, - callback?: () => any -): void; -export function render<P, T extends Component<P, ComponentState>>( - element: CElement<P, T>, - container: Element | null, - callback?: (component: T) => any -): T; -export function render<P>( - element: ReactElement<P>, - container: Element | null, - callback?: (component?: Component<P, ComponentState> | Element) => any -): Component<P, ComponentState> | Element | void; -export function render<P>( - parentComponent: Component<any, any>, - element: SFCElement<P>, - container: Element, - callback?: () => any -): void; - -export function unmountComponentAtNode(container: Element): boolean; - -export const version: string; - -export function unstable_batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void; -export function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void; -export function unstable_batchedUpdates(callback: () => any): void; - -export function unstable_renderSubtreeIntoContainer<P extends DOMAttributes<T>, T extends Element>( - parentComponent: Component<any, any>, - element: DOMElement<P, T>, - container: Element, - callback?: (element: T) => any): T; -export function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>( - parentComponent: Component<any, any>, - element: CElement<P, T>, - container: Element, - callback?: (component: T) => any): T; -export function unstable_renderSubtreeIntoContainer<P>( - parentComponent: Component<any, any>, - element: ReactElement<P>, - container: Element, - callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void; +// Type definitions for React (react-dom) 15.5
+// Project: http://facebook.github.io/react/
+// Definitions by: Asana <https://asana.com>
+// AssureSign <http://www.assuresign.com>
+// Microsoft <https://microsoft.com>
+// MartynasZilinskas <https://github.com/MartynasZilinskas>
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.3
+
+export as namespace ReactDOM;
+
+import {
+ ReactInstance, Component, ComponentState,
+ ReactElement, SFCElement, CElement,
+ DOMAttributes, DOMElement
+} from 'react';
+
+export function findDOMNode<E extends Element>(instance: ReactInstance): E;
+export function findDOMNode(instance: ReactInstance): Element;
+
+export function render<P extends DOMAttributes<T>, T extends Element>(
+ element: DOMElement<P, T>,
+ container: Element | null,
+ callback?: (element: T) => any
+): T;
+export function render<P>(
+ element: SFCElement<P>,
+ container: Element | null,
+ callback?: () => any
+): void;
+export function render<P, T extends Component<P, ComponentState>>(
+ element: CElement<P, T>,
+ container: Element | null,
+ callback?: (component: T) => any
+): T;
+export function render<P>(
+ element: ReactElement<P>,
+ container: Element | null,
+ callback?: (component?: Component<P, ComponentState> | Element) => any
+): Component<P, ComponentState> | Element | void;
+export function render<P>(
+ parentComponent: Component<any>,
+ element: SFCElement<P>,
+ container: Element,
+ callback?: () => any
+): void;
+
+export function unmountComponentAtNode(container: Element): boolean;
+
+export const version: string;
+
+export function unstable_batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void;
+export function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void;
+export function unstable_batchedUpdates(callback: () => any): void;
+
+export function unstable_renderSubtreeIntoContainer<P extends DOMAttributes<T>, T extends Element>(
+ parentComponent: Component<any>,
+ element: DOMElement<P, T>,
+ container: Element,
+ callback?: (element: T) => any): T;
+export function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
+ parentComponent: Component<any>,
+ element: CElement<P, T>,
+ container: Element,
+ callback?: (component: T) => any): T;
+export function unstable_renderSubtreeIntoContainer<P>(
+ parentComponent: Component<any>,
+ element: ReactElement<P>,
+ container: Element,
+ callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
diff --git a/node_modules/@types/react-dom/node-stream/index.d.ts b/node_modules/@types/react-dom/node-stream/index.d.ts new file mode 100644 index 000000000..d20644f44 --- /dev/null +++ b/node_modules/@types/react-dom/node-stream/index.d.ts @@ -0,0 +1,20 @@ +/// <reference types="node" />
+import { ReactElement } from 'react';
+import * as stream from 'stream';
+
+/**
+ * Render a ReactElement to its initial HTML. This should only be used on the
+ * server.
+ * See https://facebook.github.io/react/docs/react-dom-stream.html#rendertostream
+ */
+export function renderToStream(element: ReactElement<any>): stream.Readable;
+
+/**
+ * Similar to renderToStream, except this doesn't create extra DOM attributes
+ * such as data-react-id that React uses internally.
+ * See https://facebook.github.io/react/docs/react-dom-stream.html#rendertostaticstream
+ */
+export function renderToStaticStream(element: ReactElement<any>): stream.Readable;
+export const version: string;
+
+export as namespace ReactDOMNodeStream;
diff --git a/node_modules/@types/react-dom/package.json b/node_modules/@types/react-dom/package.json index 9aa6cc83d..f5bc341b6 100644 --- a/node_modules/@types/react-dom/package.json +++ b/node_modules/@types/react-dom/package.json @@ -1,6 +1,6 @@ { "name": "@types/react-dom", - "version": "15.5.0", + "version": "15.5.2", "description": "TypeScript definitions for React (react-dom)", "license": "MIT", "contributors": [ @@ -28,9 +28,10 @@ }, "scripts": {}, "dependencies": { - "@types/react": "*" + "@types/react": "*", + "@types/node": "*" }, "peerDependencies": {}, - "typesPublisherContentHash": "960702efe448701815f2c8563e30c357a80c23d541018709d74453db04adeb21", - "typeScriptVersion": "2.1" + "typesPublisherContentHash": "544cee2acb06e6d496a3611b44d117f8d680c5bb543987ff0ee7b2db669a389d", + "typeScriptVersion": "2.3" }
\ No newline at end of file diff --git a/node_modules/@types/react-dom/server/index.d.ts b/node_modules/@types/react-dom/server/index.d.ts index 7d45ecbee..830c941ed 100644 --- a/node_modules/@types/react-dom/server/index.d.ts +++ b/node_modules/@types/react-dom/server/index.d.ts @@ -1,24 +1,24 @@ -import { ReactElement } from 'react'; - -/** - * Render a React element to its initial HTML. This should only be used on the server. - * React will return an HTML string. You can use this method to generate HTML on the server - * and send the markup down on the initial request for faster page loads and to allow search - * engines to crawl your pages for SEO purposes. - * - * If you call `ReactDOM.render()` on a node that already has this server-rendered markup, - * React will preserve it and only attach event handlers, allowing you - * to have a very performant first-load experience. - */ -export function renderToString(element: ReactElement<any>): string; - -/** - * Similar to `renderToString`, except this doesn't create extra DOM attributes - * such as `data-reactid`, that React uses internally. This is useful if you want - * to use React as a simple static page generator, as stripping away the extra - * attributes can save lots of bytes. - */ -export function renderToStaticMarkup(element: ReactElement<any>): string; -export const version: string; - -export as namespace ReactDOMServer; +import { ReactElement } from 'react';
+
+/**
+ * Render a React element to its initial HTML. This should only be used on the server.
+ * React will return an HTML string. You can use this method to generate HTML on the server
+ * and send the markup down on the initial request for faster page loads and to allow search
+ * engines to crawl your pages for SEO purposes.
+ *
+ * If you call `ReactDOM.render()` on a node that already has this server-rendered markup,
+ * React will preserve it and only attach event handlers, allowing you
+ * to have a very performant first-load experience.
+ */
+export function renderToString(element: ReactElement<any>): string;
+
+/**
+ * Similar to `renderToString`, except this doesn't create extra DOM attributes
+ * such as `data-reactid`, that React uses internally. This is useful if you want
+ * to use React as a simple static page generator, as stripping away the extra
+ * attributes can save lots of bytes.
+ */
+export function renderToStaticMarkup(element: ReactElement<any>): string;
+export const version: string;
+
+export as namespace ReactDOMServer;
diff --git a/node_modules/@types/react-dom/test-utils/index.d.ts b/node_modules/@types/react-dom/test-utils/index.d.ts index 3153b3dba..f7afde6c1 100644 --- a/node_modules/@types/react-dom/test-utils/index.d.ts +++ b/node_modules/@types/react-dom/test-utils/index.d.ts @@ -1,242 +1,242 @@ -import { - AbstractView, Component, ComponentClass, - ReactElement, ReactInstance, ClassType, - DOMElement, SFCElement, CElement, - ReactHTMLElement, DOMAttributes, SFC -} from 'react'; - -import * as ReactTestUtils from "."; - -export interface OptionalEventProperties { - bubbles?: boolean; - cancelable?: boolean; - currentTarget?: EventTarget; - defaultPrevented?: boolean; - eventPhase?: number; - isTrusted?: boolean; - nativeEvent?: Event; - preventDefault?(): void; - stopPropagation?(): void; - target?: EventTarget; - timeStamp?: Date; - type?: string; -} - -export interface SyntheticEventData extends OptionalEventProperties { - altKey?: boolean; - button?: number; - buttons?: number; - clientX?: number; - clientY?: number; - changedTouches?: TouchList; - charCode?: boolean; - clipboardData?: DataTransfer; - ctrlKey?: boolean; - deltaMode?: number; - deltaX?: number; - deltaY?: number; - deltaZ?: number; - detail?: number; - getModifierState?(key: string): boolean; - key?: string; - keyCode?: number; - locale?: string; - location?: number; - metaKey?: boolean; - pageX?: number; - pageY?: number; - relatedTarget?: EventTarget; - repeat?: boolean; - screenX?: number; - screenY?: number; - shiftKey?: boolean; - targetTouches?: TouchList; - touches?: TouchList; - view?: AbstractView; - which?: number; -} - -export type EventSimulator = (element: Element | Component<any, any>, eventData?: SyntheticEventData) => void; - -export interface MockedComponentClass { - new (): any; -} - -export interface ShallowRenderer { - /** - * After `shallowRenderer.render()` has been called, returns shallowly rendered output. - */ - getRenderOutput<E extends ReactElement<any>>(): E; - /** - * After `shallowRenderer.render()` has been called, returns shallowly rendered output. - */ - getRenderOutput(): ReactElement<any>; - /** - * Similar to `ReactDOM.render` but it doesn't require DOM and only renders a single level deep. - */ - render(element: ReactElement<any>, context?: any): void; - unmount(): void; -} - -/** - * Simulate an event dispatch on a DOM node with optional `eventData` event data. - * `Simulate` has a method for every event that React understands. - */ -export namespace Simulate { - const blur: EventSimulator; - const change: EventSimulator; - const click: EventSimulator; - const copy: EventSimulator; - const cut: EventSimulator; - const doubleClick: EventSimulator; - const drag: EventSimulator; - const dragEnd: EventSimulator; - const dragEnter: EventSimulator; - const dragExit: EventSimulator; - const dragLeave: EventSimulator; - const dragOver: EventSimulator; - const dragStart: EventSimulator; - const drop: EventSimulator; - const focus: EventSimulator; - const input: EventSimulator; - const keyDown: EventSimulator; - const keyPress: EventSimulator; - const keyUp: EventSimulator; - const mouseDown: EventSimulator; - const mouseEnter: EventSimulator; - const mouseLeave: EventSimulator; - const mouseMove: EventSimulator; - const mouseOut: EventSimulator; - const mouseOver: EventSimulator; - const mouseUp: EventSimulator; - const paste: EventSimulator; - const scroll: EventSimulator; - const submit: EventSimulator; - const touchCancel: EventSimulator; - const touchEnd: EventSimulator; - const touchMove: EventSimulator; - const touchStart: EventSimulator; - const wheel: EventSimulator; -} - -/** - * Render a React element into a detached DOM node in the document. __This function requires a DOM__. - */ -export function renderIntoDocument<T extends Element>( - element: DOMElement<any, T>): T; -export function renderIntoDocument( - element: SFCElement<any>): void; -export function renderIntoDocument<T extends Component<any, any>>( - element: CElement<any, T>): T; -export function renderIntoDocument<P>( - element: ReactElement<P>): Component<P, {}> | Element | void; - -/** - * Pass a mocked component module to this method to augment it with useful methods that allow it to - * be used as a dummy React component. Instead of rendering as usual, the component will become - * a simple `<div>` (or other tag if `mockTagName` is provided) containing any provided children. - */ -export function mockComponent( - mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils; - -/** - * Returns `true` if `element` is any React element. - */ -export function isElement(element: any): boolean; - -/** - * Returns `true` if `element` is a React element whose type is of a React `componentClass`. - */ -export function isElementOfType<T extends HTMLElement>( - element: ReactElement<any>, type: string): element is ReactHTMLElement<T>; -/** - * Returns `true` if `element` is a React element whose type is of a React `componentClass`. - */ -export function isElementOfType<P extends DOMAttributes<{}>, T extends Element>( - element: ReactElement<any>, type: string): element is DOMElement<P, T>; -/** - * Returns `true` if `element` is a React element whose type is of a React `componentClass`. - */ -export function isElementOfType<P>( - element: ReactElement<any>, type: SFC<P>): element is SFCElement<P>; -/** - * Returns `true` if `element` is a React element whose type is of a React `componentClass`. - */ -export function isElementOfType<P, T extends Component<P, {}>, C extends ComponentClass<P>>( - element: ReactElement<any>, type: ClassType<P, T, C>): element is CElement<P, T>; - -/** - * Returns `true` if `instance` is a DOM component (such as a `<div>` or `<span>`). - */ -export function isDOMComponent(instance: ReactInstance): instance is Element; -/** - * Returns `true` if `instance` is a user-defined component, such as a class or a function. - */ -export function isCompositeComponent(instance: ReactInstance): instance is Component<any, any>; -/** - * Returns `true` if `instance` is a component whose type is of a React `componentClass`. - */ -export function isCompositeComponentWithType<T extends Component<any, any>, C extends ComponentClass<any>>( - instance: ReactInstance, type: ClassType<any, T, C>): boolean; - -/** - * Traverse all components in `tree` and accumulate all components where - * `test(component)` is `true`. This is not that useful on its own, but it's used - * as a primitive for other test utils. - */ -export function findAllInRenderedTree( - root: Component<any, any>, - fn: (i: ReactInstance) => boolean): ReactInstance[]; - -/** - * Finds all DOM elements of components in the rendered tree that are - * DOM components with the class name matching `className`. - */ -export function scryRenderedDOMComponentsWithClass( - root: Component<any, any>, - className: string): Element[]; -/** - * Like `scryRenderedDOMComponentsWithClass()` but expects there to be one result, - * and returns that one result, or throws exception if there is any other - * number of matches besides one. - */ -export function findRenderedDOMComponentWithClass( - root: Component<any, any>, - className: string): Element; - -/** - * Finds all DOM elements of components in the rendered tree that are - * DOM components with the tag name matching `tagName`. - */ -export function scryRenderedDOMComponentsWithTag( - root: Component<any, any>, - tagName: string): Element[]; -/** - * Like `scryRenderedDOMComponentsWithTag()` but expects there to be one result, - * and returns that one result, or throws exception if there is any other - * number of matches besides one. - */ -export function findRenderedDOMComponentWithTag( - root: Component<any, any>, - tagName: string): Element; - -/** - * Finds all instances of components with type equal to `componentClass`. - */ -export function scryRenderedComponentsWithType<T extends Component<{}, {}>, C extends ComponentClass<{}>>( - root: Component<any, any>, - type: ClassType<any, T, C>): T[]; - -/** - * Same as `scryRenderedComponentsWithType()` but expects there to be one result - * and returns that one result, or throws exception if there is any other - * number of matches besides one. - */ -export function findRenderedComponentWithType<T extends Component<{}, {}>, C extends ComponentClass<{}>>( - root: Component<any, any>, - type: ClassType<any, T, C>): T; - -/** - * Call this in your tests to create a shallow renderer. - */ -export function createRenderer(): ShallowRenderer; +import {
+ AbstractView, Component, ComponentClass,
+ ReactElement, ReactInstance, ClassType,
+ DOMElement, SFCElement, CElement,
+ ReactHTMLElement, DOMAttributes, SFC
+} from 'react';
+
+import * as ReactTestUtils from ".";
+
+export interface OptionalEventProperties {
+ bubbles?: boolean;
+ cancelable?: boolean;
+ currentTarget?: EventTarget;
+ defaultPrevented?: boolean;
+ eventPhase?: number;
+ isTrusted?: boolean;
+ nativeEvent?: Event;
+ preventDefault?(): void;
+ stopPropagation?(): void;
+ target?: EventTarget;
+ timeStamp?: Date;
+ type?: string;
+}
+
+export interface SyntheticEventData extends OptionalEventProperties {
+ altKey?: boolean;
+ button?: number;
+ buttons?: number;
+ clientX?: number;
+ clientY?: number;
+ changedTouches?: TouchList;
+ charCode?: boolean;
+ clipboardData?: DataTransfer;
+ ctrlKey?: boolean;
+ deltaMode?: number;
+ deltaX?: number;
+ deltaY?: number;
+ deltaZ?: number;
+ detail?: number;
+ getModifierState?(key: string): boolean;
+ key?: string;
+ keyCode?: number;
+ locale?: string;
+ location?: number;
+ metaKey?: boolean;
+ pageX?: number;
+ pageY?: number;
+ relatedTarget?: EventTarget;
+ repeat?: boolean;
+ screenX?: number;
+ screenY?: number;
+ shiftKey?: boolean;
+ targetTouches?: TouchList;
+ touches?: TouchList;
+ view?: AbstractView;
+ which?: number;
+}
+
+export type EventSimulator = (element: Element | Component<any>, eventData?: SyntheticEventData) => void;
+
+export interface MockedComponentClass {
+ new (): any;
+}
+
+export interface ShallowRenderer {
+ /**
+ * After `shallowRenderer.render()` has been called, returns shallowly rendered output.
+ */
+ getRenderOutput<E extends ReactElement<any>>(): E;
+ /**
+ * After `shallowRenderer.render()` has been called, returns shallowly rendered output.
+ */
+ getRenderOutput(): ReactElement<any>;
+ /**
+ * Similar to `ReactDOM.render` but it doesn't require DOM and only renders a single level deep.
+ */
+ render(element: ReactElement<any>, context?: any): void;
+ unmount(): void;
+}
+
+/**
+ * Simulate an event dispatch on a DOM node with optional `eventData` event data.
+ * `Simulate` has a method for every event that React understands.
+ */
+export namespace Simulate {
+ const blur: EventSimulator;
+ const change: EventSimulator;
+ const click: EventSimulator;
+ const copy: EventSimulator;
+ const cut: EventSimulator;
+ const doubleClick: EventSimulator;
+ const drag: EventSimulator;
+ const dragEnd: EventSimulator;
+ const dragEnter: EventSimulator;
+ const dragExit: EventSimulator;
+ const dragLeave: EventSimulator;
+ const dragOver: EventSimulator;
+ const dragStart: EventSimulator;
+ const drop: EventSimulator;
+ const focus: EventSimulator;
+ const input: EventSimulator;
+ const keyDown: EventSimulator;
+ const keyPress: EventSimulator;
+ const keyUp: EventSimulator;
+ const mouseDown: EventSimulator;
+ const mouseEnter: EventSimulator;
+ const mouseLeave: EventSimulator;
+ const mouseMove: EventSimulator;
+ const mouseOut: EventSimulator;
+ const mouseOver: EventSimulator;
+ const mouseUp: EventSimulator;
+ const paste: EventSimulator;
+ const scroll: EventSimulator;
+ const submit: EventSimulator;
+ const touchCancel: EventSimulator;
+ const touchEnd: EventSimulator;
+ const touchMove: EventSimulator;
+ const touchStart: EventSimulator;
+ const wheel: EventSimulator;
+}
+
+/**
+ * Render a React element into a detached DOM node in the document. __This function requires a DOM__.
+ */
+export function renderIntoDocument<T extends Element>(
+ element: DOMElement<any, T>): T;
+export function renderIntoDocument(
+ element: SFCElement<any>): void;
+export function renderIntoDocument<T extends Component<any>>(
+ element: CElement<any, T>): T;
+export function renderIntoDocument<P>(
+ element: ReactElement<P>): Component<P> | Element | void;
+
+/**
+ * Pass a mocked component module to this method to augment it with useful methods that allow it to
+ * be used as a dummy React component. Instead of rendering as usual, the component will become
+ * a simple `<div>` (or other tag if `mockTagName` is provided) containing any provided children.
+ */
+export function mockComponent(
+ mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils;
+
+/**
+ * Returns `true` if `element` is any React element.
+ */
+export function isElement(element: any): boolean;
+
+/**
+ * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
+ */
+export function isElementOfType<T extends HTMLElement>(
+ element: ReactElement<any>, type: string): element is ReactHTMLElement<T>;
+/**
+ * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
+ */
+export function isElementOfType<P extends DOMAttributes<{}>, T extends Element>(
+ element: ReactElement<any>, type: string): element is DOMElement<P, T>;
+/**
+ * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
+ */
+export function isElementOfType<P>(
+ element: ReactElement<any>, type: SFC<P>): element is SFCElement<P>;
+/**
+ * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
+ */
+export function isElementOfType<P, T extends Component<P>, C extends ComponentClass<P>>(
+ element: ReactElement<any>, type: ClassType<P, T, C>): element is CElement<P, T>;
+
+/**
+ * Returns `true` if `instance` is a DOM component (such as a `<div>` or `<span>`).
+ */
+export function isDOMComponent(instance: ReactInstance): instance is Element;
+/**
+ * Returns `true` if `instance` is a user-defined component, such as a class or a function.
+ */
+export function isCompositeComponent(instance: ReactInstance): instance is Component<any>;
+/**
+ * Returns `true` if `instance` is a component whose type is of a React `componentClass`.
+ */
+export function isCompositeComponentWithType<T extends Component<any>, C extends ComponentClass<any>>(
+ instance: ReactInstance, type: ClassType<any, T, C>): boolean;
+
+/**
+ * Traverse all components in `tree` and accumulate all components where
+ * `test(component)` is `true`. This is not that useful on its own, but it's used
+ * as a primitive for other test utils.
+ */
+export function findAllInRenderedTree(
+ root: Component<any>,
+ fn: (i: ReactInstance) => boolean): ReactInstance[];
+
+/**
+ * Finds all DOM elements of components in the rendered tree that are
+ * DOM components with the class name matching `className`.
+ */
+export function scryRenderedDOMComponentsWithClass(
+ root: Component<any>,
+ className: string): Element[];
+/**
+ * Like `scryRenderedDOMComponentsWithClass()` but expects there to be one result,
+ * and returns that one result, or throws exception if there is any other
+ * number of matches besides one.
+ */
+export function findRenderedDOMComponentWithClass(
+ root: Component<any>,
+ className: string): Element;
+
+/**
+ * Finds all DOM elements of components in the rendered tree that are
+ * DOM components with the tag name matching `tagName`.
+ */
+export function scryRenderedDOMComponentsWithTag(
+ root: Component<any>,
+ tagName: string): Element[];
+/**
+ * Like `scryRenderedDOMComponentsWithTag()` but expects there to be one result,
+ * and returns that one result, or throws exception if there is any other
+ * number of matches besides one.
+ */
+export function findRenderedDOMComponentWithTag(
+ root: Component<any>,
+ tagName: string): Element;
+
+/**
+ * Finds all instances of components with type equal to `componentClass`.
+ */
+export function scryRenderedComponentsWithType<T extends Component<{}>, C extends ComponentClass<{}>>(
+ root: Component<any>,
+ type: ClassType<any, T, C>): T[];
+
+/**
+ * Same as `scryRenderedComponentsWithType()` but expects there to be one result
+ * and returns that one result, or throws exception if there is any other
+ * number of matches besides one.
+ */
+export function findRenderedComponentWithType<T extends Component<{}>, C extends ComponentClass<{}>>(
+ root: Component<any>,
+ type: ClassType<any, T, C>): T;
+
+/**
+ * Call this in your tests to create a shallow renderer.
+ */
+export function createRenderer(): ShallowRenderer;
|