@types/react 16.9.50 → 16.9.54

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 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: Thu, 01 Oct 2020 22:50:50 GMT
11
+ * Last updated: Tue, 27 Oct 2020 19:31:41 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/experimental.d.ts CHANGED
@@ -39,6 +39,15 @@ import React = require('.');
39
39
  export {};
40
40
 
41
41
  declare module '.' {
42
+ export interface SuspenseProps {
43
+ /**
44
+ * The presence of this prop indicates that the content is computationally expensive to render.
45
+ * In other words, the tree is CPU bound and not I/O bound (e.g. due to fetching data).
46
+ * @see {@link https://github.com/facebook/react/pull/19936}
47
+ */
48
+ unstable_expectedLoadTime?: number;
49
+ }
50
+
42
51
  export type SuspenseListRevealOrder = 'forwards' | 'backwards' | 'together';
43
52
  export type SuspenseListTailMode = 'collapsed' | 'hidden';
44
53
 
@@ -94,7 +103,7 @@ declare module '.' {
94
103
  */
95
104
  export const unstable_SuspenseList: ExoticComponent<SuspenseListProps>;
96
105
 
97
- export interface SuspenseConfig extends TimeoutConfig {
106
+ export interface SuspenseConfig {
98
107
  busyDelayMs?: number;
99
108
  busyMinDurationMs?: number;
100
109
  }
@@ -105,17 +114,6 @@ declare module '.' {
105
114
  config: SuspenseConfig | null | undefined,
106
115
  ): void;
107
116
 
108
- export interface TimeoutConfig {
109
- /**
110
- * This timeout (in milliseconds) tells React how long to wait before showing the next state.
111
- *
112
- * React will always try to use a shorter lag when network and device allows it.
113
- *
114
- * **NOTE: We recommend that you share Suspense Config between different modules.**
115
- */
116
- timeoutMs: number;
117
- }
118
-
119
117
  // must be synchronous
120
118
  export type TransitionFunction = () => void | undefined;
121
119
  // strange definition to allow vscode to show documentation on the invocation
@@ -139,11 +137,10 @@ declare module '.' {
139
137
  * A good example of this is a text input.
140
138
  *
141
139
  * @param value The value that is going to be deferred
142
- * @param config An optional object with `timeoutMs`
143
140
  *
144
141
  * @see https://reactjs.org/docs/concurrent-mode-reference.html#usedeferredvalue
145
142
  */
146
- export function unstable_useDeferredValue<T>(value: T, config?: TimeoutConfig | null): T;
143
+ export function unstable_useDeferredValue<T>(value: T): T;
147
144
 
148
145
  /**
149
146
  * Allows components to avoid undesirable loading states by waiting for content to load
@@ -164,9 +161,6 @@ declare module '.' {
164
161
  */
165
162
  export function unstable_useTransition(config?: SuspenseConfig | null): [TransitionStartFunction, boolean];
166
163
 
167
- /**
168
- * @private
169
- */
170
164
  const opaqueIdentifierBranding: unique symbol;
171
165
  /**
172
166
  * WARNING: Don't use this as a `string`.
@@ -185,4 +179,11 @@ declare module '.' {
185
179
  };
186
180
 
187
181
  export function unstable_useOpaqueIdentifier(): OpaqueIdentifier;
182
+
183
+ /**
184
+ * Similar to `useTransition` but allows uses where hooks are not available.
185
+ *
186
+ * @param callback A _synchronous_ function which causes state updates that can be deferred.
187
+ */
188
+ export function unstable_startTransition(scope: TransitionFunction): void;
188
189
  }
react/index.d.ts CHANGED
@@ -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;
@@ -2044,7 +2056,7 @@ declare namespace React {
2044
2056
  /** @deprecated */
2045
2057
  marginWidth?: number;
2046
2058
  name?: string;
2047
- referrerPolicy?: string;
2059
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
2048
2060
  sandbox?: string;
2049
2061
  /** @deprecated */
2050
2062
  scrolling?: string;
@@ -2060,7 +2072,7 @@ declare namespace React {
2060
2072
  decoding?: "async" | "auto" | "sync";
2061
2073
  height?: number | string;
2062
2074
  loading?: "eager" | "lazy";
2063
- referrerPolicy?: "no-referrer" | "origin" | "unsafe-url";
2075
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
2064
2076
  sizes?: string;
2065
2077
  src?: string;
2066
2078
  srcSet?: string;
@@ -2136,6 +2148,7 @@ declare namespace React {
2136
2148
  hrefLang?: string;
2137
2149
  integrity?: string;
2138
2150
  media?: string;
2151
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
2139
2152
  rel?: string;
2140
2153
  sizes?: string;
2141
2154
  type?: string;
@@ -2236,12 +2249,14 @@ declare namespace React {
2236
2249
 
2237
2250
  interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
2238
2251
  async?: boolean;
2252
+ /** @deprecated */
2239
2253
  charSet?: string;
2240
2254
  crossOrigin?: string;
2241
2255
  defer?: boolean;
2242
2256
  integrity?: string;
2243
2257
  noModule?: boolean;
2244
2258
  nonce?: string;
2259
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
2245
2260
  src?: string;
2246
2261
  type?: string;
2247
2262
  }
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "16.9.50",
3
+ "version": "16.9.54",
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": "d06fbb807d1c7e589941f818eb89a32451ca691636a2acf4c4220fe4a26b9db6",
147
+ "typesPublisherContentHash": "539f43006bbb332cbd1304887fab869e607905879da4a2b656a16e7325c91de8",
148
148
  "typeScriptVersion": "3.2"
149
149
  }