@types/react 16.8.4 → 16.8.8
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 +15 -8
- react/package.json +7 -6
react/README.md
CHANGED
@@ -8,9 +8,9 @@ This package contains type definitions for React ( http://facebook.github.io/rea
|
|
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: Tue, 12 Mar 2019 20:08:44 GMT
|
12
12
|
* Dependencies: @types/csstype, @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>, Tanguy Krotoff <https://github.com/tkrotoff>, Dovydas Navickas <https://github.com/DovydasNavickas>, Stéphane Goetz <https://github.com/onigoetz>, 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>, Paul Sherman <https://github.com/pshrmn>,
|
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>, Tanguy Krotoff <https://github.com/tkrotoff>, Dovydas Navickas <https://github.com/DovydasNavickas>, Stéphane Goetz <https://github.com/onigoetz>, 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>, Paul Sherman <https://github.com/pshrmn>, Saransh Kataria <https://github.com/saranshkataria>.
|
react/index.d.ts
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
// Frank Li <https://github.com/franklixuefei>
|
21
21
|
// Jessica Franco <https://github.com/Jessidhia>
|
22
22
|
// Paul Sherman <https://github.com/pshrmn>
|
23
|
-
//
|
23
|
+
// Saransh Kataria <https://github.com/saranshkataria>
|
24
24
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
25
25
|
// TypeScript Version: 2.8
|
26
26
|
|
@@ -51,11 +51,15 @@ declare namespace React {
|
|
51
51
|
// React Elements
|
52
52
|
// ----------------------------------------------------------------------
|
53
53
|
|
54
|
-
type
|
54
|
+
type ElementType<P = any> =
|
55
55
|
{
|
56
56
|
[K in keyof JSX.IntrinsicElements]: P extends JSX.IntrinsicElements[K] ? K : never
|
57
57
|
}[keyof JSX.IntrinsicElements] |
|
58
58
|
ComponentType<P>;
|
59
|
+
/**
|
60
|
+
* @deprecated Please use `ElementType`
|
61
|
+
*/
|
62
|
+
type ReactType<P = any> = ElementType<P>;
|
59
63
|
type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;
|
60
64
|
|
61
65
|
type JSXElementConstructor<P> =
|
@@ -422,7 +426,7 @@ declare namespace React {
|
|
422
426
|
// always pass children as variadic arguments to `createElement`.
|
423
427
|
// In the future, if we can define its call signature conditionally
|
424
428
|
// on the existence of `children` in `P`, then we should remove this.
|
425
|
-
readonly props: Readonly<{ children?: ReactNode }
|
429
|
+
readonly props: Readonly<P> & Readonly<{ children?: ReactNode }>;
|
426
430
|
state: Readonly<S>;
|
427
431
|
/**
|
428
432
|
* @deprecated
|
@@ -468,7 +472,7 @@ declare namespace React {
|
|
468
472
|
type FC<P = {}> = FunctionComponent<P>;
|
469
473
|
|
470
474
|
interface FunctionComponent<P = {}> {
|
471
|
-
(props: P
|
475
|
+
(props: PropsWithChildren<P>, context?: any): ReactElement | null;
|
472
476
|
propTypes?: WeakValidationMap<P>;
|
473
477
|
contextTypes?: ValidationMap<any>;
|
474
478
|
defaultProps?: Partial<P>;
|
@@ -476,7 +480,7 @@ declare namespace React {
|
|
476
480
|
}
|
477
481
|
|
478
482
|
interface RefForwardingComponent<T, P = {}> {
|
479
|
-
(props: P
|
483
|
+
(props: PropsWithChildren<P>, ref: Ref<T>): ReactElement | null;
|
480
484
|
propTypes?: WeakValidationMap<P>;
|
481
485
|
contextTypes?: ValidationMap<any>;
|
482
486
|
defaultProps?: Partial<P>;
|
@@ -722,6 +726,8 @@ declare namespace React {
|
|
722
726
|
: P
|
723
727
|
: P;
|
724
728
|
|
729
|
+
type PropsWithChildren<P> = P & { children?: ReactNode };
|
730
|
+
|
725
731
|
/**
|
726
732
|
* NOTE: prefer ComponentPropsWithRef, if the ref is forwarded,
|
727
733
|
* or ComponentPropsWithoutRef when refs are not supported.
|
@@ -732,11 +738,11 @@ declare namespace React {
|
|
732
738
|
: T extends keyof JSX.IntrinsicElements
|
733
739
|
? JSX.IntrinsicElements[T]
|
734
740
|
: {};
|
735
|
-
type ComponentPropsWithRef<T extends
|
741
|
+
type ComponentPropsWithRef<T extends ElementType> =
|
736
742
|
T extends ComponentClass<infer P>
|
737
743
|
? PropsWithoutRef<P> & RefAttributes<InstanceType<T>>
|
738
744
|
: PropsWithRef<ComponentProps<T>>;
|
739
|
-
type ComponentPropsWithoutRef<T extends
|
745
|
+
type ComponentPropsWithoutRef<T extends ElementType> =
|
740
746
|
PropsWithoutRef<ComponentProps<T>>;
|
741
747
|
|
742
748
|
// will show `Memo(${Component.displayName || Component.name})` in devtools by default,
|
@@ -747,7 +753,7 @@ declare namespace React {
|
|
747
753
|
|
748
754
|
function memo<P extends object>(
|
749
755
|
Component: SFC<P>,
|
750
|
-
propsAreEqual?: (prevProps: Readonly<P
|
756
|
+
propsAreEqual?: (prevProps: Readonly<PropsWithChildren<P>>, nextProps: Readonly<PropsWithChildren<P>>) => boolean
|
751
757
|
): NamedExoticComponent<P>;
|
752
758
|
function memo<T extends ComponentType<any>>(
|
753
759
|
Component: T,
|
@@ -1771,6 +1777,7 @@ declare namespace React {
|
|
1771
1777
|
rel?: string;
|
1772
1778
|
target?: string;
|
1773
1779
|
type?: string;
|
1780
|
+
referrerPolicy?: string;
|
1774
1781
|
}
|
1775
1782
|
|
1776
1783
|
// tslint:disable-next-line:no-empty-interface
|
react/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "16.8.
|
3
|
+
"version": "16.8.8",
|
4
4
|
"description": "TypeScript definitions for React",
|
5
5
|
"license": "MIT",
|
6
6
|
"contributors": [
|
@@ -102,22 +102,23 @@
|
|
102
102
|
"githubUsername": "pshrmn"
|
103
103
|
},
|
104
104
|
{
|
105
|
-
"name": "
|
106
|
-
"url": "https://github.com/
|
107
|
-
"githubUsername": "
|
105
|
+
"name": "Saransh Kataria",
|
106
|
+
"url": "https://github.com/saranshkataria",
|
107
|
+
"githubUsername": "saranshkataria"
|
108
108
|
}
|
109
109
|
],
|
110
110
|
"main": "",
|
111
111
|
"types": "index",
|
112
112
|
"repository": {
|
113
113
|
"type": "git",
|
114
|
-
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
114
|
+
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
115
|
+
"directory": "types/react"
|
115
116
|
},
|
116
117
|
"scripts": {},
|
117
118
|
"dependencies": {
|
118
119
|
"@types/prop-types": "*",
|
119
120
|
"csstype": "^2.2.0"
|
120
121
|
},
|
121
|
-
"typesPublisherContentHash": "
|
122
|
+
"typesPublisherContentHash": "386852e03d03a72c56232271c53856dae71dd66836bb6998294f49cfdbe042e2",
|
122
123
|
"typeScriptVersion": "2.8"
|
123
124
|
}
|