@types/react 16.9.52 → 16.9.56
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 +1 -1
- react/experimental.d.ts +18 -17
- react/index.d.ts +20 -12
- react/package.json +2 -2
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:
|
11
|
+
* Last updated: Fri, 06 Nov 2020 08:32:07 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
|
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
|
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
@@ -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:
|
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
|
|
@@ -1921,6 +1919,17 @@ declare namespace React {
|
|
1921
1919
|
wrap?: string;
|
1922
1920
|
}
|
1923
1921
|
|
1922
|
+
type HTMLAttributeReferrerPolicy =
|
1923
|
+
| ''
|
1924
|
+
| 'no-referrer'
|
1925
|
+
| 'no-referrer-when-downgrade'
|
1926
|
+
| 'origin'
|
1927
|
+
| 'origin-when-cross-origin'
|
1928
|
+
| 'same-origin'
|
1929
|
+
| 'strict-origin'
|
1930
|
+
| 'strict-origin-when-cross-origin'
|
1931
|
+
| 'unsafe-url';
|
1932
|
+
|
1924
1933
|
interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
|
1925
1934
|
download?: any;
|
1926
1935
|
href?: string;
|
@@ -1930,10 +1939,9 @@ declare namespace React {
|
|
1930
1939
|
rel?: string;
|
1931
1940
|
target?: string;
|
1932
1941
|
type?: string;
|
1933
|
-
referrerPolicy?:
|
1942
|
+
referrerPolicy?: HTMLAttributeReferrerPolicy;
|
1934
1943
|
}
|
1935
1944
|
|
1936
|
-
// tslint:disable-next-line:no-empty-interface
|
1937
1945
|
interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {}
|
1938
1946
|
|
1939
1947
|
interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -1943,6 +1951,7 @@ declare namespace React {
|
|
1943
1951
|
href?: string;
|
1944
1952
|
hrefLang?: string;
|
1945
1953
|
media?: string;
|
1954
|
+
referrerPolicy?: HTMLAttributeReferrerPolicy;
|
1946
1955
|
rel?: string;
|
1947
1956
|
shape?: string;
|
1948
1957
|
target?: string;
|
@@ -2044,7 +2053,7 @@ declare namespace React {
|
|
2044
2053
|
/** @deprecated */
|
2045
2054
|
marginWidth?: number;
|
2046
2055
|
name?: string;
|
2047
|
-
referrerPolicy?:
|
2056
|
+
referrerPolicy?: HTMLAttributeReferrerPolicy;
|
2048
2057
|
sandbox?: string;
|
2049
2058
|
/** @deprecated */
|
2050
2059
|
scrolling?: string;
|
@@ -2060,7 +2069,7 @@ declare namespace React {
|
|
2060
2069
|
decoding?: "async" | "auto" | "sync";
|
2061
2070
|
height?: number | string;
|
2062
2071
|
loading?: "eager" | "lazy";
|
2063
|
-
referrerPolicy?:
|
2072
|
+
referrerPolicy?: HTMLAttributeReferrerPolicy;
|
2064
2073
|
sizes?: string;
|
2065
2074
|
src?: string;
|
2066
2075
|
srcSet?: string;
|
@@ -2136,6 +2145,7 @@ declare namespace React {
|
|
2136
2145
|
hrefLang?: string;
|
2137
2146
|
integrity?: string;
|
2138
2147
|
media?: string;
|
2148
|
+
referrerPolicy?: HTMLAttributeReferrerPolicy;
|
2139
2149
|
rel?: string;
|
2140
2150
|
sizes?: string;
|
2141
2151
|
type?: string;
|
@@ -2243,6 +2253,7 @@ declare namespace React {
|
|
2243
2253
|
integrity?: string;
|
2244
2254
|
noModule?: boolean;
|
2245
2255
|
nonce?: string;
|
2256
|
+
referrerPolicy?: HTMLAttributeReferrerPolicy;
|
2246
2257
|
src?: string;
|
2247
2258
|
type?: string;
|
2248
2259
|
}
|
@@ -2955,7 +2966,6 @@ type ReactManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps
|
|
2955
2966
|
|
2956
2967
|
declare global {
|
2957
2968
|
namespace JSX {
|
2958
|
-
// tslint:disable-next-line:no-empty-interface
|
2959
2969
|
interface Element extends React.ReactElement<any, any> { }
|
2960
2970
|
interface ElementClass extends React.Component<any> {
|
2961
2971
|
render(): React.ReactNode;
|
@@ -2971,9 +2981,7 @@ declare global {
|
|
2971
2981
|
: ReactManagedAttributes<T, P>
|
2972
2982
|
: ReactManagedAttributes<C, P>;
|
2973
2983
|
|
2974
|
-
// tslint:disable-next-line:no-empty-interface
|
2975
2984
|
interface IntrinsicAttributes extends React.Attributes { }
|
2976
|
-
// tslint:disable-next-line:no-empty-interface
|
2977
2985
|
interface IntrinsicClassAttributes<T> extends React.ClassAttributes<T> { }
|
2978
2986
|
|
2979
2987
|
interface IntrinsicElements {
|
react/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "16.9.
|
3
|
+
"version": "16.9.56",
|
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": "
|
147
|
+
"typesPublisherContentHash": "798794c43c5b79f66e0591a278096a90cfd06e875df950c18d74b907d73d7c62",
|
148
148
|
"typeScriptVersion": "3.2"
|
149
149
|
}
|