@types/react 15.7.16 → 15.7.18

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 v15.7/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/v15.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 12 Apr 2023 10:33:22 GMT
11
+ * Last updated: Thu, 25 May 2023 20:34:37 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `React`
14
14
 
react v15.7/index.d.ts CHANGED
@@ -565,7 +565,7 @@ declare namespace React {
565
565
  // ----------------------------------------------------------------------
566
566
 
567
567
  /**
568
- * @deprecated. This was used to allow clients to pass `ref` and `key`
568
+ * @deprecated This was used to allow clients to pass `ref` and `key`
569
569
  * to `createElement`, which is no longer necessary due to intersection
570
570
  * types. If you need to declare a props object before passing it to
571
571
  * `createElement` or a factory, use `ClassAttributes<T>`:
@@ -592,6 +592,9 @@ declare namespace React {
592
592
  interface SVGProps<T> extends SVGAttributes<T>, ClassAttributes<T> {
593
593
  }
594
594
 
595
+ interface SVGLineElementAttributes<T> extends React.SVGProps<T> {}
596
+ interface SVGTextElementAttributes<T> extends React.SVGProps<T> {}
597
+
595
598
  interface DOMAttributes<T> {
596
599
  children?: ReactNode | undefined;
597
600
  dangerouslySetInnerHTML?: {
@@ -3627,9 +3630,23 @@ declare namespace React {
3627
3630
  item(index: number): Touch;
3628
3631
  identifiedTouch(identifier: number): Touch;
3629
3632
  }
3633
+
3634
+ namespace JSX {
3635
+ interface Element extends GlobalJSXElement {}
3636
+ interface ElementClass extends GlobalJSXElementClass {}
3637
+ interface ElementAttributesProperty extends GlobalJSXElementAttributesProperty {}
3638
+ interface ElementChildrenAttribute extends GlobalJSXElementChildrenAttribute {}
3639
+
3640
+ interface IntrinsicAttributes extends GlobalJSXIntrinsicAttributes {}
3641
+ interface IntrinsicClassAttributes<T> extends GlobalJSXIntrinsicClassAttributes<T> {}
3642
+ interface IntrinsicElements extends GlobalJSXIntrinsicElements {}
3643
+ }
3630
3644
  }
3631
3645
 
3632
3646
  declare global {
3647
+ /**
3648
+ * @deprecated Use `React.JSX` instead of the global `JSX` namespace.
3649
+ */
3633
3650
  namespace JSX {
3634
3651
  interface Element extends React.ReactElement { }
3635
3652
  interface ElementClass extends React.Component<any> {
@@ -3798,7 +3815,7 @@ declare global {
3798
3815
  foreignObject: React.SVGProps<SVGForeignObjectElement>;
3799
3816
  g: React.SVGProps<SVGGElement>;
3800
3817
  image: React.SVGProps<SVGImageElement>;
3801
- line: React.SVGProps<SVGLineElement>;
3818
+ line: React.SVGLineElementAttributes<SVGLineElement>;
3802
3819
  linearGradient: React.SVGProps<SVGLinearGradientElement>;
3803
3820
  marker: React.SVGProps<SVGMarkerElement>;
3804
3821
  mask: React.SVGProps<SVGMaskElement>;
@@ -3812,7 +3829,7 @@ declare global {
3812
3829
  stop: React.SVGProps<SVGStopElement>;
3813
3830
  switch: React.SVGProps<SVGSwitchElement>;
3814
3831
  symbol: React.SVGProps<SVGSymbolElement>;
3815
- text: React.SVGProps<SVGTextElement>;
3832
+ text: React.SVGTextElementAttributes<SVGTextElement>;
3816
3833
  textPath: React.SVGProps<SVGTextPathElement>;
3817
3834
  tspan: React.SVGProps<SVGTSpanElement>;
3818
3835
  use: React.SVGProps<SVGUseElement>;
@@ -3820,3 +3837,16 @@ declare global {
3820
3837
  }
3821
3838
  }
3822
3839
  }
3840
+
3841
+ // React.JSX needs to point to global.JSX to keep global module augmentations intact.
3842
+ // But we can't access global.JSX so we need to create these aliases instead.
3843
+ // Once the global JSX namespace will be removed we replace React.JSX with the contents of global.JSX
3844
+ interface GlobalJSXElement extends JSX.Element {}
3845
+ interface GlobalJSXElementClass extends JSX.ElementClass {}
3846
+ interface GlobalJSXElementAttributesProperty extends JSX.ElementAttributesProperty {}
3847
+ interface GlobalJSXElementChildrenAttribute extends JSX.ElementChildrenAttribute {}
3848
+
3849
+ interface GlobalJSXIntrinsicAttributes extends JSX.IntrinsicAttributes {}
3850
+ interface GlobalJSXIntrinsicClassAttributes<T> extends JSX.IntrinsicClassAttributes<T> {}
3851
+
3852
+ interface GlobalJSXIntrinsicElements extends JSX.IntrinsicElements {}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "15.7.16",
3
+ "version": "15.7.18",
4
4
  "description": "TypeScript definitions for React",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "scripts": {},
64
64
  "dependencies": {},
65
- "typesPublisherContentHash": "898c70423be392702d34abbb63b380b83c91a4a0b2b74eb5b2b987cb9d402f3b",
65
+ "typesPublisherContentHash": "d65bae72bbd4a05ebd40a3ab004e0f96ed845981578007b00f04ddf1d6763ca7",
66
66
  "typeScriptVersion": "4.3",
67
67
  "exports": {
68
68
  ".": {