@types/react 18.2.5 → 18.2.7
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/index.d.ts +43 -3
- react/jsx-dev-runtime.d.ts +12 -2
- react/jsx-runtime.d.ts +12 -2
- react/package.json +2 -2
- react/ts5.0/index.d.ts +43 -3
- react/ts5.0/jsx-dev-runtime.d.ts +12 -2
- react/ts5.0/jsx-runtime.d.ts +12 -2
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: Wed, 24 May 2023 14:32:47 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/index.d.ts
CHANGED
@@ -76,7 +76,13 @@ declare namespace React {
|
|
76
76
|
type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;
|
77
77
|
|
78
78
|
type JSXElementConstructor<P> =
|
79
|
-
| ((
|
79
|
+
| ((
|
80
|
+
props: P,
|
81
|
+
/**
|
82
|
+
* @deprecated https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-stateless-function-components
|
83
|
+
*/
|
84
|
+
deprecatedLegacyContext?: any,
|
85
|
+
) => ReactElement<any, any> | null)
|
80
86
|
| (new (props: P) => Component<any, any>);
|
81
87
|
|
82
88
|
interface RefObject<T> {
|
@@ -1398,6 +1404,9 @@ declare namespace React {
|
|
1398
1404
|
interface SVGProps<T> extends SVGAttributes<T>, ClassAttributes<T> {
|
1399
1405
|
}
|
1400
1406
|
|
1407
|
+
interface SVGLineElementAttributes<T> extends SVGProps<T> {}
|
1408
|
+
interface SVGTextElementAttributes<T> extends SVGProps<T> {}
|
1409
|
+
|
1401
1410
|
interface DOMAttributes<T> {
|
1402
1411
|
children?: ReactNode | undefined;
|
1403
1412
|
dangerouslySetInnerHTML?: {
|
@@ -3115,6 +3124,19 @@ declare namespace React {
|
|
3115
3124
|
*/
|
3116
3125
|
componentStack: string;
|
3117
3126
|
}
|
3127
|
+
|
3128
|
+
namespace JSX {
|
3129
|
+
interface Element extends GlobalJSXElement {}
|
3130
|
+
interface ElementClass extends GlobalJSXElementClass {}
|
3131
|
+
interface ElementAttributesProperty extends GlobalJSXElementAttributesProperty {}
|
3132
|
+
interface ElementChildrenAttribute extends GlobalJSXElementChildrenAttribute {}
|
3133
|
+
|
3134
|
+
type LibraryManagedAttributes<C, P> = GlobalJSXLibraryManagedAttributes<C, P>;
|
3135
|
+
|
3136
|
+
interface IntrinsicAttributes extends GlobalJSXIntrinsicAttributes {}
|
3137
|
+
interface IntrinsicClassAttributes<T> extends GlobalJSXIntrinsicClassAttributes<T> {}
|
3138
|
+
interface IntrinsicElements extends GlobalJSXIntrinsicElements {}
|
3139
|
+
}
|
3118
3140
|
}
|
3119
3141
|
|
3120
3142
|
// naked 'any' type in a conditional type will short circuit and union both the then/else branches
|
@@ -3162,6 +3184,9 @@ type ReactManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps
|
|
3162
3184
|
: P;
|
3163
3185
|
|
3164
3186
|
declare global {
|
3187
|
+
/**
|
3188
|
+
* @deprecated Use `React.JSX` instead of the global `JSX` namespace.
|
3189
|
+
*/
|
3165
3190
|
namespace JSX {
|
3166
3191
|
interface Element extends React.ReactElement<any, any> { }
|
3167
3192
|
interface ElementClass extends React.Component<any> {
|
@@ -3342,7 +3367,7 @@ declare global {
|
|
3342
3367
|
foreignObject: React.SVGProps<SVGForeignObjectElement>;
|
3343
3368
|
g: React.SVGProps<SVGGElement>;
|
3344
3369
|
image: React.SVGProps<SVGImageElement>;
|
3345
|
-
line: React.
|
3370
|
+
line: React.SVGLineElementAttributes<SVGLineElement>;
|
3346
3371
|
linearGradient: React.SVGProps<SVGLinearGradientElement>;
|
3347
3372
|
marker: React.SVGProps<SVGMarkerElement>;
|
3348
3373
|
mask: React.SVGProps<SVGMaskElement>;
|
@@ -3357,7 +3382,7 @@ declare global {
|
|
3357
3382
|
stop: React.SVGProps<SVGStopElement>;
|
3358
3383
|
switch: React.SVGProps<SVGSwitchElement>;
|
3359
3384
|
symbol: React.SVGProps<SVGSymbolElement>;
|
3360
|
-
text: React.
|
3385
|
+
text: React.SVGTextElementAttributes<SVGTextElement>;
|
3361
3386
|
textPath: React.SVGProps<SVGTextPathElement>;
|
3362
3387
|
tspan: React.SVGProps<SVGTSpanElement>;
|
3363
3388
|
use: React.SVGProps<SVGUseElement>;
|
@@ -3365,3 +3390,18 @@ declare global {
|
|
3365
3390
|
}
|
3366
3391
|
}
|
3367
3392
|
}
|
3393
|
+
|
3394
|
+
// React.JSX needs to point to global.JSX to keep global module augmentations intact.
|
3395
|
+
// But we can't access global.JSX so we need to create these aliases instead.
|
3396
|
+
// Once the global JSX namespace will be removed we replace React.JSX with the contents of global.JSX
|
3397
|
+
interface GlobalJSXElement extends JSX.Element {}
|
3398
|
+
interface GlobalJSXElementClass extends JSX.ElementClass {}
|
3399
|
+
interface GlobalJSXElementAttributesProperty extends JSX.ElementAttributesProperty {}
|
3400
|
+
interface GlobalJSXElementChildrenAttribute extends JSX.ElementChildrenAttribute {}
|
3401
|
+
|
3402
|
+
type GlobalJSXLibraryManagedAttributes<C, P> = JSX.LibraryManagedAttributes<C, P>;
|
3403
|
+
|
3404
|
+
interface GlobalJSXIntrinsicAttributes extends JSX.IntrinsicAttributes {}
|
3405
|
+
interface GlobalJSXIntrinsicClassAttributes<T> extends JSX.IntrinsicClassAttributes<T> {}
|
3406
|
+
|
3407
|
+
interface GlobalJSXIntrinsicElements extends JSX.IntrinsicElements {}
|
react/jsx-dev-runtime.d.ts
CHANGED
@@ -1,2 +1,12 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import * as React from './';
|
2
|
+
|
3
|
+
export namespace JSX {
|
4
|
+
interface Element extends React.JSX.Element {}
|
5
|
+
interface ElementClass extends React.JSX.ElementClass {}
|
6
|
+
interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {}
|
7
|
+
interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
|
8
|
+
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
|
9
|
+
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
|
10
|
+
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
|
11
|
+
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
|
12
|
+
}
|
react/jsx-runtime.d.ts
CHANGED
@@ -1,2 +1,12 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import * as React from './';
|
2
|
+
|
3
|
+
export namespace JSX {
|
4
|
+
interface Element extends React.JSX.Element {}
|
5
|
+
interface ElementClass extends React.JSX.ElementClass {}
|
6
|
+
interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {}
|
7
|
+
interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
|
8
|
+
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
|
9
|
+
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
|
10
|
+
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
|
11
|
+
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
|
12
|
+
}
|
react/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "18.2.
|
3
|
+
"version": "18.2.7",
|
4
4
|
"description": "TypeScript definitions for React",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
|
6
6
|
"license": "MIT",
|
@@ -158,7 +158,7 @@
|
|
158
158
|
"@types/scheduler": "*",
|
159
159
|
"csstype": "^3.0.2"
|
160
160
|
},
|
161
|
-
"typesPublisherContentHash": "
|
161
|
+
"typesPublisherContentHash": "bb5350973ee9e7716f78b08a665dedf1d8a38f1c9720199a6716cbcd7568e4df",
|
162
162
|
"typeScriptVersion": "4.3",
|
163
163
|
"exports": {
|
164
164
|
".": {
|
react/ts5.0/index.d.ts
CHANGED
@@ -44,7 +44,13 @@ declare namespace React {
|
|
44
44
|
type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;
|
45
45
|
|
46
46
|
type JSXElementConstructor<P> =
|
47
|
-
| ((
|
47
|
+
| ((
|
48
|
+
props: P,
|
49
|
+
/**
|
50
|
+
* @deprecated https://legacy.react/ts5.0js.org/docs/legacy-context.html#referencing-context-in-stateless-function-components
|
51
|
+
*/
|
52
|
+
deprecatedLegacyContext?: any,
|
53
|
+
) => ReactElement<any, any> | null)
|
48
54
|
| (new (props: P) => Component<any, any>);
|
49
55
|
|
50
56
|
interface RefObject<T> {
|
@@ -1366,6 +1372,9 @@ declare namespace React {
|
|
1366
1372
|
interface SVGProps<T> extends SVGAttributes<T>, ClassAttributes<T> {
|
1367
1373
|
}
|
1368
1374
|
|
1375
|
+
interface SVGLineElementAttributes<T> extends SVGProps<T> {}
|
1376
|
+
interface SVGTextElementAttributes<T> extends SVGProps<T> {}
|
1377
|
+
|
1369
1378
|
interface DOMAttributes<T> {
|
1370
1379
|
children?: ReactNode | undefined;
|
1371
1380
|
dangerouslySetInnerHTML?: {
|
@@ -3083,6 +3092,19 @@ declare namespace React {
|
|
3083
3092
|
*/
|
3084
3093
|
componentStack: string;
|
3085
3094
|
}
|
3095
|
+
|
3096
|
+
namespace JSX {
|
3097
|
+
interface Element extends GlobalJSXElement {}
|
3098
|
+
interface ElementClass extends GlobalJSXElementClass {}
|
3099
|
+
interface ElementAttributesProperty extends GlobalJSXElementAttributesProperty {}
|
3100
|
+
interface ElementChildrenAttribute extends GlobalJSXElementChildrenAttribute {}
|
3101
|
+
|
3102
|
+
type LibraryManagedAttributes<C, P> = GlobalJSXLibraryManagedAttributes<C, P>;
|
3103
|
+
|
3104
|
+
interface IntrinsicAttributes extends GlobalJSXIntrinsicAttributes {}
|
3105
|
+
interface IntrinsicClassAttributes<T> extends GlobalJSXIntrinsicClassAttributes<T> {}
|
3106
|
+
interface IntrinsicElements extends GlobalJSXIntrinsicElements {}
|
3107
|
+
}
|
3086
3108
|
}
|
3087
3109
|
|
3088
3110
|
// naked 'any' type in a conditional type will short circuit and union both the then/else branches
|
@@ -3130,6 +3152,9 @@ type ReactManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps
|
|
3130
3152
|
: P;
|
3131
3153
|
|
3132
3154
|
declare global {
|
3155
|
+
/**
|
3156
|
+
* @deprecated Use `React.JSX` instead of the global `JSX` namespace.
|
3157
|
+
*/
|
3133
3158
|
namespace JSX {
|
3134
3159
|
interface Element extends React.ReactElement<any, any> { }
|
3135
3160
|
interface ElementClass extends React.Component<any> {
|
@@ -3310,7 +3335,7 @@ declare global {
|
|
3310
3335
|
foreignObject: React.SVGProps<SVGForeignObjectElement>;
|
3311
3336
|
g: React.SVGProps<SVGGElement>;
|
3312
3337
|
image: React.SVGProps<SVGImageElement>;
|
3313
|
-
line: React.
|
3338
|
+
line: React.SVGLineElementAttributes<SVGLineElement>;
|
3314
3339
|
linearGradient: React.SVGProps<SVGLinearGradientElement>;
|
3315
3340
|
marker: React.SVGProps<SVGMarkerElement>;
|
3316
3341
|
mask: React.SVGProps<SVGMaskElement>;
|
@@ -3325,7 +3350,7 @@ declare global {
|
|
3325
3350
|
stop: React.SVGProps<SVGStopElement>;
|
3326
3351
|
switch: React.SVGProps<SVGSwitchElement>;
|
3327
3352
|
symbol: React.SVGProps<SVGSymbolElement>;
|
3328
|
-
text: React.
|
3353
|
+
text: React.SVGTextElementAttributes<SVGTextElement>;
|
3329
3354
|
textPath: React.SVGProps<SVGTextPathElement>;
|
3330
3355
|
tspan: React.SVGProps<SVGTSpanElement>;
|
3331
3356
|
use: React.SVGProps<SVGUseElement>;
|
@@ -3333,3 +3358,18 @@ declare global {
|
|
3333
3358
|
}
|
3334
3359
|
}
|
3335
3360
|
}
|
3361
|
+
|
3362
|
+
// React.JSX needs to point to global.JSX to keep global module augmentations intact.
|
3363
|
+
// But we can't access global.JSX so we need to create these aliases instead.
|
3364
|
+
// Once the global JSX namespace will be removed we replace React.JSX with the contents of global.JSX
|
3365
|
+
interface GlobalJSXElement extends JSX.Element {}
|
3366
|
+
interface GlobalJSXElementClass extends JSX.ElementClass {}
|
3367
|
+
interface GlobalJSXElementAttributesProperty extends JSX.ElementAttributesProperty {}
|
3368
|
+
interface GlobalJSXElementChildrenAttribute extends JSX.ElementChildrenAttribute {}
|
3369
|
+
|
3370
|
+
type GlobalJSXLibraryManagedAttributes<C, P> = JSX.LibraryManagedAttributes<C, P>;
|
3371
|
+
|
3372
|
+
interface GlobalJSXIntrinsicAttributes extends JSX.IntrinsicAttributes {}
|
3373
|
+
interface GlobalJSXIntrinsicClassAttributes<T> extends JSX.IntrinsicClassAttributes<T> {}
|
3374
|
+
|
3375
|
+
interface GlobalJSXIntrinsicElements extends JSX.IntrinsicElements {}
|
react/ts5.0/jsx-dev-runtime.d.ts
CHANGED
@@ -1,2 +1,12 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import * as React from './';
|
2
|
+
|
3
|
+
export namespace JSX {
|
4
|
+
interface Element extends React.JSX.Element {}
|
5
|
+
interface ElementClass extends React.JSX.ElementClass {}
|
6
|
+
interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {}
|
7
|
+
interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
|
8
|
+
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
|
9
|
+
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
|
10
|
+
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
|
11
|
+
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
|
12
|
+
}
|
react/ts5.0/jsx-runtime.d.ts
CHANGED
@@ -1,2 +1,12 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import * as React from './';
|
2
|
+
|
3
|
+
export namespace JSX {
|
4
|
+
interface Element extends React.JSX.Element {}
|
5
|
+
interface ElementClass extends React.JSX.ElementClass {}
|
6
|
+
interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {}
|
7
|
+
interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
|
8
|
+
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
|
9
|
+
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
|
10
|
+
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
|
11
|
+
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
|
12
|
+
}
|