@types/react 16.9.18 → 16.9.22
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 +2 -2
- react/index.d.ts +22 -8
- 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:
|
11
|
+
* Last updated: Fri, 21 Feb 2020 19:32:29 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
|
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
|
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 = {}>(
|
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;
|
@@ -2431,6 +2445,7 @@ declare namespace React {
|
|
2431
2445
|
overlineThickness?: number | string;
|
2432
2446
|
paintOrder?: number | string;
|
2433
2447
|
panose1?: number | string;
|
2448
|
+
path?: string;
|
2434
2449
|
pathLength?: number | string;
|
2435
2450
|
patternContentUnits?: string;
|
2436
2451
|
patternTransform?: number | string;
|
@@ -2788,9 +2803,8 @@ declare namespace React {
|
|
2788
2803
|
// ----------------------------------------------------------------------
|
2789
2804
|
|
2790
2805
|
interface ReactChildren {
|
2791
|
-
map(children:
|
2792
|
-
|
2793
|
-
map<T, C>(children: C | C[], fn: (child: C, index: number) => T): Array<Exclude<T, boolean | null | undefined>>;
|
2806
|
+
map<T, C>(children: C | C[], fn: (child: C, index: number) => T):
|
2807
|
+
C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
|
2794
2808
|
forEach<C>(children: C | C[], fn: (child: C, index: number) => void): void;
|
2795
2809
|
count(children: any): number;
|
2796
2810
|
only<C>(children: C): C extends any[] ? never : C;
|
react/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "16.9.
|
3
|
+
"version": "16.9.22",
|
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": "
|
127
|
+
"typesPublisherContentHash": "51b3a96fc33feb4e1310180c0c3200d942c6d6d8a605e6d91f392dc0e81e9ebb",
|
128
128
|
"typeScriptVersion": "2.8"
|
129
129
|
}
|