@types/react 16.14.39 → 16.14.41

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 v16.14/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
  > `npm install --save @types/react`
3
3
 
4
4
  # Summary
5
- This package contains type definitions for React (http://facebook.github.io/react/).
5
+ This package contains type definitions for React (https://react.dev/).
6
6
 
7
7
  # Details
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react/v16.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 10 Apr 2023 11:03:28 GMT
11
+ * Last updated: Sat, 06 May 2023 11:32:50 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 v16.14/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // Type definitions for React 16.14
2
- // Project: http://facebook.github.io/react/
2
+ // Project: https://react.dev/
3
3
  // Definitions by: Asana <https://asana.com>
4
4
  // AssureSign <http://www.assuresign.com>
5
5
  // Microsoft <https://microsoft.com>
@@ -224,7 +224,6 @@ declare namespace React {
224
224
 
225
225
  //
226
226
  // React Nodes
227
- // http://facebook.github.io/react/docs/glossary.html
228
227
  // ----------------------------------------------------------------------
229
228
 
230
229
  type ReactText = string | number;
@@ -1339,6 +1338,9 @@ declare namespace React {
1339
1338
  interface SVGProps<T> extends SVGAttributes<T>, ClassAttributes<T> {
1340
1339
  }
1341
1340
 
1341
+ interface SVGLineElementAttributes<T> extends SVGProps<T> {}
1342
+ interface SVGTextElementAttributes<T> extends SVGProps<T> {}
1343
+
1342
1344
  interface DOMAttributes<T> {
1343
1345
  children?: ReactNode | undefined;
1344
1346
  dangerouslySetInnerHTML?: {
@@ -3020,6 +3022,19 @@ declare namespace React {
3020
3022
  */
3021
3023
  componentStack: string;
3022
3024
  }
3025
+
3026
+ namespace JSX {
3027
+ interface Element extends GlobalJSXElement {}
3028
+ interface ElementClass extends GlobalJSXElementClass {}
3029
+ interface ElementAttributesProperty extends GlobalJSXElementAttributesProperty {}
3030
+ interface ElementChildrenAttribute extends GlobalJSXElementChildrenAttribute {}
3031
+
3032
+ type LibraryManagedAttributes<C, P> = GlobalJSXLibraryManagedAttributes<C, P>;
3033
+
3034
+ interface IntrinsicAttributes extends GlobalJSXIntrinsicAttributes {}
3035
+ interface IntrinsicClassAttributes<T> extends GlobalJSXIntrinsicClassAttributes<T> {}
3036
+ interface IntrinsicElements extends GlobalJSXIntrinsicElements {}
3037
+ }
3023
3038
  }
3024
3039
 
3025
3040
  // naked 'any' type in a conditional type will short circuit and union both the then/else branches
@@ -3067,6 +3082,9 @@ type ReactManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps
3067
3082
  : P;
3068
3083
 
3069
3084
  declare global {
3085
+ /**
3086
+ * @deprecated Use `React.JSX` instead of the global `JSX` namespace.
3087
+ */
3070
3088
  namespace JSX {
3071
3089
  // tslint:disable-next-line:no-empty-interface
3072
3090
  interface Element extends React.ReactElement<any, any> { }
@@ -3249,7 +3267,7 @@ declare global {
3249
3267
  foreignObject: React.SVGProps<SVGForeignObjectElement>;
3250
3268
  g: React.SVGProps<SVGGElement>;
3251
3269
  image: React.SVGProps<SVGImageElement>;
3252
- line: React.SVGProps<SVGLineElement>;
3270
+ line: React.SVGLineElementAttributes<SVGLineElement>;
3253
3271
  linearGradient: React.SVGProps<SVGLinearGradientElement>;
3254
3272
  marker: React.SVGProps<SVGMarkerElement>;
3255
3273
  mask: React.SVGProps<SVGMaskElement>;
@@ -3264,7 +3282,7 @@ declare global {
3264
3282
  stop: React.SVGProps<SVGStopElement>;
3265
3283
  switch: React.SVGProps<SVGSwitchElement>;
3266
3284
  symbol: React.SVGProps<SVGSymbolElement>;
3267
- text: React.SVGProps<SVGTextElement>;
3285
+ text: React.SVGTextElementAttributes<SVGTextElement>;
3268
3286
  textPath: React.SVGProps<SVGTextPathElement>;
3269
3287
  tspan: React.SVGProps<SVGTSpanElement>;
3270
3288
  use: React.SVGProps<SVGUseElement>;
@@ -3272,3 +3290,18 @@ declare global {
3272
3290
  }
3273
3291
  }
3274
3292
  }
3293
+
3294
+ // React.JSX needs to point to global.JSX to keep global module augmentations intact.
3295
+ // But we can't access global.JSX so we need to create these aliases instead.
3296
+ // Once the global JSX namespace will be removed we replace React.JSX with the contents of global.JSX
3297
+ interface GlobalJSXElement extends JSX.Element {}
3298
+ interface GlobalJSXElementClass extends JSX.ElementClass {}
3299
+ interface GlobalJSXElementAttributesProperty extends JSX.ElementAttributesProperty {}
3300
+ interface GlobalJSXElementChildrenAttribute extends JSX.ElementChildrenAttribute {}
3301
+
3302
+ type GlobalJSXLibraryManagedAttributes<C, P> = JSX.LibraryManagedAttributes<C, P>;
3303
+
3304
+ interface GlobalJSXIntrinsicAttributes extends JSX.IntrinsicAttributes {}
3305
+ interface GlobalJSXIntrinsicClassAttributes<T> extends JSX.IntrinsicClassAttributes<T> {}
3306
+
3307
+ interface GlobalJSXIntrinsicElements extends JSX.IntrinsicElements {}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "16.14.39",
3
+ "version": "16.14.41",
4
4
  "description": "TypeScript definitions for React",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",
@@ -146,7 +146,7 @@
146
146
  "@types/scheduler": "*",
147
147
  "csstype": "^3.0.2"
148
148
  },
149
- "typesPublisherContentHash": "81c5ef638b8ab9791fda234cb09b11f1a9837aa11004e03d046ccda50c1cb7f2",
149
+ "typesPublisherContentHash": "61d929f77f9643bf916a195dc8e2f0243162e8245d29e361831c9622803d9ec9",
150
150
  "typeScriptVersion": "4.3",
151
151
  "exports": {
152
152
  ".": {