@types/react 16.9.53 → 16.14.0

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: Fri, 16 Oct 2020 18:53:00 GMT
11
+ * Last updated: Fri, 20 Nov 2020 13:41:08 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
@@ -1,4 +1,4 @@
1
- // Type definitions for React 16.9
1
+ // Type definitions for React 16.14
2
2
  // Project: http://facebook.github.io/react/
3
3
  // Definitions by: Asana <https://asana.com>
4
4
  // AssureSign <http://www.assuresign.com>
@@ -176,7 +176,6 @@ declare namespace React {
176
176
  }
177
177
 
178
178
  // ReactHTML for ReactHTMLElement
179
- // tslint:disable-next-line:no-empty-interface
180
179
  interface ReactHTMLElement<T extends HTMLElement> extends DetailedReactHTMLElement<AllHTMLAttributes<T>, T> { }
181
180
 
182
181
  interface DetailedReactHTMLElement<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMElement<P, T> {
@@ -215,7 +214,6 @@ declare namespace React {
215
214
  type DOMFactory<P extends DOMAttributes<T>, T extends Element> =
216
215
  (props?: ClassAttributes<T> & P | null, ...children: ReactNode[]) => DOMElement<P, T>;
217
216
 
218
- // tslint:disable-next-line:no-empty-interface
219
217
  interface HTMLFactory<T extends HTMLElement> extends DetailedHTMLFactory<AllHTMLAttributes<T>, T> {}
220
218
 
221
219
  interface DetailedHTMLFactory<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMFactory<P, T> {
@@ -431,7 +429,6 @@ declare namespace React {
431
429
  type ReactInstance = Component<any> | Element;
432
430
 
433
431
  // Base component for plain JS classes
434
- // tslint:disable-next-line:no-empty-interface
435
432
  interface Component<P = {}, S = {}, SS = any> extends ComponentLifecycle<P, S, SS> { }
436
433
  class Component<P, S> {
437
434
  // tslint won't let me format the sample code in a way that vscode likes it :(
@@ -561,8 +558,10 @@ declare namespace React {
561
558
  displayName?: string;
562
559
  }
563
560
 
561
+ type ForwardedRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null;
562
+
564
563
  interface ForwardRefRenderFunction<T, P = {}> {
565
- (props: PropsWithChildren<P>, ref: ((instance: T | null) => void) | MutableRefObject<T | null> | null): ReactElement | null;
564
+ (props: PropsWithChildren<P>, ref: ForwardedRef<T>): ReactElement | null;
566
565
  displayName?: string;
567
566
  // explicit rejected with `never` required due to
568
567
  // https://github.com/microsoft/TypeScript/issues/36826
@@ -1196,7 +1195,6 @@ declare namespace React {
1196
1195
  target: EventTarget & T;
1197
1196
  }
1198
1197
 
1199
- // tslint:disable-next-line:no-empty-interface
1200
1198
  interface FormEvent<T = Element> extends SyntheticEvent<T> {
1201
1199
  }
1202
1200
 
@@ -1944,7 +1942,6 @@ declare namespace React {
1944
1942
  referrerPolicy?: HTMLAttributeReferrerPolicy;
1945
1943
  }
1946
1944
 
1947
- // tslint:disable-next-line:no-empty-interface
1948
1945
  interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {}
1949
1946
 
1950
1947
  interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -2969,7 +2966,6 @@ type ReactManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps
2969
2966
 
2970
2967
  declare global {
2971
2968
  namespace JSX {
2972
- // tslint:disable-next-line:no-empty-interface
2973
2969
  interface Element extends React.ReactElement<any, any> { }
2974
2970
  interface ElementClass extends React.Component<any> {
2975
2971
  render(): React.ReactNode;
@@ -2985,9 +2981,7 @@ declare global {
2985
2981
  : ReactManagedAttributes<T, P>
2986
2982
  : ReactManagedAttributes<C, P>;
2987
2983
 
2988
- // tslint:disable-next-line:no-empty-interface
2989
2984
  interface IntrinsicAttributes extends React.Attributes { }
2990
- // tslint:disable-next-line:no-empty-interface
2991
2985
  interface IntrinsicClassAttributes<T> extends React.ClassAttributes<T> { }
2992
2986
 
2993
2987
  interface IntrinsicElements {
@@ -0,0 +1,2 @@
1
+ // Expose `JSX` namespace in `global` namespace
2
+ import './';
react/jsx-runtime.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ // Expose `JSX` namespace in `global` namespace
2
+ import './';
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "16.9.53",
3
+ "version": "16.14.0",
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": "fbdf09eec3cc4faef382197965f55f7d41fe4a9c46a9867b5c3d9bf51cb0a35f",
148
- "typeScriptVersion": "3.2"
147
+ "typesPublisherContentHash": "eadbd9474e09134894b99ffaba3a199ff7206e48438f729d368c3a01d8fd5512",
148
+ "typeScriptVersion": "3.3"
149
149
  }