@types/react 16.9.51 → 16.9.55
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 +18 -11
- 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: Wed, 28 Oct 2020 18:56:19 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 :(
|
@@ -1196,7 +1193,6 @@ declare namespace React {
|
|
1196
1193
|
target: EventTarget & T;
|
1197
1194
|
}
|
1198
1195
|
|
1199
|
-
// tslint:disable-next-line:no-empty-interface
|
1200
1196
|
interface FormEvent<T = Element> extends SyntheticEvent<T> {
|
1201
1197
|
}
|
1202
1198
|
|
@@ -1921,6 +1917,17 @@ declare namespace React {
|
|
1921
1917
|
wrap?: string;
|
1922
1918
|
}
|
1923
1919
|
|
1920
|
+
type HTMLAttributeReferrerPolicy =
|
1921
|
+
| ''
|
1922
|
+
| 'no-referrer'
|
1923
|
+
| 'no-referrer-when-downgrade'
|
1924
|
+
| 'origin'
|
1925
|
+
| 'origin-when-cross-origin'
|
1926
|
+
| 'same-origin'
|
1927
|
+
| 'strict-origin'
|
1928
|
+
| 'strict-origin-when-cross-origin'
|
1929
|
+
| 'unsafe-url';
|
1930
|
+
|
1924
1931
|
interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
|
1925
1932
|
download?: any;
|
1926
1933
|
href?: string;
|
@@ -1930,10 +1937,9 @@ declare namespace React {
|
|
1930
1937
|
rel?: string;
|
1931
1938
|
target?: string;
|
1932
1939
|
type?: string;
|
1933
|
-
referrerPolicy?:
|
1940
|
+
referrerPolicy?: HTMLAttributeReferrerPolicy;
|
1934
1941
|
}
|
1935
1942
|
|
1936
|
-
// tslint:disable-next-line:no-empty-interface
|
1937
1943
|
interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {}
|
1938
1944
|
|
1939
1945
|
interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -1943,6 +1949,7 @@ declare namespace React {
|
|
1943
1949
|
href?: string;
|
1944
1950
|
hrefLang?: string;
|
1945
1951
|
media?: string;
|
1952
|
+
referrerPolicy?: HTMLAttributeReferrerPolicy;
|
1946
1953
|
rel?: string;
|
1947
1954
|
shape?: string;
|
1948
1955
|
target?: string;
|
@@ -2044,7 +2051,7 @@ declare namespace React {
|
|
2044
2051
|
/** @deprecated */
|
2045
2052
|
marginWidth?: number;
|
2046
2053
|
name?: string;
|
2047
|
-
referrerPolicy?:
|
2054
|
+
referrerPolicy?: HTMLAttributeReferrerPolicy;
|
2048
2055
|
sandbox?: string;
|
2049
2056
|
/** @deprecated */
|
2050
2057
|
scrolling?: string;
|
@@ -2060,7 +2067,7 @@ declare namespace React {
|
|
2060
2067
|
decoding?: "async" | "auto" | "sync";
|
2061
2068
|
height?: number | string;
|
2062
2069
|
loading?: "eager" | "lazy";
|
2063
|
-
referrerPolicy?:
|
2070
|
+
referrerPolicy?: HTMLAttributeReferrerPolicy;
|
2064
2071
|
sizes?: string;
|
2065
2072
|
src?: string;
|
2066
2073
|
srcSet?: string;
|
@@ -2136,6 +2143,7 @@ declare namespace React {
|
|
2136
2143
|
hrefLang?: string;
|
2137
2144
|
integrity?: string;
|
2138
2145
|
media?: string;
|
2146
|
+
referrerPolicy?: HTMLAttributeReferrerPolicy;
|
2139
2147
|
rel?: string;
|
2140
2148
|
sizes?: string;
|
2141
2149
|
type?: string;
|
@@ -2236,12 +2244,14 @@ declare namespace React {
|
|
2236
2244
|
|
2237
2245
|
interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
|
2238
2246
|
async?: boolean;
|
2247
|
+
/** @deprecated */
|
2239
2248
|
charSet?: string;
|
2240
2249
|
crossOrigin?: string;
|
2241
2250
|
defer?: boolean;
|
2242
2251
|
integrity?: string;
|
2243
2252
|
noModule?: boolean;
|
2244
2253
|
nonce?: string;
|
2254
|
+
referrerPolicy?: HTMLAttributeReferrerPolicy;
|
2245
2255
|
src?: string;
|
2246
2256
|
type?: string;
|
2247
2257
|
}
|
@@ -2954,7 +2964,6 @@ type ReactManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps
|
|
2954
2964
|
|
2955
2965
|
declare global {
|
2956
2966
|
namespace JSX {
|
2957
|
-
// tslint:disable-next-line:no-empty-interface
|
2958
2967
|
interface Element extends React.ReactElement<any, any> { }
|
2959
2968
|
interface ElementClass extends React.Component<any> {
|
2960
2969
|
render(): React.ReactNode;
|
@@ -2970,9 +2979,7 @@ declare global {
|
|
2970
2979
|
: ReactManagedAttributes<T, P>
|
2971
2980
|
: ReactManagedAttributes<C, P>;
|
2972
2981
|
|
2973
|
-
// tslint:disable-next-line:no-empty-interface
|
2974
2982
|
interface IntrinsicAttributes extends React.Attributes { }
|
2975
|
-
// tslint:disable-next-line:no-empty-interface
|
2976
2983
|
interface IntrinsicClassAttributes<T> extends React.ClassAttributes<T> { }
|
2977
2984
|
|
2978
2985
|
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.55",
|
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": "aaafb411c8479f94d32139bfbd85aba32a4428942e2f24f96576263b7d78fcc3",
|
148
148
|
"typeScriptVersion": "3.2"
|
149
149
|
}
|