@types/react 18.0.35 → 18.0.37
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/README.md +1 -1
- react/next.d.ts +1 -1
- react/package.json +24 -2
- react/ts5.0/experimental.d.ts +108 -0
- react/ts5.0/global.d.ts +157 -0
- react/ts5.0/index.d.ts +3297 -0
- react/ts5.0/jsx-dev-runtime.d.ts +2 -0
- react/ts5.0/jsx-runtime.d.ts +2 -0
- react/ts5.0/next.d.ts +86 -0
react/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for React (https://react.dev/).
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Mon, 17 Apr 2023 17:02:45 GMT
|
12
12
|
* Dependencies: [@types/csstype](https://npmjs.com/package/@types/csstype), [@types/prop-types](https://npmjs.com/package/@types/prop-types), [@types/scheduler](https://npmjs.com/package/@types/scheduler)
|
13
13
|
* Global values: `React`
|
14
14
|
|
react/next.d.ts
CHANGED
@@ -55,7 +55,7 @@ declare module '.' {
|
|
55
55
|
|
56
56
|
export function use<T>(usable: Usable<T>): T;
|
57
57
|
|
58
|
-
interface ServerContextJSONArray extends ReadonlyArray<
|
58
|
+
interface ServerContextJSONArray extends ReadonlyArray<ServerContextJSONValue> {}
|
59
59
|
export type ServerContextJSONValue =
|
60
60
|
| string
|
61
61
|
| boolean
|
react/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "18.0.
|
3
|
+
"version": "18.0.37",
|
4
4
|
"description": "TypeScript definitions for React",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
|
6
6
|
"license": "MIT",
|
@@ -140,6 +140,13 @@
|
|
140
140
|
],
|
141
141
|
"main": "",
|
142
142
|
"types": "index.d.ts",
|
143
|
+
"typesVersions": {
|
144
|
+
"<=5.0": {
|
145
|
+
"*": [
|
146
|
+
"ts5.0/*"
|
147
|
+
]
|
148
|
+
}
|
149
|
+
},
|
143
150
|
"repository": {
|
144
151
|
"type": "git",
|
145
152
|
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
@@ -151,30 +158,45 @@
|
|
151
158
|
"@types/scheduler": "*",
|
152
159
|
"csstype": "^3.0.2"
|
153
160
|
},
|
154
|
-
"typesPublisherContentHash": "
|
161
|
+
"typesPublisherContentHash": "5a0facae35cdfe863add83945b939a43c84cc9145fc8e064ac37dad9b5c9c6c1",
|
155
162
|
"typeScriptVersion": "4.3",
|
156
163
|
"exports": {
|
157
164
|
".": {
|
165
|
+
"types@<=5.0": {
|
166
|
+
"default": "./ts5.0/index.d.ts"
|
167
|
+
},
|
158
168
|
"types": {
|
159
169
|
"default": "./index.d.ts"
|
160
170
|
}
|
161
171
|
},
|
162
172
|
"./next": {
|
173
|
+
"types@<=5.0": {
|
174
|
+
"default": "./ts5.0/next.d.ts"
|
175
|
+
},
|
163
176
|
"types": {
|
164
177
|
"default": "./next.d.ts"
|
165
178
|
}
|
166
179
|
},
|
167
180
|
"./experimental": {
|
181
|
+
"types@<=5.0": {
|
182
|
+
"default": "./ts5.0/experimental.d.ts"
|
183
|
+
},
|
168
184
|
"types": {
|
169
185
|
"default": "./experimental.d.ts"
|
170
186
|
}
|
171
187
|
},
|
172
188
|
"./jsx-runtime": {
|
189
|
+
"types@<=5.0": {
|
190
|
+
"default": "./ts5.0/jsx-runtime.d.ts"
|
191
|
+
},
|
173
192
|
"types": {
|
174
193
|
"default": "./jsx-runtime.d.ts"
|
175
194
|
}
|
176
195
|
},
|
177
196
|
"./jsx-dev-runtime": {
|
197
|
+
"types@<=5.0": {
|
198
|
+
"default": "./ts5.0/jsx-dev-runtime.d.ts"
|
199
|
+
},
|
178
200
|
"types": {
|
179
201
|
"default": "./jsx-dev-runtime.d.ts"
|
180
202
|
}
|
@@ -0,0 +1,108 @@
|
|
1
|
+
/**
|
2
|
+
* These are types for things that are present in the `experimental` builds of React but not yet
|
3
|
+
* on a stable build.
|
4
|
+
*
|
5
|
+
* Once they are promoted to stable they can just be moved to the main index file.
|
6
|
+
*
|
7
|
+
* To load the types declared here in an actual project, there are three ways. The easiest one,
|
8
|
+
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
|
9
|
+
* is to add `"react/experimental"` to the `"types"` array.
|
10
|
+
*
|
11
|
+
* Alternatively, a specific import syntax can to be used from a typescript file.
|
12
|
+
* This module does not exist in reality, which is why the {} is important:
|
13
|
+
*
|
14
|
+
* ```ts
|
15
|
+
* import {} from 'react/experimental'
|
16
|
+
* ```
|
17
|
+
*
|
18
|
+
* It is also possible to include it through a triple-slash reference:
|
19
|
+
*
|
20
|
+
* ```ts
|
21
|
+
* /// <reference types="react/experimental" />
|
22
|
+
* ```
|
23
|
+
*
|
24
|
+
* Either the import or the reference only needs to appear once, anywhere in the project.
|
25
|
+
*/
|
26
|
+
|
27
|
+
// See https://github.com/facebook/react/blob/master/packages/react/src/React.js to see how the exports are declared,
|
28
|
+
// and https://github.com/facebook/react/blob/master/packages/shared/ReactFeatureFlags.js to verify which APIs are
|
29
|
+
// flagged experimental or not. Experimental APIs will be tagged with `__EXPERIMENTAL__`.
|
30
|
+
//
|
31
|
+
// For the inputs of types exported as simply a fiber tag, the `beginWork` function of ReactFiberBeginWork.js
|
32
|
+
// is a good place to start looking for details; it generally calls prop validation functions or delegates
|
33
|
+
// all tasks done as part of the render phase (the concurrent part of the React update cycle).
|
34
|
+
//
|
35
|
+
// Suspense-related handling can be found in ReactFiberThrow.js.
|
36
|
+
|
37
|
+
import React = require('./next');
|
38
|
+
|
39
|
+
export {};
|
40
|
+
|
41
|
+
declare module '.' {
|
42
|
+
export interface SuspenseProps {
|
43
|
+
/**
|
44
|
+
* The presence of this prop indicates that the content is computationally expensive to render.
|
45
|
+
* In other words, the tree is CPU bound and not I/O bound (e.g. due to fetching data).
|
46
|
+
* @see {@link https://github.com/facebook/react/pull/19936}
|
47
|
+
*/
|
48
|
+
unstable_expectedLoadTime?: number | undefined;
|
49
|
+
}
|
50
|
+
|
51
|
+
export type SuspenseListRevealOrder = 'forwards' | 'backwards' | 'together';
|
52
|
+
export type SuspenseListTailMode = 'collapsed' | 'hidden';
|
53
|
+
|
54
|
+
export interface SuspenseListCommonProps {
|
55
|
+
/**
|
56
|
+
* Note that SuspenseList require more than one child;
|
57
|
+
* it is a runtime warning to provide only a single child.
|
58
|
+
*
|
59
|
+
* It does, however, allow those children to be wrapped inside a single
|
60
|
+
* level of `<React.Fragment>`.
|
61
|
+
*/
|
62
|
+
children: ReactElement | Iterable<ReactElement>;
|
63
|
+
}
|
64
|
+
|
65
|
+
interface DirectionalSuspenseListProps extends SuspenseListCommonProps {
|
66
|
+
/**
|
67
|
+
* Defines the order in which the `SuspenseList` children should be revealed.
|
68
|
+
*/
|
69
|
+
revealOrder: 'forwards' | 'backwards';
|
70
|
+
/**
|
71
|
+
* Dictates how unloaded items in a SuspenseList is shown.
|
72
|
+
*
|
73
|
+
* - By default, `SuspenseList` will show all fallbacks in the list.
|
74
|
+
* - `collapsed` shows only the next fallback in the list.
|
75
|
+
* - `hidden` doesn’t show any unloaded items.
|
76
|
+
*/
|
77
|
+
tail?: SuspenseListTailMode | undefined;
|
78
|
+
}
|
79
|
+
|
80
|
+
interface NonDirectionalSuspenseListProps extends SuspenseListCommonProps {
|
81
|
+
/**
|
82
|
+
* Defines the order in which the `SuspenseList` children should be revealed.
|
83
|
+
*/
|
84
|
+
revealOrder?: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps['revealOrder']> | undefined;
|
85
|
+
/**
|
86
|
+
* The tail property is invalid when not using the `forwards` or `backwards` reveal orders.
|
87
|
+
*/
|
88
|
+
tail?: never | undefined;
|
89
|
+
}
|
90
|
+
|
91
|
+
export type SuspenseListProps = DirectionalSuspenseListProps | NonDirectionalSuspenseListProps;
|
92
|
+
|
93
|
+
/**
|
94
|
+
* `SuspenseList` helps coordinate many components that can suspend by orchestrating the order
|
95
|
+
* in which these components are revealed to the user.
|
96
|
+
*
|
97
|
+
* When multiple components need to fetch data, this data may arrive in an unpredictable order.
|
98
|
+
* However, if you wrap these items in a `SuspenseList`, React will not show an item in the list
|
99
|
+
* until previous items have been displayed (this behavior is adjustable).
|
100
|
+
*
|
101
|
+
* @see https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist
|
102
|
+
* @see https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist
|
103
|
+
*/
|
104
|
+
export const SuspenseList: ExoticComponent<SuspenseListProps>;
|
105
|
+
|
106
|
+
// tslint:disable-next-line ban-types
|
107
|
+
export function experimental_useEffectEvent<T extends Function>(event: T): T;
|
108
|
+
}
|
react/ts5.0/global.d.ts
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
/*
|
2
|
+
React projects that don't include the DOM library need these interfaces to compile.
|
3
|
+
React Native applications use React, but there is no DOM available. The JavaScript runtime
|
4
|
+
is ES6/ES2015 only. These definitions allow such projects to compile with only `--lib ES6`.
|
5
|
+
|
6
|
+
Warning: all of these interfaces are empty. If you want type definitions for various properties
|
7
|
+
(such as HTMLInputElement.prototype.value), you need to add `--lib DOM` (via command line or tsconfig.json).
|
8
|
+
*/
|
9
|
+
|
10
|
+
interface Event { }
|
11
|
+
interface AnimationEvent extends Event { }
|
12
|
+
interface ClipboardEvent extends Event { }
|
13
|
+
interface CompositionEvent extends Event { }
|
14
|
+
interface DragEvent extends Event { }
|
15
|
+
interface FocusEvent extends Event { }
|
16
|
+
interface KeyboardEvent extends Event { }
|
17
|
+
interface MouseEvent extends Event { }
|
18
|
+
interface TouchEvent extends Event { }
|
19
|
+
interface PointerEvent extends Event { }
|
20
|
+
interface TransitionEvent extends Event { }
|
21
|
+
interface UIEvent extends Event { }
|
22
|
+
interface WheelEvent extends Event { }
|
23
|
+
|
24
|
+
interface EventTarget { }
|
25
|
+
interface Document { }
|
26
|
+
interface DataTransfer { }
|
27
|
+
interface StyleMedia { }
|
28
|
+
|
29
|
+
interface Element { }
|
30
|
+
interface DocumentFragment { }
|
31
|
+
|
32
|
+
interface HTMLElement extends Element { }
|
33
|
+
interface HTMLAnchorElement extends HTMLElement { }
|
34
|
+
interface HTMLAreaElement extends HTMLElement { }
|
35
|
+
interface HTMLAudioElement extends HTMLElement { }
|
36
|
+
interface HTMLBaseElement extends HTMLElement { }
|
37
|
+
interface HTMLBodyElement extends HTMLElement { }
|
38
|
+
interface HTMLBRElement extends HTMLElement { }
|
39
|
+
interface HTMLButtonElement extends HTMLElement { }
|
40
|
+
interface HTMLCanvasElement extends HTMLElement { }
|
41
|
+
interface HTMLDataElement extends HTMLElement { }
|
42
|
+
interface HTMLDataListElement extends HTMLElement { }
|
43
|
+
interface HTMLDetailsElement extends HTMLElement { }
|
44
|
+
interface HTMLDialogElement extends HTMLElement { }
|
45
|
+
interface HTMLDivElement extends HTMLElement { }
|
46
|
+
interface HTMLDListElement extends HTMLElement { }
|
47
|
+
interface HTMLEmbedElement extends HTMLElement { }
|
48
|
+
interface HTMLFieldSetElement extends HTMLElement { }
|
49
|
+
interface HTMLFormElement extends HTMLElement { }
|
50
|
+
interface HTMLHeadingElement extends HTMLElement { }
|
51
|
+
interface HTMLHeadElement extends HTMLElement { }
|
52
|
+
interface HTMLHRElement extends HTMLElement { }
|
53
|
+
interface HTMLHtmlElement extends HTMLElement { }
|
54
|
+
interface HTMLIFrameElement extends HTMLElement { }
|
55
|
+
interface HTMLImageElement extends HTMLElement { }
|
56
|
+
interface HTMLInputElement extends HTMLElement { }
|
57
|
+
interface HTMLModElement extends HTMLElement { }
|
58
|
+
interface HTMLLabelElement extends HTMLElement { }
|
59
|
+
interface HTMLLegendElement extends HTMLElement { }
|
60
|
+
interface HTMLLIElement extends HTMLElement { }
|
61
|
+
interface HTMLLinkElement extends HTMLElement { }
|
62
|
+
interface HTMLMapElement extends HTMLElement { }
|
63
|
+
interface HTMLMetaElement extends HTMLElement { }
|
64
|
+
interface HTMLMeterElement extends HTMLElement { }
|
65
|
+
interface HTMLObjectElement extends HTMLElement { }
|
66
|
+
interface HTMLOListElement extends HTMLElement { }
|
67
|
+
interface HTMLOptGroupElement extends HTMLElement { }
|
68
|
+
interface HTMLOptionElement extends HTMLElement { }
|
69
|
+
interface HTMLOutputElement extends HTMLElement { }
|
70
|
+
interface HTMLParagraphElement extends HTMLElement { }
|
71
|
+
interface HTMLParamElement extends HTMLElement { }
|
72
|
+
interface HTMLPreElement extends HTMLElement { }
|
73
|
+
interface HTMLProgressElement extends HTMLElement { }
|
74
|
+
interface HTMLQuoteElement extends HTMLElement { }
|
75
|
+
interface HTMLSlotElement extends HTMLElement { }
|
76
|
+
interface HTMLScriptElement extends HTMLElement { }
|
77
|
+
interface HTMLSelectElement extends HTMLElement { }
|
78
|
+
interface HTMLSourceElement extends HTMLElement { }
|
79
|
+
interface HTMLSpanElement extends HTMLElement { }
|
80
|
+
interface HTMLStyleElement extends HTMLElement { }
|
81
|
+
interface HTMLTableElement extends HTMLElement { }
|
82
|
+
interface HTMLTableColElement extends HTMLElement { }
|
83
|
+
interface HTMLTableDataCellElement extends HTMLElement { }
|
84
|
+
interface HTMLTableHeaderCellElement extends HTMLElement { }
|
85
|
+
interface HTMLTableRowElement extends HTMLElement { }
|
86
|
+
interface HTMLTableSectionElement extends HTMLElement { }
|
87
|
+
interface HTMLTemplateElement extends HTMLElement { }
|
88
|
+
interface HTMLTextAreaElement extends HTMLElement { }
|
89
|
+
interface HTMLTimeElement extends HTMLElement { }
|
90
|
+
interface HTMLTitleElement extends HTMLElement { }
|
91
|
+
interface HTMLTrackElement extends HTMLElement { }
|
92
|
+
interface HTMLUListElement extends HTMLElement { }
|
93
|
+
interface HTMLVideoElement extends HTMLElement { }
|
94
|
+
interface HTMLWebViewElement extends HTMLElement { }
|
95
|
+
|
96
|
+
interface SVGElement extends Element { }
|
97
|
+
interface SVGSVGElement extends SVGElement { }
|
98
|
+
interface SVGCircleElement extends SVGElement { }
|
99
|
+
interface SVGClipPathElement extends SVGElement { }
|
100
|
+
interface SVGDefsElement extends SVGElement { }
|
101
|
+
interface SVGDescElement extends SVGElement { }
|
102
|
+
interface SVGEllipseElement extends SVGElement { }
|
103
|
+
interface SVGFEBlendElement extends SVGElement { }
|
104
|
+
interface SVGFEColorMatrixElement extends SVGElement { }
|
105
|
+
interface SVGFEComponentTransferElement extends SVGElement { }
|
106
|
+
interface SVGFECompositeElement extends SVGElement { }
|
107
|
+
interface SVGFEConvolveMatrixElement extends SVGElement { }
|
108
|
+
interface SVGFEDiffuseLightingElement extends SVGElement { }
|
109
|
+
interface SVGFEDisplacementMapElement extends SVGElement { }
|
110
|
+
interface SVGFEDistantLightElement extends SVGElement { }
|
111
|
+
interface SVGFEDropShadowElement extends SVGElement { }
|
112
|
+
interface SVGFEFloodElement extends SVGElement { }
|
113
|
+
interface SVGFEFuncAElement extends SVGElement { }
|
114
|
+
interface SVGFEFuncBElement extends SVGElement { }
|
115
|
+
interface SVGFEFuncGElement extends SVGElement { }
|
116
|
+
interface SVGFEFuncRElement extends SVGElement { }
|
117
|
+
interface SVGFEGaussianBlurElement extends SVGElement { }
|
118
|
+
interface SVGFEImageElement extends SVGElement { }
|
119
|
+
interface SVGFEMergeElement extends SVGElement { }
|
120
|
+
interface SVGFEMergeNodeElement extends SVGElement { }
|
121
|
+
interface SVGFEMorphologyElement extends SVGElement { }
|
122
|
+
interface SVGFEOffsetElement extends SVGElement { }
|
123
|
+
interface SVGFEPointLightElement extends SVGElement { }
|
124
|
+
interface SVGFESpecularLightingElement extends SVGElement { }
|
125
|
+
interface SVGFESpotLightElement extends SVGElement { }
|
126
|
+
interface SVGFETileElement extends SVGElement { }
|
127
|
+
interface SVGFETurbulenceElement extends SVGElement { }
|
128
|
+
interface SVGFilterElement extends SVGElement { }
|
129
|
+
interface SVGForeignObjectElement extends SVGElement { }
|
130
|
+
interface SVGGElement extends SVGElement { }
|
131
|
+
interface SVGImageElement extends SVGElement { }
|
132
|
+
interface SVGLineElement extends SVGElement { }
|
133
|
+
interface SVGLinearGradientElement extends SVGElement { }
|
134
|
+
interface SVGMarkerElement extends SVGElement { }
|
135
|
+
interface SVGMaskElement extends SVGElement { }
|
136
|
+
interface SVGMetadataElement extends SVGElement { }
|
137
|
+
interface SVGPathElement extends SVGElement { }
|
138
|
+
interface SVGPatternElement extends SVGElement { }
|
139
|
+
interface SVGPolygonElement extends SVGElement { }
|
140
|
+
interface SVGPolylineElement extends SVGElement { }
|
141
|
+
interface SVGRadialGradientElement extends SVGElement { }
|
142
|
+
interface SVGRectElement extends SVGElement { }
|
143
|
+
interface SVGStopElement extends SVGElement { }
|
144
|
+
interface SVGSwitchElement extends SVGElement { }
|
145
|
+
interface SVGSymbolElement extends SVGElement { }
|
146
|
+
interface SVGTextElement extends SVGElement { }
|
147
|
+
interface SVGTextPathElement extends SVGElement { }
|
148
|
+
interface SVGTSpanElement extends SVGElement { }
|
149
|
+
interface SVGUseElement extends SVGElement { }
|
150
|
+
interface SVGViewElement extends SVGElement { }
|
151
|
+
|
152
|
+
interface Text { }
|
153
|
+
interface TouchList { }
|
154
|
+
interface WebGLRenderingContext { }
|
155
|
+
interface WebGL2RenderingContext { }
|
156
|
+
|
157
|
+
interface TrustedHTML { }
|