@types/react-dom 0.14.21 → 15.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
react-dom/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation. All rights reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
react-dom/README.md CHANGED
@@ -5,12 +5,12 @@
5
5
  This package contains type definitions for React (react-dom) (http://facebook.github.io/react/).
6
6
 
7
7
  # Details
8
- Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/react-dom
8
+ Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom
9
9
 
10
10
  Additional Details
11
- * Last updated: Mon, 23 Jan 2017 21:31:29 GMT
11
+ * Last updated: Fri, 23 Jun 2017 17:35:05 GMT
12
12
  * Dependencies: react
13
13
  * Global values: ReactDOM, ReactDOMServer
14
14
 
15
15
  # Credits
16
- These definitions were written by Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>.
16
+ These definitions were written by Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>, MartynasZilinskas <https://github.com/MartynasZilinskas>.
react-dom/index.d.ts CHANGED
@@ -1,63 +1,70 @@
1
- // Type definitions for React (react-dom) 0.14
2
- // Project: http://facebook.github.io/react/
3
- // Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
4
- // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
- // TypeScript Version: 2.1
6
-
7
- export as namespace ReactDOM;
8
- export = ReactDOM;
9
-
10
- import { ReactInstance, Component, ComponentState,
11
- ReactElement, SFCElement, CElement,
12
- DOMAttributes, DOMElement } from 'react';
13
-
14
- declare namespace ReactDOM {
15
- function findDOMNode<E extends Element>(instance: ReactInstance): E;
16
- function findDOMNode(instance: ReactInstance): Element;
17
-
18
- function render<P extends DOMAttributes<T>, T extends Element>(
19
- element: DOMElement<P, T>,
20
- container: Element | null,
21
- callback?: (element: T) => any): T;
22
- function render<P>(
23
- element: SFCElement<P>,
24
- container: Element | null,
25
- callback?: () => any): void;
26
- function render<P, T extends Component<P, ComponentState>>(
27
- element: CElement<P, T>,
28
- container: Element | null,
29
- callback?: (component: T) => any): T;
30
- function render<P>(
31
- element: ReactElement<P>,
32
- container: Element | null,
33
- callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
34
-
35
- function unmountComponentAtNode(container: Element): boolean;
36
-
37
- var version: string;
38
-
39
- function unstable_batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void;
40
- function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void;
41
- function unstable_batchedUpdates(callback: () => any): void;
42
-
43
- function unstable_renderSubtreeIntoContainer<P extends DOMAttributes<T>, T extends Element>(
44
- parentComponent: Component<any, any>,
45
- element: DOMElement<P, T>,
46
- container: Element,
47
- callback?: (element: T) => any): T;
48
- function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
49
- parentComponent: Component<any, any>,
50
- element: CElement<P, T>,
51
- container: Element,
52
- callback?: (component: T) => any): T;
53
- function render<P>(
54
- parentComponent: Component<any, any>,
55
- element: SFCElement<P>,
56
- container: Element,
57
- callback?: () => any): void;
58
- function unstable_renderSubtreeIntoContainer<P>(
59
- parentComponent: Component<any, any>,
60
- element: ReactElement<P>,
61
- container: Element,
62
- callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
63
- }
1
+ // Type definitions for React (react-dom) 15.5
2
+ // Project: http://facebook.github.io/react/
3
+ // Definitions by: Asana <https://asana.com>
4
+ // AssureSign <http://www.assuresign.com>
5
+ // Microsoft <https://microsoft.com>
6
+ // MartynasZilinskas <https://github.com/MartynasZilinskas>
7
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
8
+ // TypeScript Version: 2.3
9
+
10
+ export as namespace ReactDOM;
11
+
12
+ import {
13
+ ReactInstance, Component, ComponentState,
14
+ ReactElement, SFCElement, CElement,
15
+ DOMAttributes, DOMElement
16
+ } from 'react';
17
+
18
+ export function findDOMNode<E extends Element>(instance: ReactInstance): E;
19
+ export function findDOMNode(instance: ReactInstance): Element;
20
+
21
+ export function render<P extends DOMAttributes<T>, T extends Element>(
22
+ element: DOMElement<P, T>,
23
+ container: Element | null,
24
+ callback?: (element: T) => any
25
+ ): T;
26
+ export function render<P>(
27
+ element: SFCElement<P>,
28
+ container: Element | null,
29
+ callback?: () => any
30
+ ): void;
31
+ export function render<P, T extends Component<P, ComponentState>>(
32
+ element: CElement<P, T>,
33
+ container: Element | null,
34
+ callback?: (component: T) => any
35
+ ): T;
36
+ export function render<P>(
37
+ element: ReactElement<P>,
38
+ container: Element | null,
39
+ callback?: (component?: Component<P, ComponentState> | Element) => any
40
+ ): Component<P, ComponentState> | Element | void;
41
+ export function render<P>(
42
+ parentComponent: Component<any>,
43
+ element: SFCElement<P>,
44
+ container: Element,
45
+ callback?: () => any
46
+ ): void;
47
+
48
+ export function unmountComponentAtNode(container: Element): boolean;
49
+
50
+ export const version: string;
51
+
52
+ export function unstable_batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void;
53
+ export function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void;
54
+ export function unstable_batchedUpdates(callback: () => any): void;
55
+
56
+ export function unstable_renderSubtreeIntoContainer<P extends DOMAttributes<T>, T extends Element>(
57
+ parentComponent: Component<any>,
58
+ element: DOMElement<P, T>,
59
+ container: Element,
60
+ callback?: (element: T) => any): T;
61
+ export function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
62
+ parentComponent: Component<any>,
63
+ element: CElement<P, T>,
64
+ container: Element,
65
+ callback?: (component: T) => any): T;
66
+ export function unstable_renderSubtreeIntoContainer<P>(
67
+ parentComponent: Component<any>,
68
+ element: ReactElement<P>,
69
+ container: Element,
70
+ callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
react-dom/package.json CHANGED
@@ -1,9 +1,26 @@
1
1
  {
2
2
  "name": "@types/react-dom",
3
- "version": "0.14.21",
3
+ "version": "15.5.1",
4
4
  "description": "TypeScript definitions for React (react-dom)",
5
5
  "license": "MIT",
6
- "author": "Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>",
6
+ "contributors": [
7
+ {
8
+ "name": "Asana",
9
+ "url": "https://asana.com"
10
+ },
11
+ {
12
+ "name": "AssureSign",
13
+ "url": "http://www.assuresign.com"
14
+ },
15
+ {
16
+ "name": "Microsoft",
17
+ "url": "https://microsoft.com"
18
+ },
19
+ {
20
+ "name": "MartynasZilinskas",
21
+ "url": "https://github.com/MartynasZilinskas"
22
+ }
23
+ ],
7
24
  "main": "",
8
25
  "repository": {
9
26
  "type": "git",
@@ -14,6 +31,6 @@
14
31
  "@types/react": "*"
15
32
  },
16
33
  "peerDependencies": {},
17
- "typesPublisherContentHash": "0a3e9ebed61848be2f94bbeddfa2ac318587ee312f7c217d7c41276c94b40362",
18
- "typeScriptVersion": "2.1"
34
+ "typesPublisherContentHash": "e26d52bf300d57089374961d828af107c2d813bf94abc975b68ed8720daca408",
35
+ "typeScriptVersion": "2.3"
19
36
  }
@@ -0,0 +1,24 @@
1
+ import { ReactElement } from 'react';
2
+
3
+ /**
4
+ * Render a React element to its initial HTML. This should only be used on the server.
5
+ * React will return an HTML string. You can use this method to generate HTML on the server
6
+ * and send the markup down on the initial request for faster page loads and to allow search
7
+ * engines to crawl your pages for SEO purposes.
8
+ *
9
+ * If you call `ReactDOM.render()` on a node that already has this server-rendered markup,
10
+ * React will preserve it and only attach event handlers, allowing you
11
+ * to have a very performant first-load experience.
12
+ */
13
+ export function renderToString(element: ReactElement<any>): string;
14
+
15
+ /**
16
+ * Similar to `renderToString`, except this doesn't create extra DOM attributes
17
+ * such as `data-reactid`, that React uses internally. This is useful if you want
18
+ * to use React as a simple static page generator, as stripping away the extra
19
+ * attributes can save lots of bytes.
20
+ */
21
+ export function renderToStaticMarkup(element: ReactElement<any>): string;
22
+ export const version: string;
23
+
24
+ export as namespace ReactDOMServer;
@@ -0,0 +1,242 @@
1
+ import {
2
+ AbstractView, Component, ComponentClass,
3
+ ReactElement, ReactInstance, ClassType,
4
+ DOMElement, SFCElement, CElement,
5
+ ReactHTMLElement, DOMAttributes, SFC
6
+ } from 'react';
7
+
8
+ import * as ReactTestUtils from ".";
9
+
10
+ export interface OptionalEventProperties {
11
+ bubbles?: boolean;
12
+ cancelable?: boolean;
13
+ currentTarget?: EventTarget;
14
+ defaultPrevented?: boolean;
15
+ eventPhase?: number;
16
+ isTrusted?: boolean;
17
+ nativeEvent?: Event;
18
+ preventDefault?(): void;
19
+ stopPropagation?(): void;
20
+ target?: EventTarget;
21
+ timeStamp?: Date;
22
+ type?: string;
23
+ }
24
+
25
+ export interface SyntheticEventData extends OptionalEventProperties {
26
+ altKey?: boolean;
27
+ button?: number;
28
+ buttons?: number;
29
+ clientX?: number;
30
+ clientY?: number;
31
+ changedTouches?: TouchList;
32
+ charCode?: boolean;
33
+ clipboardData?: DataTransfer;
34
+ ctrlKey?: boolean;
35
+ deltaMode?: number;
36
+ deltaX?: number;
37
+ deltaY?: number;
38
+ deltaZ?: number;
39
+ detail?: number;
40
+ getModifierState?(key: string): boolean;
41
+ key?: string;
42
+ keyCode?: number;
43
+ locale?: string;
44
+ location?: number;
45
+ metaKey?: boolean;
46
+ pageX?: number;
47
+ pageY?: number;
48
+ relatedTarget?: EventTarget;
49
+ repeat?: boolean;
50
+ screenX?: number;
51
+ screenY?: number;
52
+ shiftKey?: boolean;
53
+ targetTouches?: TouchList;
54
+ touches?: TouchList;
55
+ view?: AbstractView;
56
+ which?: number;
57
+ }
58
+
59
+ export type EventSimulator = (element: Element | Component<any>, eventData?: SyntheticEventData) => void;
60
+
61
+ export interface MockedComponentClass {
62
+ new (): any;
63
+ }
64
+
65
+ export interface ShallowRenderer {
66
+ /**
67
+ * After `shallowRenderer.render()` has been called, returns shallowly rendered output.
68
+ */
69
+ getRenderOutput<E extends ReactElement<any>>(): E;
70
+ /**
71
+ * After `shallowRenderer.render()` has been called, returns shallowly rendered output.
72
+ */
73
+ getRenderOutput(): ReactElement<any>;
74
+ /**
75
+ * Similar to `ReactDOM.render` but it doesn't require DOM and only renders a single level deep.
76
+ */
77
+ render(element: ReactElement<any>, context?: any): void;
78
+ unmount(): void;
79
+ }
80
+
81
+ /**
82
+ * Simulate an event dispatch on a DOM node with optional `eventData` event data.
83
+ * `Simulate` has a method for every event that React understands.
84
+ */
85
+ export namespace Simulate {
86
+ const blur: EventSimulator;
87
+ const change: EventSimulator;
88
+ const click: EventSimulator;
89
+ const copy: EventSimulator;
90
+ const cut: EventSimulator;
91
+ const doubleClick: EventSimulator;
92
+ const drag: EventSimulator;
93
+ const dragEnd: EventSimulator;
94
+ const dragEnter: EventSimulator;
95
+ const dragExit: EventSimulator;
96
+ const dragLeave: EventSimulator;
97
+ const dragOver: EventSimulator;
98
+ const dragStart: EventSimulator;
99
+ const drop: EventSimulator;
100
+ const focus: EventSimulator;
101
+ const input: EventSimulator;
102
+ const keyDown: EventSimulator;
103
+ const keyPress: EventSimulator;
104
+ const keyUp: EventSimulator;
105
+ const mouseDown: EventSimulator;
106
+ const mouseEnter: EventSimulator;
107
+ const mouseLeave: EventSimulator;
108
+ const mouseMove: EventSimulator;
109
+ const mouseOut: EventSimulator;
110
+ const mouseOver: EventSimulator;
111
+ const mouseUp: EventSimulator;
112
+ const paste: EventSimulator;
113
+ const scroll: EventSimulator;
114
+ const submit: EventSimulator;
115
+ const touchCancel: EventSimulator;
116
+ const touchEnd: EventSimulator;
117
+ const touchMove: EventSimulator;
118
+ const touchStart: EventSimulator;
119
+ const wheel: EventSimulator;
120
+ }
121
+
122
+ /**
123
+ * Render a React element into a detached DOM node in the document. __This function requires a DOM__.
124
+ */
125
+ export function renderIntoDocument<T extends Element>(
126
+ element: DOMElement<any, T>): T;
127
+ export function renderIntoDocument(
128
+ element: SFCElement<any>): void;
129
+ export function renderIntoDocument<T extends Component<any>>(
130
+ element: CElement<any, T>): T;
131
+ export function renderIntoDocument<P>(
132
+ element: ReactElement<P>): Component<P> | Element | void;
133
+
134
+ /**
135
+ * Pass a mocked component module to this method to augment it with useful methods that allow it to
136
+ * be used as a dummy React component. Instead of rendering as usual, the component will become
137
+ * a simple `<div>` (or other tag if `mockTagName` is provided) containing any provided children.
138
+ */
139
+ export function mockComponent(
140
+ mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils;
141
+
142
+ /**
143
+ * Returns `true` if `element` is any React element.
144
+ */
145
+ export function isElement(element: any): boolean;
146
+
147
+ /**
148
+ * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
149
+ */
150
+ export function isElementOfType<T extends HTMLElement>(
151
+ element: ReactElement<any>, type: string): element is ReactHTMLElement<T>;
152
+ /**
153
+ * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
154
+ */
155
+ export function isElementOfType<P extends DOMAttributes<{}>, T extends Element>(
156
+ element: ReactElement<any>, type: string): element is DOMElement<P, T>;
157
+ /**
158
+ * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
159
+ */
160
+ export function isElementOfType<P>(
161
+ element: ReactElement<any>, type: SFC<P>): element is SFCElement<P>;
162
+ /**
163
+ * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
164
+ */
165
+ export function isElementOfType<P, T extends Component<P>, C extends ComponentClass<P>>(
166
+ element: ReactElement<any>, type: ClassType<P, T, C>): element is CElement<P, T>;
167
+
168
+ /**
169
+ * Returns `true` if `instance` is a DOM component (such as a `<div>` or `<span>`).
170
+ */
171
+ export function isDOMComponent(instance: ReactInstance): instance is Element;
172
+ /**
173
+ * Returns `true` if `instance` is a user-defined component, such as a class or a function.
174
+ */
175
+ export function isCompositeComponent(instance: ReactInstance): instance is Component<any>;
176
+ /**
177
+ * Returns `true` if `instance` is a component whose type is of a React `componentClass`.
178
+ */
179
+ export function isCompositeComponentWithType<T extends Component<any>, C extends ComponentClass<any>>(
180
+ instance: ReactInstance, type: ClassType<any, T, C>): boolean;
181
+
182
+ /**
183
+ * Traverse all components in `tree` and accumulate all components where
184
+ * `test(component)` is `true`. This is not that useful on its own, but it's used
185
+ * as a primitive for other test utils.
186
+ */
187
+ export function findAllInRenderedTree(
188
+ root: Component<any>,
189
+ fn: (i: ReactInstance) => boolean): ReactInstance[];
190
+
191
+ /**
192
+ * Finds all DOM elements of components in the rendered tree that are
193
+ * DOM components with the class name matching `className`.
194
+ */
195
+ export function scryRenderedDOMComponentsWithClass(
196
+ root: Component<any>,
197
+ className: string): Element[];
198
+ /**
199
+ * Like `scryRenderedDOMComponentsWithClass()` but expects there to be one result,
200
+ * and returns that one result, or throws exception if there is any other
201
+ * number of matches besides one.
202
+ */
203
+ export function findRenderedDOMComponentWithClass(
204
+ root: Component<any>,
205
+ className: string): Element;
206
+
207
+ /**
208
+ * Finds all DOM elements of components in the rendered tree that are
209
+ * DOM components with the tag name matching `tagName`.
210
+ */
211
+ export function scryRenderedDOMComponentsWithTag(
212
+ root: Component<any>,
213
+ tagName: string): Element[];
214
+ /**
215
+ * Like `scryRenderedDOMComponentsWithTag()` but expects there to be one result,
216
+ * and returns that one result, or throws exception if there is any other
217
+ * number of matches besides one.
218
+ */
219
+ export function findRenderedDOMComponentWithTag(
220
+ root: Component<any>,
221
+ tagName: string): Element;
222
+
223
+ /**
224
+ * Finds all instances of components with type equal to `componentClass`.
225
+ */
226
+ export function scryRenderedComponentsWithType<T extends Component<{}>, C extends ComponentClass<{}>>(
227
+ root: Component<any>,
228
+ type: ClassType<any, T, C>): T[];
229
+
230
+ /**
231
+ * Same as `scryRenderedComponentsWithType()` but expects there to be one result
232
+ * and returns that one result, or throws exception if there is any other
233
+ * number of matches besides one.
234
+ */
235
+ export function findRenderedComponentWithType<T extends Component<{}>, C extends ComponentClass<{}>>(
236
+ root: Component<any>,
237
+ type: ClassType<any, T, C>): T;
238
+
239
+ /**
240
+ * Call this in your tests to create a shallow renderer.
241
+ */
242
+ export function createRenderer(): ShallowRenderer;
react-dom/server.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { ReactElement } from 'react';
2
-
3
- export function renderToString(element: ReactElement<any>): string;
4
- export function renderToStaticMarkup(element: ReactElement<any>): string;
5
- export var version: string;
6
-
7
- export as namespace ReactDOMServer;
@@ -1,34 +0,0 @@
1
- {
2
- "name": "react-dom",
3
- "libraryName": "React (react-dom)",
4
- "sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped",
5
- "data": {
6
- "authors": "Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>",
7
- "dependencies": {
8
- "react": "*"
9
- },
10
- "pathMappings": {},
11
- "libraryMajorVersion": 0,
12
- "libraryMinorVersion": 14,
13
- "typeScriptVersion": "2.1",
14
- "libraryName": "React (react-dom)",
15
- "typingsPackageName": "react-dom",
16
- "projectName": "http://facebook.github.io/react/",
17
- "sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped",
18
- "globals": [
19
- "ReactDOM",
20
- "ReactDOMServer"
21
- ],
22
- "declaredModules": [
23
- "react-dom/.",
24
- "react-dom/server"
25
- ],
26
- "files": [
27
- "index.d.ts",
28
- "server.d.ts"
29
- ],
30
- "hasPackageJson": false,
31
- "contentHash": "0a3e9ebed61848be2f94bbeddfa2ac318587ee312f7c217d7c41276c94b40362"
32
- },
33
- "isLatest": true
34
- }