@types/react-dom 15.5.13 → 16.0.3
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 v15.5/LICENSE → react-dom/LICENSE +21 -21
- react-dom/README.md +16 -0
- react-dom/index.d.ts +100 -0
- react-dom v15.5/node-stream/index.d.ts → react-dom/node-stream/index.d.ts +18 -18
- react-dom v15.5/package.json → react-dom/package.json +11 -8
- react-dom v15.5/server/index.d.ts → react-dom/server/index.d.ts +41 -24
- react-dom v15.5/test-utils/index.d.ts → react-dom/test-utils/index.d.ts +276 -276
- react-dom v15.5/README.md +0 -16
- react-dom v15.5/index.d.ts +0 -70
@@ -1,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) Microsoft Corporation.
|
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
|
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
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# Installation
|
2
|
+
> `npm install --save @types/react-dom`
|
3
|
+
|
4
|
+
# Summary
|
5
|
+
This package contains type definitions for React (react-dom) (http://facebook.github.io/react/).
|
6
|
+
|
7
|
+
# Details
|
8
|
+
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom
|
9
|
+
|
10
|
+
Additional Details
|
11
|
+
* Last updated: Thu, 09 Nov 2017 09:57:15 GMT
|
12
|
+
* Dependencies: react, node
|
13
|
+
* Global values: ReactDOM, ReactDOMNodeStream, ReactDOMServer
|
14
|
+
|
15
|
+
# Credits
|
16
|
+
These definitions were written by Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>, MartynasZilinskas <https://github.com/MartynasZilinskas>, Josh Rutherford <https://github.com/theruther4d>.
|
react-dom/index.d.ts
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
// Type definitions for React (react-dom) 16.0
|
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
|
+
// Josh Rutherford <https://github.com/theruther4d>
|
8
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
9
|
+
// TypeScript Version: 2.3
|
10
|
+
|
11
|
+
export as namespace ReactDOM;
|
12
|
+
|
13
|
+
import {
|
14
|
+
ReactInstance, Component, ComponentState,
|
15
|
+
ReactElement, SFCElement, CElement,
|
16
|
+
DOMAttributes, DOMElement, ReactNode, ReactPortal
|
17
|
+
} from 'react';
|
18
|
+
|
19
|
+
export function findDOMNode(instance: ReactInstance): Element;
|
20
|
+
export function unmountComponentAtNode(container: Element): boolean;
|
21
|
+
|
22
|
+
export function createPortal(children: ReactNode, container: Element): ReactPortal;
|
23
|
+
|
24
|
+
export const version: string;
|
25
|
+
export const render: Renderer;
|
26
|
+
export const hydrate: Renderer;
|
27
|
+
|
28
|
+
export function unstable_batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void;
|
29
|
+
export function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void;
|
30
|
+
export function unstable_batchedUpdates(callback: () => any): void;
|
31
|
+
|
32
|
+
export function unstable_renderSubtreeIntoContainer<T extends Element>(
|
33
|
+
parentComponent: Component<any>,
|
34
|
+
element: DOMElement<DOMAttributes<T>, T>,
|
35
|
+
container: Element,
|
36
|
+
callback?: (element: T) => any): T;
|
37
|
+
export function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
|
38
|
+
parentComponent: Component<any>,
|
39
|
+
element: CElement<P, T>,
|
40
|
+
container: Element,
|
41
|
+
callback?: (component: T) => any): T;
|
42
|
+
export function unstable_renderSubtreeIntoContainer<P>(
|
43
|
+
parentComponent: Component<any>,
|
44
|
+
element: ReactElement<P>,
|
45
|
+
container: Element,
|
46
|
+
callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
|
47
|
+
|
48
|
+
export interface Renderer {
|
49
|
+
// Deprecated(render): The return value is deprecated.
|
50
|
+
// In future releases the render function's return type will be void.
|
51
|
+
|
52
|
+
<T extends Element>(
|
53
|
+
element: DOMElement<DOMAttributes<T>, T>,
|
54
|
+
container: Element | null,
|
55
|
+
callback?: () => void
|
56
|
+
): T;
|
57
|
+
|
58
|
+
(
|
59
|
+
element: Array<DOMElement<DOMAttributes<any>, any>>,
|
60
|
+
container: Element | null,
|
61
|
+
callback?: () => void
|
62
|
+
): Element;
|
63
|
+
|
64
|
+
(
|
65
|
+
element: SFCElement<any> | Array<SFCElement<any>>,
|
66
|
+
container: Element | null,
|
67
|
+
callback?: () => void
|
68
|
+
): void;
|
69
|
+
|
70
|
+
<P, T extends Component<P, ComponentState>>(
|
71
|
+
element: CElement<P, T>,
|
72
|
+
container: Element | null,
|
73
|
+
callback?: () => void
|
74
|
+
): T;
|
75
|
+
|
76
|
+
(
|
77
|
+
element: Array<CElement<any, Component<any, ComponentState>>>,
|
78
|
+
container: Element | null,
|
79
|
+
callback?: () => void
|
80
|
+
): Component<any, ComponentState>;
|
81
|
+
|
82
|
+
<P>(
|
83
|
+
element: ReactElement<P>,
|
84
|
+
container: Element | null,
|
85
|
+
callback?: () => void
|
86
|
+
): Component<P, ComponentState> | Element | void;
|
87
|
+
|
88
|
+
(
|
89
|
+
element: Array<ReactElement<any>>,
|
90
|
+
container: Element | null,
|
91
|
+
callback?: () => void
|
92
|
+
): Component<any, ComponentState> | Element | void;
|
93
|
+
|
94
|
+
(
|
95
|
+
parentComponent: Component<any> | Array<Component<any>>,
|
96
|
+
element: SFCElement<any>,
|
97
|
+
container: Element,
|
98
|
+
callback?: () => void
|
99
|
+
): void;
|
100
|
+
}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import { ReactElement } from 'react';
|
2
|
-
|
3
|
-
/**
|
4
|
-
* Render a ReactElement to its initial HTML. This should only be used on the
|
5
|
-
* server.
|
6
|
-
* See https://facebook.github.io/react/docs/react-dom-stream.html#rendertostream
|
7
|
-
*/
|
8
|
-
export function renderToStream(element: ReactElement): any;
|
9
|
-
|
10
|
-
/**
|
11
|
-
* Similar to renderToStream, except this doesn't create extra DOM attributes
|
12
|
-
* such as data-react-id that React uses internally.
|
13
|
-
* See https://facebook.github.io/react/docs/react-dom-stream.html#rendertostaticstream
|
14
|
-
*/
|
15
|
-
export function renderToStaticStream(element: ReactElement): any;
|
16
|
-
export const version: string;
|
17
|
-
|
18
|
-
export as namespace ReactDOMNodeStream;
|
1
|
+
import { ReactElement } from 'react';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Render a ReactElement to its initial HTML. This should only be used on the
|
5
|
+
* server.
|
6
|
+
* See https://facebook.github.io/react/docs/react-dom-stream.html#rendertostream
|
7
|
+
*/
|
8
|
+
export function renderToStream(element: ReactElement<any>): any;
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Similar to renderToStream, except this doesn't create extra DOM attributes
|
12
|
+
* such as data-react-id that React uses internally.
|
13
|
+
* See https://facebook.github.io/react/docs/react-dom-stream.html#rendertostaticstream
|
14
|
+
*/
|
15
|
+
export function renderToStaticStream(element: ReactElement<any>): any;
|
16
|
+
export const version: string;
|
17
|
+
|
18
|
+
export as namespace ReactDOMNodeStream;
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react-dom",
|
3
|
-
"version": "
|
3
|
+
"version": "16.0.3",
|
4
4
|
"description": "TypeScript definitions for React (react-dom)",
|
5
|
-
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom",
|
6
5
|
"license": "MIT",
|
7
6
|
"contributors": [
|
8
7
|
{
|
@@ -21,19 +20,23 @@
|
|
21
20
|
"name": "MartynasZilinskas",
|
22
21
|
"url": "https://github.com/MartynasZilinskas",
|
23
22
|
"githubUsername": "MartynasZilinskas"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"name": "Josh Rutherford",
|
26
|
+
"url": "https://github.com/theruther4d",
|
27
|
+
"githubUsername": "theruther4d"
|
24
28
|
}
|
25
29
|
],
|
26
30
|
"main": "",
|
27
|
-
"types": "index.d.ts",
|
28
31
|
"repository": {
|
29
32
|
"type": "git",
|
30
|
-
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
31
|
-
"directory": "types/react-dom"
|
33
|
+
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
|
32
34
|
},
|
33
35
|
"scripts": {},
|
34
36
|
"dependencies": {
|
35
|
-
"@types/react": "
|
37
|
+
"@types/react": "*",
|
38
|
+
"@types/node": "*"
|
36
39
|
},
|
37
|
-
"typesPublisherContentHash": "
|
38
|
-
"typeScriptVersion": "3
|
40
|
+
"typesPublisherContentHash": "a1ecd70c2ef3dbfad1349e2130eeab861b8b53a24ba36a0721a3bd23b9504aeb",
|
41
|
+
"typeScriptVersion": "2.3"
|
39
42
|
}
|
@@ -1,24 +1,41 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
*
|
19
|
-
*
|
20
|
-
|
21
|
-
|
22
|
-
export
|
23
|
-
|
24
|
-
|
1
|
+
/// <reference types="node" />
|
2
|
+
|
3
|
+
import { ReactElement } from 'react';
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Render a React element to its initial HTML. This should only be used on the server.
|
7
|
+
* React will return an HTML string. You can use this method to generate HTML on the server
|
8
|
+
* and send the markup down on the initial request for faster page loads and to allow search
|
9
|
+
* engines to crawl your pages for SEO purposes.
|
10
|
+
*
|
11
|
+
* If you call `ReactDOM.render()` on a node that already has this server-rendered markup,
|
12
|
+
* React will preserve it and only attach event handlers, allowing you
|
13
|
+
* to have a very performant first-load experience.
|
14
|
+
*/
|
15
|
+
export function renderToString(element: ReactElement<any>): string;
|
16
|
+
|
17
|
+
/**
|
18
|
+
* Render a React element to its initial HTML. Returns a Readable stream that outputs
|
19
|
+
* an HTML string. The HTML output by this stream is exactly equal to what
|
20
|
+
* `ReactDOMServer.renderToString()` would return.
|
21
|
+
*/
|
22
|
+
export function renderToNodeStream(element: ReactElement<any>): NodeJS.ReadableStream;
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Similar to `renderToString`, except this doesn't create extra DOM attributes
|
26
|
+
* such as `data-reactid`, that React uses internally. This is useful if you want
|
27
|
+
* to use React as a simple static page generator, as stripping away the extra
|
28
|
+
* attributes can save lots of bytes.
|
29
|
+
*/
|
30
|
+
export function renderToStaticMarkup(element: ReactElement<any>): string;
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Similar to `renderToNodeStream`, except this doesn't create extra DOM attributes
|
34
|
+
* such as `data-reactid`, that React uses internally. The HTML output by this stream
|
35
|
+
* is exactly equal to what `ReactDOMServer.renderToStaticMarkup()` would return.
|
36
|
+
*/
|
37
|
+
export function renderToStaticNodeStream(element: ReactElement<any>): NodeJS.ReadableStream;
|
38
|
+
|
39
|
+
export const version: string;
|
40
|
+
|
41
|
+
export as namespace ReactDOMServer;
|
@@ -1,276 +1,276 @@
|
|
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?:
|
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
|
70
|
-
/**
|
71
|
-
*
|
72
|
-
*/
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
const
|
87
|
-
const
|
88
|
-
const
|
89
|
-
const
|
90
|
-
const
|
91
|
-
const
|
92
|
-
const
|
93
|
-
const
|
94
|
-
const
|
95
|
-
const
|
96
|
-
const
|
97
|
-
const
|
98
|
-
const
|
99
|
-
const
|
100
|
-
const
|
101
|
-
const
|
102
|
-
const
|
103
|
-
const
|
104
|
-
const
|
105
|
-
const
|
106
|
-
const
|
107
|
-
const
|
108
|
-
const
|
109
|
-
const
|
110
|
-
const
|
111
|
-
const
|
112
|
-
const
|
113
|
-
const
|
114
|
-
const
|
115
|
-
const
|
116
|
-
const
|
117
|
-
const
|
118
|
-
const
|
119
|
-
const
|
120
|
-
const
|
121
|
-
const
|
122
|
-
const
|
123
|
-
const
|
124
|
-
const
|
125
|
-
const
|
126
|
-
const
|
127
|
-
const
|
128
|
-
const
|
129
|
-
const
|
130
|
-
const
|
131
|
-
const
|
132
|
-
const
|
133
|
-
const
|
134
|
-
const
|
135
|
-
const
|
136
|
-
const
|
137
|
-
const
|
138
|
-
const
|
139
|
-
const
|
140
|
-
const
|
141
|
-
const
|
142
|
-
const
|
143
|
-
const
|
144
|
-
const
|
145
|
-
const
|
146
|
-
const
|
147
|
-
const
|
148
|
-
const
|
149
|
-
const
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
export function renderIntoDocument<
|
164
|
-
element: CElement<
|
165
|
-
export function renderIntoDocument<P>(
|
166
|
-
element: ReactElement<P>): Component<P> | Element | void;
|
167
|
-
|
168
|
-
/**
|
169
|
-
* Pass a mocked component module to this method to augment it with useful methods that allow it to
|
170
|
-
* be used as a dummy React component. Instead of rendering as usual, the component will become
|
171
|
-
* a simple `<div>` (or other tag if `mockTagName` is provided) containing any provided children.
|
172
|
-
*/
|
173
|
-
export function mockComponent(
|
174
|
-
mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils;
|
175
|
-
|
176
|
-
/**
|
177
|
-
* Returns `true` if `element` is any React element.
|
178
|
-
*/
|
179
|
-
export function isElement(element: any): boolean;
|
180
|
-
|
181
|
-
/**
|
182
|
-
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
183
|
-
*/
|
184
|
-
export function isElementOfType<T extends HTMLElement>(
|
185
|
-
element: ReactElement
|
186
|
-
/**
|
187
|
-
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
188
|
-
*/
|
189
|
-
export function isElementOfType<P extends DOMAttributes<{}>, T extends Element>(
|
190
|
-
element: ReactElement
|
191
|
-
/**
|
192
|
-
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
193
|
-
*/
|
194
|
-
export function isElementOfType<P>(
|
195
|
-
element: ReactElement
|
196
|
-
/**
|
197
|
-
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
198
|
-
*/
|
199
|
-
export function isElementOfType<P, T extends Component<P>, C extends ComponentClass<P>>(
|
200
|
-
element: ReactElement
|
201
|
-
|
202
|
-
/**
|
203
|
-
* Returns `true` if `instance` is a DOM component (such as a `<div>` or `<span>`).
|
204
|
-
*/
|
205
|
-
export function isDOMComponent(instance: ReactInstance): instance is Element;
|
206
|
-
/**
|
207
|
-
* Returns `true` if `instance` is a user-defined component, such as a class or a function.
|
208
|
-
*/
|
209
|
-
export function isCompositeComponent(instance: ReactInstance): instance is Component<any>;
|
210
|
-
/**
|
211
|
-
* Returns `true` if `instance` is a component whose type is of a React `componentClass`.
|
212
|
-
*/
|
213
|
-
export function isCompositeComponentWithType<T extends Component<any>, C extends ComponentClass<any>>(
|
214
|
-
instance: ReactInstance, type: ClassType<any, T, C>): boolean;
|
215
|
-
|
216
|
-
/**
|
217
|
-
* Traverse all components in `tree` and accumulate all components where
|
218
|
-
* `test(component)` is `true`. This is not that useful on its own, but it's used
|
219
|
-
* as a primitive for other test utils.
|
220
|
-
*/
|
221
|
-
export function findAllInRenderedTree(
|
222
|
-
root: Component<any>,
|
223
|
-
fn: (i: ReactInstance) => boolean): ReactInstance[];
|
224
|
-
|
225
|
-
/**
|
226
|
-
* Finds all DOM elements of components in the rendered tree that are
|
227
|
-
* DOM components with the class name matching `className`.
|
228
|
-
*/
|
229
|
-
export function scryRenderedDOMComponentsWithClass(
|
230
|
-
root: Component<any>,
|
231
|
-
className: string): Element[];
|
232
|
-
/**
|
233
|
-
* Like `scryRenderedDOMComponentsWithClass()` but expects there to be one result,
|
234
|
-
* and returns that one result, or throws exception if there is any other
|
235
|
-
* number of matches besides one.
|
236
|
-
*/
|
237
|
-
export function findRenderedDOMComponentWithClass(
|
238
|
-
root: Component<any>,
|
239
|
-
className: string): Element;
|
240
|
-
|
241
|
-
/**
|
242
|
-
* Finds all DOM elements of components in the rendered tree that are
|
243
|
-
* DOM components with the tag name matching `tagName`.
|
244
|
-
*/
|
245
|
-
export function scryRenderedDOMComponentsWithTag(
|
246
|
-
root: Component<any>,
|
247
|
-
tagName: string): Element[];
|
248
|
-
/**
|
249
|
-
* Like `scryRenderedDOMComponentsWithTag()` but expects there to be one result,
|
250
|
-
* and returns that one result, or throws exception if there is any other
|
251
|
-
* number of matches besides one.
|
252
|
-
*/
|
253
|
-
export function findRenderedDOMComponentWithTag(
|
254
|
-
root: Component<any>,
|
255
|
-
tagName: string): Element;
|
256
|
-
|
257
|
-
/**
|
258
|
-
* Finds all instances of components with type equal to `componentClass`.
|
259
|
-
*/
|
260
|
-
export function scryRenderedComponentsWithType<T extends Component, C extends ComponentClass>(
|
261
|
-
root: Component<any>,
|
262
|
-
type: ClassType<any, T, C>): T[];
|
263
|
-
|
264
|
-
/**
|
265
|
-
* Same as `scryRenderedComponentsWithType()` but expects there to be one result
|
266
|
-
* and returns that one result, or throws exception if there is any other
|
267
|
-
* number of matches besides one.
|
268
|
-
*/
|
269
|
-
export function findRenderedComponentWithType<T extends Component, C extends ComponentClass>(
|
270
|
-
root: Component<any>,
|
271
|
-
type: ClassType<any, T, C>): T;
|
272
|
-
|
273
|
-
/**
|
274
|
-
* Call this in your tests to create a shallow renderer.
|
275
|
-
*/
|
276
|
-
export function createRenderer(): ShallowRenderer;
|
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 (props: {}): 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 abort: EventSimulator;
|
87
|
+
const animationEnd: EventSimulator;
|
88
|
+
const animationIteration: EventSimulator;
|
89
|
+
const animationStart: EventSimulator;
|
90
|
+
const blur: EventSimulator;
|
91
|
+
const canPlay: EventSimulator;
|
92
|
+
const canPlayThrough: EventSimulator;
|
93
|
+
const change: EventSimulator;
|
94
|
+
const click: EventSimulator;
|
95
|
+
const compositionEnd: EventSimulator;
|
96
|
+
const compositionStart: EventSimulator;
|
97
|
+
const compositionUpdate: EventSimulator;
|
98
|
+
const contextMenu: EventSimulator;
|
99
|
+
const copy: EventSimulator;
|
100
|
+
const cut: EventSimulator;
|
101
|
+
const doubleClick: EventSimulator;
|
102
|
+
const drag: EventSimulator;
|
103
|
+
const dragEnd: EventSimulator;
|
104
|
+
const dragEnter: EventSimulator;
|
105
|
+
const dragExit: EventSimulator;
|
106
|
+
const dragLeave: EventSimulator;
|
107
|
+
const dragOver: EventSimulator;
|
108
|
+
const dragStart: EventSimulator;
|
109
|
+
const drop: EventSimulator;
|
110
|
+
const durationChange: EventSimulator;
|
111
|
+
const emptied: EventSimulator;
|
112
|
+
const encrypted: EventSimulator;
|
113
|
+
const ended: EventSimulator;
|
114
|
+
const error: EventSimulator;
|
115
|
+
const focus: EventSimulator;
|
116
|
+
const input: EventSimulator;
|
117
|
+
const invalid: EventSimulator;
|
118
|
+
const keyDown: EventSimulator;
|
119
|
+
const keyPress: EventSimulator;
|
120
|
+
const keyUp: EventSimulator;
|
121
|
+
const load: EventSimulator;
|
122
|
+
const loadStart: EventSimulator;
|
123
|
+
const loadedData: EventSimulator;
|
124
|
+
const loadedMetadata: EventSimulator;
|
125
|
+
const mouseDown: EventSimulator;
|
126
|
+
const mouseEnter: EventSimulator;
|
127
|
+
const mouseLeave: EventSimulator;
|
128
|
+
const mouseMove: EventSimulator;
|
129
|
+
const mouseOut: EventSimulator;
|
130
|
+
const mouseOver: EventSimulator;
|
131
|
+
const mouseUp: EventSimulator;
|
132
|
+
const paste: EventSimulator;
|
133
|
+
const pause: EventSimulator;
|
134
|
+
const play: EventSimulator;
|
135
|
+
const playing: EventSimulator;
|
136
|
+
const progress: EventSimulator;
|
137
|
+
const rateChange: EventSimulator;
|
138
|
+
const scroll: EventSimulator;
|
139
|
+
const seeked: EventSimulator;
|
140
|
+
const seeking: EventSimulator;
|
141
|
+
const select: EventSimulator;
|
142
|
+
const stalled: EventSimulator;
|
143
|
+
const submit: EventSimulator;
|
144
|
+
const suspend: EventSimulator;
|
145
|
+
const timeUpdate: EventSimulator;
|
146
|
+
const touchCancel: EventSimulator;
|
147
|
+
const touchEnd: EventSimulator;
|
148
|
+
const touchMove: EventSimulator;
|
149
|
+
const touchStart: EventSimulator;
|
150
|
+
const transitionEnd: EventSimulator;
|
151
|
+
const volumeChange: EventSimulator;
|
152
|
+
const waiting: EventSimulator;
|
153
|
+
const wheel: EventSimulator;
|
154
|
+
}
|
155
|
+
|
156
|
+
/**
|
157
|
+
* Render a React element into a detached DOM node in the document. __This function requires a DOM__.
|
158
|
+
*/
|
159
|
+
export function renderIntoDocument<T extends Element>(
|
160
|
+
element: DOMElement<any, T>): T;
|
161
|
+
export function renderIntoDocument(
|
162
|
+
element: SFCElement<any>): void;
|
163
|
+
export function renderIntoDocument<T extends Component<any>>(
|
164
|
+
element: CElement<any, T>): T;
|
165
|
+
export function renderIntoDocument<P>(
|
166
|
+
element: ReactElement<P>): Component<P> | Element | void;
|
167
|
+
|
168
|
+
/**
|
169
|
+
* Pass a mocked component module to this method to augment it with useful methods that allow it to
|
170
|
+
* be used as a dummy React component. Instead of rendering as usual, the component will become
|
171
|
+
* a simple `<div>` (or other tag if `mockTagName` is provided) containing any provided children.
|
172
|
+
*/
|
173
|
+
export function mockComponent(
|
174
|
+
mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils;
|
175
|
+
|
176
|
+
/**
|
177
|
+
* Returns `true` if `element` is any React element.
|
178
|
+
*/
|
179
|
+
export function isElement(element: any): boolean;
|
180
|
+
|
181
|
+
/**
|
182
|
+
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
183
|
+
*/
|
184
|
+
export function isElementOfType<T extends HTMLElement>(
|
185
|
+
element: ReactElement<any>, type: string): element is ReactHTMLElement<T>;
|
186
|
+
/**
|
187
|
+
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
188
|
+
*/
|
189
|
+
export function isElementOfType<P extends DOMAttributes<{}>, T extends Element>(
|
190
|
+
element: ReactElement<any>, type: string): element is DOMElement<P, T>;
|
191
|
+
/**
|
192
|
+
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
193
|
+
*/
|
194
|
+
export function isElementOfType<P>(
|
195
|
+
element: ReactElement<any>, type: SFC<P>): element is SFCElement<P>;
|
196
|
+
/**
|
197
|
+
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
198
|
+
*/
|
199
|
+
export function isElementOfType<P, T extends Component<P>, C extends ComponentClass<P>>(
|
200
|
+
element: ReactElement<any>, type: ClassType<P, T, C>): element is CElement<P, T>;
|
201
|
+
|
202
|
+
/**
|
203
|
+
* Returns `true` if `instance` is a DOM component (such as a `<div>` or `<span>`).
|
204
|
+
*/
|
205
|
+
export function isDOMComponent(instance: ReactInstance): instance is Element;
|
206
|
+
/**
|
207
|
+
* Returns `true` if `instance` is a user-defined component, such as a class or a function.
|
208
|
+
*/
|
209
|
+
export function isCompositeComponent(instance: ReactInstance): instance is Component<any>;
|
210
|
+
/**
|
211
|
+
* Returns `true` if `instance` is a component whose type is of a React `componentClass`.
|
212
|
+
*/
|
213
|
+
export function isCompositeComponentWithType<T extends Component<any>, C extends ComponentClass<any>>(
|
214
|
+
instance: ReactInstance, type: ClassType<any, T, C>): boolean;
|
215
|
+
|
216
|
+
/**
|
217
|
+
* Traverse all components in `tree` and accumulate all components where
|
218
|
+
* `test(component)` is `true`. This is not that useful on its own, but it's used
|
219
|
+
* as a primitive for other test utils.
|
220
|
+
*/
|
221
|
+
export function findAllInRenderedTree(
|
222
|
+
root: Component<any>,
|
223
|
+
fn: (i: ReactInstance) => boolean): ReactInstance[];
|
224
|
+
|
225
|
+
/**
|
226
|
+
* Finds all DOM elements of components in the rendered tree that are
|
227
|
+
* DOM components with the class name matching `className`.
|
228
|
+
*/
|
229
|
+
export function scryRenderedDOMComponentsWithClass(
|
230
|
+
root: Component<any>,
|
231
|
+
className: string): Element[];
|
232
|
+
/**
|
233
|
+
* Like `scryRenderedDOMComponentsWithClass()` but expects there to be one result,
|
234
|
+
* and returns that one result, or throws exception if there is any other
|
235
|
+
* number of matches besides one.
|
236
|
+
*/
|
237
|
+
export function findRenderedDOMComponentWithClass(
|
238
|
+
root: Component<any>,
|
239
|
+
className: string): Element;
|
240
|
+
|
241
|
+
/**
|
242
|
+
* Finds all DOM elements of components in the rendered tree that are
|
243
|
+
* DOM components with the tag name matching `tagName`.
|
244
|
+
*/
|
245
|
+
export function scryRenderedDOMComponentsWithTag(
|
246
|
+
root: Component<any>,
|
247
|
+
tagName: string): Element[];
|
248
|
+
/**
|
249
|
+
* Like `scryRenderedDOMComponentsWithTag()` but expects there to be one result,
|
250
|
+
* and returns that one result, or throws exception if there is any other
|
251
|
+
* number of matches besides one.
|
252
|
+
*/
|
253
|
+
export function findRenderedDOMComponentWithTag(
|
254
|
+
root: Component<any>,
|
255
|
+
tagName: string): Element;
|
256
|
+
|
257
|
+
/**
|
258
|
+
* Finds all instances of components with type equal to `componentClass`.
|
259
|
+
*/
|
260
|
+
export function scryRenderedComponentsWithType<T extends Component, C extends ComponentClass>(
|
261
|
+
root: Component<any>,
|
262
|
+
type: ClassType<any, T, C>): T[];
|
263
|
+
|
264
|
+
/**
|
265
|
+
* Same as `scryRenderedComponentsWithType()` but expects there to be one result
|
266
|
+
* and returns that one result, or throws exception if there is any other
|
267
|
+
* number of matches besides one.
|
268
|
+
*/
|
269
|
+
export function findRenderedComponentWithType<T extends Component, C extends ComponentClass>(
|
270
|
+
root: Component<any>,
|
271
|
+
type: ClassType<any, T, C>): T;
|
272
|
+
|
273
|
+
/**
|
274
|
+
* Call this in your tests to create a shallow renderer.
|
275
|
+
*/
|
276
|
+
export function createRenderer(): ShallowRenderer;
|
react-dom v15.5/README.md
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# Installation
|
2
|
-
> `npm install --save @types/react-dom`
|
3
|
-
|
4
|
-
# Summary
|
5
|
-
This package contains type definitions for React (react-dom) (http://facebook.github.io/react/).
|
6
|
-
|
7
|
-
# Details
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom/v15.
|
9
|
-
|
10
|
-
### Additional Details
|
11
|
-
* Last updated: Wed, 07 Jul 2021 17:33:42 GMT
|
12
|
-
* Dependencies: [@types/react](https://npmjs.com/package/@types/react)
|
13
|
-
* Global values: `ReactDOM`, `ReactDOMNodeStream`, `ReactDOMServer`
|
14
|
-
|
15
|
-
# Credits
|
16
|
-
These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), and [MartynasZilinskas](https://github.com/MartynasZilinskas).
|
react-dom v15.5/index.d.ts
DELETED
@@ -1,70 +0,0 @@
|
|
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.8
|
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 | null | undefined): 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;
|