@types/react 16.9.49 → 16.9.53

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 +1 -1
  2. react/index.d.ts +26 -7
  3. react/package.json +3 -3
react/README.md CHANGED
@@ -8,7 +8,7 @@ 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: Mon, 31 Aug 2020 16:41:48 GMT
11
+ * Last updated: Fri, 16 Oct 2020 18:53:00 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
 
react/index.d.ts CHANGED
@@ -475,12 +475,12 @@ declare namespace React {
475
475
  // TODO (TypeScript 3.0): unknown
476
476
  context: any;
477
477
 
478
- constructor(props: Readonly<P>);
478
+ constructor(props: Readonly<P> | P);
479
479
  /**
480
480
  * @deprecated
481
481
  * @see https://reactjs.org/docs/legacy-context.html
482
482
  */
483
- constructor(props: P, context?: any);
483
+ constructor(props: P, context: any);
484
484
 
485
485
  // We MUST keep setState() as a unified signature because it allows proper checking of the method return type.
486
486
  // See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365#issuecomment-351013257
@@ -915,7 +915,7 @@ declare namespace React {
915
915
  * @see https://reactjs.org/docs/hooks-reference.html#usestate
916
916
  */
917
917
  function useState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];
918
- // convenience overload when first argument is ommitted
918
+ // convenience overload when first argument is omitted
919
919
  /**
920
920
  * Returns a stateful value, and a function to update it.
921
921
  *
@@ -966,7 +966,7 @@ declare namespace React {
966
966
  * @see https://reactjs.org/docs/hooks-reference.html#usereducer
967
967
  */
968
968
  // overload where "I" may be a subset of ReducerState<R>; used to provide autocompletion.
969
- // If "I" matches ReducerState<R> exactly then the last overload will allow initializer to be ommitted.
969
+ // If "I" matches ReducerState<R> exactly then the last overload will allow initializer to be omitted.
970
970
  // the last overload effectively behaves as if the identity function (x => x) is the initializer.
971
971
  function useReducer<R extends Reducer<any, any>, I>(
972
972
  reducer: R,
@@ -1921,6 +1921,17 @@ declare namespace React {
1921
1921
  wrap?: string;
1922
1922
  }
1923
1923
 
1924
+ type HTMLAttributeReferrerPolicy =
1925
+ | ''
1926
+ | 'no-referrer'
1927
+ | 'no-referrer-when-downgrade'
1928
+ | 'origin'
1929
+ | 'origin-when-cross-origin'
1930
+ | 'same-origin'
1931
+ | 'strict-origin'
1932
+ | 'strict-origin-when-cross-origin'
1933
+ | 'unsafe-url';
1934
+
1924
1935
  interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
1925
1936
  download?: any;
1926
1937
  href?: string;
@@ -1930,7 +1941,7 @@ declare namespace React {
1930
1941
  rel?: string;
1931
1942
  target?: string;
1932
1943
  type?: string;
1933
- referrerPolicy?: string;
1944
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
1934
1945
  }
1935
1946
 
1936
1947
  // tslint:disable-next-line:no-empty-interface
@@ -1943,6 +1954,7 @@ declare namespace React {
1943
1954
  href?: string;
1944
1955
  hrefLang?: string;
1945
1956
  media?: string;
1957
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
1946
1958
  rel?: string;
1947
1959
  shape?: string;
1948
1960
  target?: string;
@@ -2035,14 +2047,18 @@ declare namespace React {
2035
2047
  allow?: string;
2036
2048
  allowFullScreen?: boolean;
2037
2049
  allowTransparency?: boolean;
2050
+ /** @deprecated */
2038
2051
  frameBorder?: number | string;
2039
2052
  height?: number | string;
2040
2053
  loading?: "eager" | "lazy";
2054
+ /** @deprecated */
2041
2055
  marginHeight?: number;
2056
+ /** @deprecated */
2042
2057
  marginWidth?: number;
2043
2058
  name?: string;
2044
- referrerPolicy?: string;
2059
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
2045
2060
  sandbox?: string;
2061
+ /** @deprecated */
2046
2062
  scrolling?: string;
2047
2063
  seamless?: boolean;
2048
2064
  src?: string;
@@ -2056,7 +2072,7 @@ declare namespace React {
2056
2072
  decoding?: "async" | "auto" | "sync";
2057
2073
  height?: number | string;
2058
2074
  loading?: "eager" | "lazy";
2059
- referrerPolicy?: "no-referrer" | "origin" | "unsafe-url";
2075
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
2060
2076
  sizes?: string;
2061
2077
  src?: string;
2062
2078
  srcSet?: string;
@@ -2132,6 +2148,7 @@ declare namespace React {
2132
2148
  hrefLang?: string;
2133
2149
  integrity?: string;
2134
2150
  media?: string;
2151
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
2135
2152
  rel?: string;
2136
2153
  sizes?: string;
2137
2154
  type?: string;
@@ -2232,12 +2249,14 @@ declare namespace React {
2232
2249
 
2233
2250
  interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
2234
2251
  async?: boolean;
2252
+ /** @deprecated */
2235
2253
  charSet?: string;
2236
2254
  crossOrigin?: string;
2237
2255
  defer?: boolean;
2238
2256
  integrity?: string;
2239
2257
  noModule?: boolean;
2240
2258
  nonce?: string;
2259
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
2241
2260
  src?: string;
2242
2261
  type?: string;
2243
2262
  }
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "16.9.49",
3
+ "version": "16.9.53",
4
4
  "description": "TypeScript definitions for React",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -144,6 +144,6 @@
144
144
  "@types/prop-types": "*",
145
145
  "csstype": "^3.0.2"
146
146
  },
147
- "typesPublisherContentHash": "b034149a5cda0dd4cd3ee0abc4fec00bfcaf5a2d7d57ac0b8097f45735912dd3",
148
- "typeScriptVersion": "3.1"
147
+ "typesPublisherContentHash": "fbdf09eec3cc4faef382197965f55f7d41fe4a9c46a9867b5c3d9bf51cb0a35f",
148
+ "typeScriptVersion": "3.2"
149
149
  }