@types/react 16.9.17 → 16.9.21

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 +22 -7
  3. react/package.json +2 -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: Fri, 20 Dec 2019 07:06:52 GMT
11
+ * Last updated: Thu, 20 Feb 2020 00:44:06 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), and [Cong Zhang](https://github.com/dancerphil).
react/index.d.ts CHANGED
@@ -522,14 +522,27 @@ declare namespace React {
522
522
  displayName?: string;
523
523
  }
524
524
 
525
- interface RefForwardingComponent<T, P = {}> {
525
+ interface ForwardRefRenderFunction<T, P = {}> {
526
526
  (props: PropsWithChildren<P>, ref: Ref<T>): ReactElement | null;
527
- propTypes?: WeakValidationMap<P>;
528
- contextTypes?: ValidationMap<any>;
529
- defaultProps?: Partial<P>;
530
527
  displayName?: string;
528
+ // explicit rejected with `never` required due to
529
+ // https://github.com/microsoft/TypeScript/issues/36826
530
+ /**
531
+ * defaultProps are not supported on render functions
532
+ */
533
+ defaultProps?: never;
534
+ /**
535
+ * propTypes are not supported on render functions
536
+ */
537
+ propTypes?: never;
531
538
  }
532
539
 
540
+ /**
541
+ * @deprecated Use ForwardRefRenderingFunction. forwardRef doesn't accept a
542
+ * "real" component.
543
+ */
544
+ interface RefForwardingComponent <T, P = {}> extends ForwardRefRenderFunction<T, P> {}
545
+
533
546
  interface ComponentClass<P = {}, S = ComponentState> extends StaticLifecycle<P, S> {
534
547
  new (props: P, context?: any): Component<P, S>;
535
548
  propTypes?: WeakValidationMap<P>;
@@ -750,7 +763,7 @@ declare namespace React {
750
763
  propTypes?: WeakValidationMap<P>;
751
764
  }
752
765
 
753
- function forwardRef<T, P = {}>(Component: RefForwardingComponent<T, P>): ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
766
+ function forwardRef<T, P = {}>(render: ForwardRefRenderFunction<T, P>): ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
754
767
 
755
768
  /** Ensures that the props do not include ref at all */
756
769
  type PropsWithoutRef<P> =
@@ -1996,6 +2009,7 @@ declare namespace React {
1996
2009
  crossOrigin?: "anonymous" | "use-credentials" | "";
1997
2010
  decoding?: "async" | "auto" | "sync";
1998
2011
  height?: number | string;
2012
+ loading?: "eager" | "lazy";
1999
2013
  sizes?: string;
2000
2014
  src?: string;
2001
2015
  srcSet?: string;
@@ -2788,11 +2802,12 @@ declare namespace React {
2788
2802
  // ----------------------------------------------------------------------
2789
2803
 
2790
2804
  interface ReactChildren {
2791
- map<T, C>(children: C | C[], fn: (child: C, index: number) => T): T[];
2805
+ map<T, C>(children: C | C[], fn: (child: C, index: number) => T):
2806
+ C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
2792
2807
  forEach<C>(children: C | C[], fn: (child: C, index: number) => void): void;
2793
2808
  count(children: any): number;
2794
2809
  only<C>(children: C): C extends any[] ? never : C;
2795
- toArray<C>(children: C | C[]): C[];
2810
+ toArray(children: ReactNode | ReactNode[]): Array<Exclude<ReactNode, boolean | null | undefined>>;
2796
2811
  }
2797
2812
 
2798
2813
  //
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "16.9.17",
3
+ "version": "16.9.21",
4
4
  "description": "TypeScript definitions for React",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -124,6 +124,6 @@
124
124
  "@types/prop-types": "*",
125
125
  "csstype": "^2.2.0"
126
126
  },
127
- "typesPublisherContentHash": "33aa32e48fbbb170b424b0f0b5aeb7a6d5107933a14e081994a389904942163c",
127
+ "typesPublisherContentHash": "2995363f213d73aa3dd84369e03d4ce7c0eaf4486c859ad0083de971b9d85b02",
128
128
  "typeScriptVersion": "2.8"
129
129
  }