@types/react 17.0.53 → 17.0.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 v17.0/README.md +1 -1
- react v17.0/index.d.ts +35 -41
- react v17.0/package.json +3 -3
react v17.0/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/v17.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Tue, 28 Mar 2023 22:03:14 GMT
|
12
12
|
* Dependencies: [@types/csstype](https://npmjs.com/package/@types/csstype), [@types/prop-types](https://npmjs.com/package/@types/prop-types), [@types/scheduler](https://npmjs.com/package/@types/scheduler)
|
13
13
|
* Global values: `React`
|
14
14
|
|
react v17.0/index.d.ts
CHANGED
@@ -402,7 +402,7 @@ declare namespace React {
|
|
402
402
|
const version: string;
|
403
403
|
|
404
404
|
/**
|
405
|
-
* {@link https://
|
405
|
+
* {@link https://react.dev/reference/react/Profiler#onrender-callback Profiler API}}
|
406
406
|
*/
|
407
407
|
type ProfilerOnRenderCallback = (
|
408
408
|
id: string,
|
@@ -449,7 +449,7 @@ declare namespace React {
|
|
449
449
|
* }
|
450
450
|
* ```
|
451
451
|
*
|
452
|
-
* @see https://
|
452
|
+
* @see https://react.dev/reference/react/Component#static-contexttype
|
453
453
|
*/
|
454
454
|
static contextType?: Context<any> | undefined;
|
455
455
|
|
@@ -466,7 +466,7 @@ declare namespace React {
|
|
466
466
|
* declare context: React.ContextType<typeof MyContext>
|
467
467
|
* ```
|
468
468
|
*
|
469
|
-
* @see https://
|
469
|
+
* @see https://react.dev/reference/react/Component#context
|
470
470
|
*/
|
471
471
|
// TODO (TypeScript 3.0): unknown
|
472
472
|
context: any;
|
@@ -474,7 +474,7 @@ declare namespace React {
|
|
474
474
|
constructor(props: Readonly<P> | P);
|
475
475
|
/**
|
476
476
|
* @deprecated
|
477
|
-
* @see https://reactjs.org/docs/legacy-context.html
|
477
|
+
* @see https://legacy.reactjs.org/docs/legacy-context.html
|
478
478
|
*/
|
479
479
|
constructor(props: P, context: any);
|
480
480
|
|
@@ -498,7 +498,7 @@ declare namespace React {
|
|
498
498
|
state: Readonly<S>;
|
499
499
|
/**
|
500
500
|
* @deprecated
|
501
|
-
* https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs
|
501
|
+
* https://legacy.reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs
|
502
502
|
*/
|
503
503
|
refs: {
|
504
504
|
[key: string]: ReactInstance
|
@@ -690,8 +690,8 @@ declare namespace React {
|
|
690
690
|
* prevents this from being invoked.
|
691
691
|
*
|
692
692
|
* @deprecated 16.3, use componentDidMount or the constructor instead; will stop working in React 17
|
693
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
|
694
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
693
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
|
694
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
695
695
|
*/
|
696
696
|
componentWillMount?(): void;
|
697
697
|
/**
|
@@ -704,8 +704,8 @@ declare namespace React {
|
|
704
704
|
* prevents this from being invoked.
|
705
705
|
*
|
706
706
|
* @deprecated 16.3, use componentDidMount or the constructor instead
|
707
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
|
708
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
707
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
|
708
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
709
709
|
*/
|
710
710
|
UNSAFE_componentWillMount?(): void;
|
711
711
|
/**
|
@@ -719,8 +719,8 @@ declare namespace React {
|
|
719
719
|
* prevents this from being invoked.
|
720
720
|
*
|
721
721
|
* @deprecated 16.3, use static getDerivedStateFromProps instead; will stop working in React 17
|
722
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
|
723
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
722
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
|
723
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
724
724
|
*/
|
725
725
|
componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
|
726
726
|
/**
|
@@ -736,8 +736,8 @@ declare namespace React {
|
|
736
736
|
* prevents this from being invoked.
|
737
737
|
*
|
738
738
|
* @deprecated 16.3, use static getDerivedStateFromProps instead
|
739
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
|
740
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
739
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
|
740
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
741
741
|
*/
|
742
742
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
|
743
743
|
/**
|
@@ -749,8 +749,8 @@ declare namespace React {
|
|
749
749
|
* prevents this from being invoked.
|
750
750
|
*
|
751
751
|
* @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
|
752
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
|
753
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
752
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
|
753
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
754
754
|
*/
|
755
755
|
componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
|
756
756
|
/**
|
@@ -764,8 +764,8 @@ declare namespace React {
|
|
764
764
|
* prevents this from being invoked.
|
765
765
|
*
|
766
766
|
* @deprecated 16.3, use getSnapshotBeforeUpdate instead
|
767
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
|
768
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
767
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
|
768
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
769
769
|
*/
|
770
770
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
|
771
771
|
}
|
@@ -909,14 +909,14 @@ declare namespace React {
|
|
909
909
|
* context value, as given by the nearest context provider for the given context.
|
910
910
|
*
|
911
911
|
* @version 16.8.0
|
912
|
-
* @see https://
|
912
|
+
* @see https://react.dev/reference/react/useContext
|
913
913
|
*/
|
914
914
|
function useContext<T>(context: Context<T>/*, (not public API) observedBits?: number|boolean */): T;
|
915
915
|
/**
|
916
916
|
* Returns a stateful value, and a function to update it.
|
917
917
|
*
|
918
918
|
* @version 16.8.0
|
919
|
-
* @see https://
|
919
|
+
* @see https://react.dev/reference/react/useState
|
920
920
|
*/
|
921
921
|
function useState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];
|
922
922
|
// convenience overload when first argument is omitted
|
@@ -924,7 +924,7 @@ declare namespace React {
|
|
924
924
|
* Returns a stateful value, and a function to update it.
|
925
925
|
*
|
926
926
|
* @version 16.8.0
|
927
|
-
* @see https://
|
927
|
+
* @see https://react.dev/reference/react/useState
|
928
928
|
*/
|
929
929
|
function useState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>];
|
930
930
|
/**
|
@@ -935,7 +935,7 @@ declare namespace React {
|
|
935
935
|
* updates because you can pass `dispatch` down instead of callbacks.
|
936
936
|
*
|
937
937
|
* @version 16.8.0
|
938
|
-
* @see https://
|
938
|
+
* @see https://react.dev/reference/react/useReducer
|
939
939
|
*/
|
940
940
|
// overload where dispatch could accept 0 arguments.
|
941
941
|
function useReducer<R extends ReducerWithoutAction<any>, I>(
|
@@ -951,7 +951,7 @@ declare namespace React {
|
|
951
951
|
* updates because you can pass `dispatch` down instead of callbacks.
|
952
952
|
*
|
953
953
|
* @version 16.8.0
|
954
|
-
* @see https://
|
954
|
+
* @see https://react.dev/reference/react/useReducer
|
955
955
|
*/
|
956
956
|
// overload where dispatch could accept 0 arguments.
|
957
957
|
function useReducer<R extends ReducerWithoutAction<any>>(
|
@@ -967,7 +967,7 @@ declare namespace React {
|
|
967
967
|
* updates because you can pass `dispatch` down instead of callbacks.
|
968
968
|
*
|
969
969
|
* @version 16.8.0
|
970
|
-
* @see https://
|
970
|
+
* @see https://react.dev/reference/react/useReducer
|
971
971
|
*/
|
972
972
|
// overload where "I" may be a subset of ReducerState<R>; used to provide autocompletion.
|
973
973
|
// If "I" matches ReducerState<R> exactly then the last overload will allow initializer to be omitted.
|
@@ -985,7 +985,7 @@ declare namespace React {
|
|
985
985
|
* updates because you can pass `dispatch` down instead of callbacks.
|
986
986
|
*
|
987
987
|
* @version 16.8.0
|
988
|
-
* @see https://
|
988
|
+
* @see https://react.dev/reference/react/useReducer
|
989
989
|
*/
|
990
990
|
// overload for free "I"; all goes as long as initializer converts it into "ReducerState<R>".
|
991
991
|
function useReducer<R extends Reducer<any, any>, I>(
|
@@ -1001,7 +1001,7 @@ declare namespace React {
|
|
1001
1001
|
* updates because you can pass `dispatch` down instead of callbacks.
|
1002
1002
|
*
|
1003
1003
|
* @version 16.8.0
|
1004
|
-
* @see https://
|
1004
|
+
* @see https://react.dev/reference/react/useReducer
|
1005
1005
|
*/
|
1006
1006
|
|
1007
1007
|
// I'm not sure if I keep this 2-ary or if I make it (2,3)-ary; it's currently (2,3)-ary.
|
@@ -1026,7 +1026,7 @@ declare namespace React {
|
|
1026
1026
|
* value around similar to how you’d use instance fields in classes.
|
1027
1027
|
*
|
1028
1028
|
* @version 16.8.0
|
1029
|
-
* @see https://
|
1029
|
+
* @see https://react.dev/reference/react/useRef
|
1030
1030
|
*/
|
1031
1031
|
function useRef<T>(initialValue: T): MutableRefObject<T>;
|
1032
1032
|
// convenience overload for refs given as a ref prop as they typically start with a null value
|
@@ -1041,7 +1041,7 @@ declare namespace React {
|
|
1041
1041
|
* of the generic argument.
|
1042
1042
|
*
|
1043
1043
|
* @version 16.8.0
|
1044
|
-
* @see https://
|
1044
|
+
* @see https://react.dev/reference/react/useRef
|
1045
1045
|
*/
|
1046
1046
|
function useRef<T>(initialValue: T|null): RefObject<T>;
|
1047
1047
|
// convenience overload for potentially undefined initialValue / call with 0 arguments
|
@@ -1054,7 +1054,7 @@ declare namespace React {
|
|
1054
1054
|
* value around similar to how you’d use instance fields in classes.
|
1055
1055
|
*
|
1056
1056
|
* @version 16.8.0
|
1057
|
-
* @see https://
|
1057
|
+
* @see https://react.dev/reference/react/useRef
|
1058
1058
|
*/
|
1059
1059
|
function useRef<T = undefined>(): MutableRefObject<T | undefined>;
|
1060
1060
|
/**
|
@@ -1068,7 +1068,7 @@ declare namespace React {
|
|
1068
1068
|
* `componentDidMount` and `componentDidUpdate`.
|
1069
1069
|
*
|
1070
1070
|
* @version 16.8.0
|
1071
|
-
* @see https://
|
1071
|
+
* @see https://react.dev/reference/react/useLayoutEffect
|
1072
1072
|
*/
|
1073
1073
|
function useLayoutEffect(effect: EffectCallback, deps?: DependencyList): void;
|
1074
1074
|
/**
|
@@ -1078,7 +1078,7 @@ declare namespace React {
|
|
1078
1078
|
* @param deps If present, effect will only activate if the values in the list change.
|
1079
1079
|
*
|
1080
1080
|
* @version 16.8.0
|
1081
|
-
* @see https://
|
1081
|
+
* @see https://react.dev/reference/react/useEffect
|
1082
1082
|
*/
|
1083
1083
|
function useEffect(effect: EffectCallback, deps?: DependencyList): void;
|
1084
1084
|
// NOTE: this does not accept strings, but this will have to be fixed by removing strings from type Ref<T>
|
@@ -1089,7 +1089,7 @@ declare namespace React {
|
|
1089
1089
|
* `useImperativeHandle` should be used with `React.forwardRef`.
|
1090
1090
|
*
|
1091
1091
|
* @version 16.8.0
|
1092
|
-
* @see https://
|
1092
|
+
* @see https://react.dev/reference/react/useImperativeHandle
|
1093
1093
|
*/
|
1094
1094
|
function useImperativeHandle<T, R extends T>(ref: Ref<T>|undefined, init: () => R, deps?: DependencyList): void;
|
1095
1095
|
// I made 'inputs' required here and in useMemo as there's no point to memoizing without the memoization key
|
@@ -1099,7 +1099,7 @@ declare namespace React {
|
|
1099
1099
|
* has changed.
|
1100
1100
|
*
|
1101
1101
|
* @version 16.8.0
|
1102
|
-
* @see https://
|
1102
|
+
* @see https://react.dev/reference/react/useCallback
|
1103
1103
|
*/
|
1104
1104
|
// TODO (TypeScript 3.0): <T extends (...args: never[]) => unknown>
|
1105
1105
|
function useCallback<T extends (...args: any[]) => any>(callback: T, deps: DependencyList): T;
|
@@ -1107,7 +1107,7 @@ declare namespace React {
|
|
1107
1107
|
* `useMemo` will only recompute the memoized value when one of the `deps` has changed.
|
1108
1108
|
*
|
1109
1109
|
* @version 16.8.0
|
1110
|
-
* @see https://
|
1110
|
+
* @see https://react.dev/reference/react/useMemo
|
1111
1111
|
*/
|
1112
1112
|
// allow undefined, but don't make it optional as that is very likely a mistake
|
1113
1113
|
function useMemo<T>(factory: () => T, deps: DependencyList | undefined): T;
|
@@ -1118,7 +1118,7 @@ declare namespace React {
|
|
1118
1118
|
* It’s most valuable for custom hooks that are part of shared libraries.
|
1119
1119
|
*
|
1120
1120
|
* @version 16.8.0
|
1121
|
-
* @see https://
|
1121
|
+
* @see https://react.dev/reference/react/useDebugValue
|
1122
1122
|
*/
|
1123
1123
|
// the name of the custom hook is itself derived from the function name at runtime:
|
1124
1124
|
// it's just the function name without the "use" prefix.
|
@@ -1818,6 +1818,7 @@ declare namespace React {
|
|
1818
1818
|
|
1819
1819
|
// Standard HTML Attributes
|
1820
1820
|
accessKey?: string | undefined;
|
1821
|
+
autoFocus?: boolean | undefined;
|
1821
1822
|
className?: string | undefined;
|
1822
1823
|
contentEditable?: Booleanish | "inherit" | undefined;
|
1823
1824
|
contextMenu?: string | undefined;
|
@@ -1889,7 +1890,6 @@ declare namespace React {
|
|
1889
1890
|
as?: string | undefined;
|
1890
1891
|
async?: boolean | undefined;
|
1891
1892
|
autoComplete?: string | undefined;
|
1892
|
-
autoFocus?: boolean | undefined;
|
1893
1893
|
autoPlay?: boolean | undefined;
|
1894
1894
|
capture?: boolean | 'user' | 'environment' | undefined;
|
1895
1895
|
cellPadding?: number | string | undefined;
|
@@ -2042,7 +2042,6 @@ declare namespace React {
|
|
2042
2042
|
}
|
2043
2043
|
|
2044
2044
|
interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
|
2045
|
-
autoFocus?: boolean | undefined;
|
2046
2045
|
disabled?: boolean | undefined;
|
2047
2046
|
form?: string | undefined;
|
2048
2047
|
formAction?: string | undefined;
|
@@ -2188,7 +2187,6 @@ declare namespace React {
|
|
2188
2187
|
accept?: string | undefined;
|
2189
2188
|
alt?: string | undefined;
|
2190
2189
|
autoComplete?: string | undefined;
|
2191
|
-
autoFocus?: boolean | undefined;
|
2192
2190
|
capture?: boolean | 'user' | 'environment' | undefined; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute
|
2193
2191
|
checked?: boolean | undefined;
|
2194
2192
|
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
@@ -2223,7 +2221,6 @@ declare namespace React {
|
|
2223
2221
|
}
|
2224
2222
|
|
2225
2223
|
interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
|
2226
|
-
autoFocus?: boolean | undefined;
|
2227
2224
|
challenge?: string | undefined;
|
2228
2225
|
disabled?: boolean | undefined;
|
2229
2226
|
form?: string | undefined;
|
@@ -2364,7 +2361,6 @@ declare namespace React {
|
|
2364
2361
|
|
2365
2362
|
interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
|
2366
2363
|
autoComplete?: string | undefined;
|
2367
|
-
autoFocus?: boolean | undefined;
|
2368
2364
|
disabled?: boolean | undefined;
|
2369
2365
|
form?: string | undefined;
|
2370
2366
|
multiple?: boolean | undefined;
|
@@ -2400,7 +2396,6 @@ declare namespace React {
|
|
2400
2396
|
|
2401
2397
|
interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
|
2402
2398
|
autoComplete?: string | undefined;
|
2403
|
-
autoFocus?: boolean | undefined;
|
2404
2399
|
cols?: number | undefined;
|
2405
2400
|
dirName?: string | undefined;
|
2406
2401
|
disabled?: boolean | undefined;
|
@@ -2740,7 +2735,6 @@ declare namespace React {
|
|
2740
2735
|
interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
|
2741
2736
|
allowFullScreen?: boolean | undefined;
|
2742
2737
|
allowpopups?: boolean | undefined;
|
2743
|
-
autoFocus?: boolean | undefined;
|
2744
2738
|
autosize?: boolean | undefined;
|
2745
2739
|
blinkfeatures?: string | undefined;
|
2746
2740
|
disableblinkfeatures?: string | undefined;
|
react v17.0/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "17.0.
|
3
|
+
"version": "17.0.55",
|
4
4
|
"description": "TypeScript definitions for React",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
|
6
6
|
"license": "MIT",
|
@@ -146,8 +146,8 @@
|
|
146
146
|
"@types/scheduler": "*",
|
147
147
|
"csstype": "^3.0.2"
|
148
148
|
},
|
149
|
-
"typesPublisherContentHash": "
|
150
|
-
"typeScriptVersion": "4.
|
149
|
+
"typesPublisherContentHash": "bebe31a1248ce7eb95a125739c970f6505f7e0328675d8c2498dc8fca57e11dc",
|
150
|
+
"typeScriptVersion": "4.3",
|
151
151
|
"exports": {
|
152
152
|
".": {
|
153
153
|
"types": {
|