@types/react 16.9.19 → 16.9.23

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.
Files changed (3) hide show
  1. react/README.md +2 -2
  2. react/index.d.ts +24 -7
  3. react/package.json +7 -2
react/README.md CHANGED
@@ -8,9 +8,9 @@ This package contains type definitions for React (http://facebook.github.io/reac
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 22 Jan 2020 17:30:26 GMT
11
+ * Last updated: Tue, 25 Feb 2020 19:09:02 GMT
12
12
  * Dependencies: [@types/csstype](https://npmjs.com/package/@types/csstype), [@types/prop-types](https://npmjs.com/package/@types/prop-types)
13
13
  * Global values: `React`
14
14
 
15
15
  # Credits
16
- These definitions were written by Asana (https://asana.com), AssureSign (http://www.assuresign.com), Microsoft (https://microsoft.com), John Reilly (https://github.com/johnnyreilly), Benoit Benezech (https://github.com/bbenezech), Patricio Zavolinsky (https://github.com/pzavolinsky), Digiguru (https://github.com/digiguru), Eric Anderson (https://github.com/ericanderson), Dovydas Navickas (https://github.com/DovydasNavickas), Josh Rutherford (https://github.com/theruther4d), Guilherme Hübner (https://github.com/guilhermehubner), Ferdy Budhidharma (https://github.com/ferdaber), Johann Rakotoharisoa (https://github.com/jrakotoharisoa), Olivier Pascal (https://github.com/pascaloliv), Martin Hochel (https://github.com/hotell), Frank Li (https://github.com/franklixuefei), Jessica Franco (https://github.com/Jessidhia), Saransh Kataria (https://github.com/saranshkataria), Kanitkorn Sujautra (https://github.com/lukyth), Sebastian Silbermann (https://github.com/eps1lon), Kyle Scully (https://github.com/zieka), and Cong Zhang (https://github.com/dancerphil).
16
+ These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), [John Reilly](https://github.com/johnnyreilly), [Benoit Benezech](https://github.com/bbenezech), [Patricio Zavolinsky](https://github.com/pzavolinsky), [Digiguru](https://github.com/digiguru), [Eric Anderson](https://github.com/ericanderson), [Dovydas Navickas](https://github.com/DovydasNavickas), [Josh Rutherford](https://github.com/theruther4d), [Guilherme Hübner](https://github.com/guilhermehubner), [Ferdy Budhidharma](https://github.com/ferdaber), [Johann Rakotoharisoa](https://github.com/jrakotoharisoa), [Olivier Pascal](https://github.com/pascaloliv), [Martin Hochel](https://github.com/hotell), [Frank Li](https://github.com/franklixuefei), [Jessica Franco](https://github.com/Jessidhia), [Saransh Kataria](https://github.com/saranshkataria), [Kanitkorn Sujautra](https://github.com/lukyth), [Sebastian Silbermann](https://github.com/eps1lon), [Kyle Scully](https://github.com/zieka), [Cong Zhang](https://github.com/dancerphil), and [Dimitri Mitropoulos](https://github.com/dimitropoulos).
react/index.d.ts CHANGED
@@ -22,6 +22,7 @@
22
22
  // Sebastian Silbermann <https://github.com/eps1lon>
23
23
  // Kyle Scully <https://github.com/zieka>
24
24
  // Cong Zhang <https://github.com/dancerphil>
25
+ // Dimitri Mitropoulos <https://github.com/dimitropoulos>
25
26
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
26
27
  // TypeScript Version: 2.8
27
28
 
@@ -86,8 +87,8 @@ declare namespace React {
86
87
  interface RefObject<T> {
87
88
  readonly current: T | null;
88
89
  }
89
-
90
- type Ref<T> = { bivarianceHack(instance: T | null): void }["bivarianceHack"] | RefObject<T> | null;
90
+ type RefCallback<T> = { bivarianceHack(instance: T | null): void }["bivarianceHack"];
91
+ type Ref<T> = RefCallback<T> | RefObject<T> | null;
91
92
  type LegacyRef<T> = string | Ref<T>;
92
93
 
93
94
  type ComponentState = any;
@@ -522,14 +523,27 @@ declare namespace React {
522
523
  displayName?: string;
523
524
  }
524
525
 
525
- interface RefForwardingComponent<T, P = {}> {
526
+ interface ForwardRefRenderFunction<T, P = {}> {
526
527
  (props: PropsWithChildren<P>, ref: Ref<T>): ReactElement | null;
527
- propTypes?: WeakValidationMap<P>;
528
- contextTypes?: ValidationMap<any>;
529
- defaultProps?: Partial<P>;
530
528
  displayName?: string;
529
+ // explicit rejected with `never` required due to
530
+ // https://github.com/microsoft/TypeScript/issues/36826
531
+ /**
532
+ * defaultProps are not supported on render functions
533
+ */
534
+ defaultProps?: never;
535
+ /**
536
+ * propTypes are not supported on render functions
537
+ */
538
+ propTypes?: never;
531
539
  }
532
540
 
541
+ /**
542
+ * @deprecated Use ForwardRefRenderingFunction. forwardRef doesn't accept a
543
+ * "real" component.
544
+ */
545
+ interface RefForwardingComponent <T, P = {}> extends ForwardRefRenderFunction<T, P> {}
546
+
533
547
  interface ComponentClass<P = {}, S = ComponentState> extends StaticLifecycle<P, S> {
534
548
  new (props: P, context?: any): Component<P, S>;
535
549
  propTypes?: WeakValidationMap<P>;
@@ -750,7 +764,7 @@ declare namespace React {
750
764
  propTypes?: WeakValidationMap<P>;
751
765
  }
752
766
 
753
- function forwardRef<T, P = {}>(Component: RefForwardingComponent<T, P>): ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
767
+ function forwardRef<T, P = {}>(render: ForwardRefRenderFunction<T, P>): ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
754
768
 
755
769
  /** Ensures that the props do not include ref at all */
756
770
  type PropsWithoutRef<P> =
@@ -1996,6 +2010,8 @@ declare namespace React {
1996
2010
  crossOrigin?: "anonymous" | "use-credentials" | "";
1997
2011
  decoding?: "async" | "auto" | "sync";
1998
2012
  height?: number | string;
2013
+ loading?: "eager" | "lazy";
2014
+ referrerPolicy?: "no-referrer" | "origin" | "unsafe-url";
1999
2015
  sizes?: string;
2000
2016
  src?: string;
2001
2017
  srcSet?: string;
@@ -2431,6 +2447,7 @@ declare namespace React {
2431
2447
  overlineThickness?: number | string;
2432
2448
  paintOrder?: number | string;
2433
2449
  panose1?: number | string;
2450
+ path?: string;
2434
2451
  pathLength?: number | string;
2435
2452
  patternContentUnits?: string;
2436
2453
  patternTransform?: number | string;
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "16.9.19",
3
+ "version": "16.9.23",
4
4
  "description": "TypeScript definitions for React",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -110,6 +110,11 @@
110
110
  "name": "Cong Zhang",
111
111
  "url": "https://github.com/dancerphil",
112
112
  "githubUsername": "dancerphil"
113
+ },
114
+ {
115
+ "name": "Dimitri Mitropoulos",
116
+ "url": "https://github.com/dimitropoulos",
117
+ "githubUsername": "dimitropoulos"
113
118
  }
114
119
  ],
115
120
  "main": "",
@@ -124,6 +129,6 @@
124
129
  "@types/prop-types": "*",
125
130
  "csstype": "^2.2.0"
126
131
  },
127
- "typesPublisherContentHash": "2578868eff06740bf655198aa831dea1749873f5cbd0e1218e2cc15a6e7e8e6e",
132
+ "typesPublisherContentHash": "d93df1f343863823e11bbdb83ad4252bf36299ffa581619248621a5c0a518cea",
128
133
  "typeScriptVersion": "2.8"
129
134
  }