@types/react 18.2.37 → 18.2.39
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/canary.d.ts +1 -1
- react/experimental.d.ts +1 -1
- react/index.d.ts +19 -19
- react/package.json +2 -2
- react/ts5.0/canary.d.ts +1 -1
- react/ts5.0/experimental.d.ts +1 -1
- react/ts5.0/index.d.ts +19 -19
react/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for react (https://react.dev/).
|
|
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: Mon, 27 Nov 2023 19:35:33 GMT
|
12
12
|
* Dependencies: [@types/prop-types](https://npmjs.com/package/@types/prop-types), [@types/scheduler](https://npmjs.com/package/@types/scheduler), [csstype](https://npmjs.com/package/csstype)
|
13
13
|
|
14
14
|
# Credits
|
react/canary.d.ts
CHANGED
@@ -82,7 +82,7 @@ declare module "." {
|
|
82
82
|
defaultValue: T,
|
83
83
|
): ServerContext<T>;
|
84
84
|
|
85
|
-
//
|
85
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
86
86
|
export function cache<CachedFunction extends Function>(fn: CachedFunction): CachedFunction;
|
87
87
|
|
88
88
|
export function unstable_useCacheRefresh(): () => void;
|
react/experimental.d.ts
CHANGED
@@ -112,7 +112,7 @@ declare module "." {
|
|
112
112
|
*/
|
113
113
|
export const unstable_SuspenseList: ExoticComponent<SuspenseListProps>;
|
114
114
|
|
115
|
-
//
|
115
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
116
116
|
export function experimental_useEffectEvent<T extends Function>(event: T): T;
|
117
117
|
|
118
118
|
type Reference = object;
|
react/index.d.ts
CHANGED
@@ -426,10 +426,10 @@ declare namespace React {
|
|
426
426
|
// Sync with `ReactChildren` until `ReactChildren` is removed.
|
427
427
|
const Children: {
|
428
428
|
map<T, C>(
|
429
|
-
children: C |
|
429
|
+
children: C | readonly C[],
|
430
430
|
fn: (child: C, index: number) => T,
|
431
431
|
): C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
|
432
|
-
forEach<C>(children: C |
|
432
|
+
forEach<C>(children: C | readonly C[], fn: (child: C, index: number) => void): void;
|
433
433
|
count(children: any): number;
|
434
434
|
only<C>(children: C): C extends any[] ? never : C;
|
435
435
|
toArray(children: ReactNode | ReactNode[]): Array<Exclude<ReactNode, boolean | null | undefined>>;
|
@@ -452,7 +452,7 @@ declare namespace React {
|
|
452
452
|
*/
|
453
453
|
type ProfilerOnRenderCallback = (
|
454
454
|
id: string,
|
455
|
-
phase: "mount" | "update",
|
455
|
+
phase: "mount" | "update" | "nested-update",
|
456
456
|
actualDuration: number,
|
457
457
|
baseDuration: number,
|
458
458
|
startTime: number,
|
@@ -912,7 +912,7 @@ declare namespace React {
|
|
912
912
|
// The identity check is done with the SameValue algorithm (Object.is), which is stricter than ===
|
913
913
|
type ReducerStateWithoutAction<R extends ReducerWithoutAction<any>> = R extends ReducerWithoutAction<infer S> ? S
|
914
914
|
: never;
|
915
|
-
type DependencyList =
|
915
|
+
type DependencyList = readonly unknown[];
|
916
916
|
|
917
917
|
// NOTE: callbacks are _only_ allowed to return either void, or a destructor.
|
918
918
|
type EffectCallback = () => void | Destructor;
|
@@ -1121,7 +1121,7 @@ declare namespace React {
|
|
1121
1121
|
*/
|
1122
1122
|
// A specific function type would not trigger implicit any.
|
1123
1123
|
// See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/52873#issuecomment-845806435 for a comparison between `Function` and more specific types.
|
1124
|
-
//
|
1124
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
1125
1125
|
function useCallback<T extends Function>(callback: T, deps: DependencyList): T;
|
1126
1126
|
/**
|
1127
1127
|
* `useMemo` will only recompute the memoized value when one of the `deps` has changed.
|
@@ -1944,7 +1944,7 @@ declare namespace React {
|
|
1944
1944
|
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
|
1945
1945
|
// React-specific Attributes
|
1946
1946
|
defaultChecked?: boolean | undefined;
|
1947
|
-
defaultValue?: string | number |
|
1947
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
1948
1948
|
suppressContentEditableWarning?: boolean | undefined;
|
1949
1949
|
suppressHydrationWarning?: boolean | undefined;
|
1950
1950
|
|
@@ -2131,7 +2131,7 @@ declare namespace React {
|
|
2131
2131
|
target?: string | undefined;
|
2132
2132
|
type?: string | undefined;
|
2133
2133
|
useMap?: string | undefined;
|
2134
|
-
value?: string |
|
2134
|
+
value?: string | readonly string[] | number | undefined;
|
2135
2135
|
width?: number | string | undefined;
|
2136
2136
|
wmode?: string | undefined;
|
2137
2137
|
wrap?: string | undefined;
|
@@ -2204,7 +2204,7 @@ declare namespace React {
|
|
2204
2204
|
formTarget?: string | undefined;
|
2205
2205
|
name?: string | undefined;
|
2206
2206
|
type?: "submit" | "reset" | "button" | undefined;
|
2207
|
-
value?: string |
|
2207
|
+
value?: string | readonly string[] | number | undefined;
|
2208
2208
|
}
|
2209
2209
|
|
2210
2210
|
interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -2222,7 +2222,7 @@ declare namespace React {
|
|
2222
2222
|
}
|
2223
2223
|
|
2224
2224
|
interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
|
2225
|
-
value?: string |
|
2225
|
+
value?: string | readonly string[] | number | undefined;
|
2226
2226
|
}
|
2227
2227
|
|
2228
2228
|
interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -2376,7 +2376,7 @@ declare namespace React {
|
|
2376
2376
|
src?: string | undefined;
|
2377
2377
|
step?: number | string | undefined;
|
2378
2378
|
type?: HTMLInputTypeAttribute | undefined;
|
2379
|
-
value?: string |
|
2379
|
+
value?: string | readonly string[] | number | undefined;
|
2380
2380
|
width?: number | string | undefined;
|
2381
2381
|
|
2382
2382
|
onChange?: ChangeEventHandler<T> | undefined;
|
@@ -2397,7 +2397,7 @@ declare namespace React {
|
|
2397
2397
|
}
|
2398
2398
|
|
2399
2399
|
interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
|
2400
|
-
value?: string |
|
2400
|
+
value?: string | readonly string[] | number | undefined;
|
2401
2401
|
}
|
2402
2402
|
|
2403
2403
|
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -2452,7 +2452,7 @@ declare namespace React {
|
|
2452
2452
|
max?: number | string | undefined;
|
2453
2453
|
min?: number | string | undefined;
|
2454
2454
|
optimum?: number | undefined;
|
2455
|
-
value?: string |
|
2455
|
+
value?: string | readonly string[] | number | undefined;
|
2456
2456
|
}
|
2457
2457
|
|
2458
2458
|
interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -2486,7 +2486,7 @@ declare namespace React {
|
|
2486
2486
|
disabled?: boolean | undefined;
|
2487
2487
|
label?: string | undefined;
|
2488
2488
|
selected?: boolean | undefined;
|
2489
|
-
value?: string |
|
2489
|
+
value?: string | readonly string[] | number | undefined;
|
2490
2490
|
}
|
2491
2491
|
|
2492
2492
|
interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -2497,12 +2497,12 @@ declare namespace React {
|
|
2497
2497
|
|
2498
2498
|
interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
|
2499
2499
|
name?: string | undefined;
|
2500
|
-
value?: string |
|
2500
|
+
value?: string | readonly string[] | number | undefined;
|
2501
2501
|
}
|
2502
2502
|
|
2503
2503
|
interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
|
2504
2504
|
max?: number | string | undefined;
|
2505
|
-
value?: string |
|
2505
|
+
value?: string | readonly string[] | number | undefined;
|
2506
2506
|
}
|
2507
2507
|
|
2508
2508
|
interface SlotHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -2530,7 +2530,7 @@ declare namespace React {
|
|
2530
2530
|
name?: string | undefined;
|
2531
2531
|
required?: boolean | undefined;
|
2532
2532
|
size?: number | undefined;
|
2533
|
-
value?: string |
|
2533
|
+
value?: string | readonly string[] | number | undefined;
|
2534
2534
|
onChange?: ChangeEventHandler<T> | undefined;
|
2535
2535
|
}
|
2536
2536
|
|
@@ -2575,7 +2575,7 @@ declare namespace React {
|
|
2575
2575
|
readOnly?: boolean | undefined;
|
2576
2576
|
required?: boolean | undefined;
|
2577
2577
|
rows?: number | undefined;
|
2578
|
-
value?: string |
|
2578
|
+
value?: string | readonly string[] | number | undefined;
|
2579
2579
|
wrap?: string | undefined;
|
2580
2580
|
|
2581
2581
|
onChange?: ChangeEventHandler<T> | undefined;
|
@@ -3165,10 +3165,10 @@ declare namespace React {
|
|
3165
3165
|
// Sync with type of `const Children`.
|
3166
3166
|
interface ReactChildren {
|
3167
3167
|
map<T, C>(
|
3168
|
-
children: C |
|
3168
|
+
children: C | readonly C[],
|
3169
3169
|
fn: (child: C, index: number) => T,
|
3170
3170
|
): C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
|
3171
|
-
forEach<C>(children: C |
|
3171
|
+
forEach<C>(children: C | readonly C[], fn: (child: C, index: number) => void): void;
|
3172
3172
|
count(children: any): number;
|
3173
3173
|
only<C>(children: C): C extends any[] ? never : C;
|
3174
3174
|
toArray(children: ReactNode | ReactNode[]): Array<Exclude<ReactNode, boolean | null | undefined>>;
|
react/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "18.2.
|
3
|
+
"version": "18.2.39",
|
4
4
|
"description": "TypeScript definitions for react",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
|
6
6
|
"license": "MIT",
|
@@ -201,6 +201,6 @@
|
|
201
201
|
"@types/scheduler": "*",
|
202
202
|
"csstype": "^3.0.2"
|
203
203
|
},
|
204
|
-
"typesPublisherContentHash": "
|
204
|
+
"typesPublisherContentHash": "eb1c84afebdf7b8fb59f07bc01d9f5eebfc328bef0f74f0f18168fa368b1760f",
|
205
205
|
"typeScriptVersion": "4.5"
|
206
206
|
}
|
react/ts5.0/canary.d.ts
CHANGED
@@ -82,7 +82,7 @@ declare module "." {
|
|
82
82
|
defaultValue: T,
|
83
83
|
): ServerContext<T>;
|
84
84
|
|
85
|
-
//
|
85
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
86
86
|
export function cache<CachedFunction extends Function>(fn: CachedFunction): CachedFunction;
|
87
87
|
|
88
88
|
export function unstable_useCacheRefresh(): () => void;
|
react/ts5.0/experimental.d.ts
CHANGED
@@ -112,7 +112,7 @@ declare module "." {
|
|
112
112
|
*/
|
113
113
|
export const unstable_SuspenseList: ExoticComponent<SuspenseListProps>;
|
114
114
|
|
115
|
-
//
|
115
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
116
116
|
export function experimental_useEffectEvent<T extends Function>(event: T): T;
|
117
117
|
|
118
118
|
type Reference = object;
|
react/ts5.0/index.d.ts
CHANGED
@@ -427,10 +427,10 @@ declare namespace React {
|
|
427
427
|
// Sync with `ReactChildren` until `ReactChildren` is removed.
|
428
428
|
const Children: {
|
429
429
|
map<T, C>(
|
430
|
-
children: C |
|
430
|
+
children: C | readonly C[],
|
431
431
|
fn: (child: C, index: number) => T,
|
432
432
|
): C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
|
433
|
-
forEach<C>(children: C |
|
433
|
+
forEach<C>(children: C | readonly C[], fn: (child: C, index: number) => void): void;
|
434
434
|
count(children: any): number;
|
435
435
|
only<C>(children: C): C extends any[] ? never : C;
|
436
436
|
toArray(children: ReactNode | ReactNode[]): Array<Exclude<ReactNode, boolean | null | undefined>>;
|
@@ -453,7 +453,7 @@ declare namespace React {
|
|
453
453
|
*/
|
454
454
|
type ProfilerOnRenderCallback = (
|
455
455
|
id: string,
|
456
|
-
phase: "mount" | "update",
|
456
|
+
phase: "mount" | "update" | "nested-update",
|
457
457
|
actualDuration: number,
|
458
458
|
baseDuration: number,
|
459
459
|
startTime: number,
|
@@ -913,7 +913,7 @@ declare namespace React {
|
|
913
913
|
// The identity check is done with the SameValue algorithm (Object.is), which is stricter than ===
|
914
914
|
type ReducerStateWithoutAction<R extends ReducerWithoutAction<any>> = R extends ReducerWithoutAction<infer S> ? S
|
915
915
|
: never;
|
916
|
-
type DependencyList =
|
916
|
+
type DependencyList = readonly unknown[];
|
917
917
|
|
918
918
|
// NOTE: callbacks are _only_ allowed to return either void, or a destructor.
|
919
919
|
type EffectCallback = () => void | Destructor;
|
@@ -1122,7 +1122,7 @@ declare namespace React {
|
|
1122
1122
|
*/
|
1123
1123
|
// A specific function type would not trigger implicit any.
|
1124
1124
|
// See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/52873#issuecomment-845806435 for a comparison between `Function` and more specific types.
|
1125
|
-
//
|
1125
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
1126
1126
|
function useCallback<T extends Function>(callback: T, deps: DependencyList): T;
|
1127
1127
|
/**
|
1128
1128
|
* `useMemo` will only recompute the memoized value when one of the `deps` has changed.
|
@@ -1945,7 +1945,7 @@ declare namespace React {
|
|
1945
1945
|
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
|
1946
1946
|
// React-specific Attributes
|
1947
1947
|
defaultChecked?: boolean | undefined;
|
1948
|
-
defaultValue?: string | number |
|
1948
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
1949
1949
|
suppressContentEditableWarning?: boolean | undefined;
|
1950
1950
|
suppressHydrationWarning?: boolean | undefined;
|
1951
1951
|
|
@@ -2132,7 +2132,7 @@ declare namespace React {
|
|
2132
2132
|
target?: string | undefined;
|
2133
2133
|
type?: string | undefined;
|
2134
2134
|
useMap?: string | undefined;
|
2135
|
-
value?: string |
|
2135
|
+
value?: string | readonly string[] | number | undefined;
|
2136
2136
|
width?: number | string | undefined;
|
2137
2137
|
wmode?: string | undefined;
|
2138
2138
|
wrap?: string | undefined;
|
@@ -2205,7 +2205,7 @@ declare namespace React {
|
|
2205
2205
|
formTarget?: string | undefined;
|
2206
2206
|
name?: string | undefined;
|
2207
2207
|
type?: "submit" | "reset" | "button" | undefined;
|
2208
|
-
value?: string |
|
2208
|
+
value?: string | readonly string[] | number | undefined;
|
2209
2209
|
}
|
2210
2210
|
|
2211
2211
|
interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -2223,7 +2223,7 @@ declare namespace React {
|
|
2223
2223
|
}
|
2224
2224
|
|
2225
2225
|
interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
|
2226
|
-
value?: string |
|
2226
|
+
value?: string | readonly string[] | number | undefined;
|
2227
2227
|
}
|
2228
2228
|
|
2229
2229
|
interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -2377,7 +2377,7 @@ declare namespace React {
|
|
2377
2377
|
src?: string | undefined;
|
2378
2378
|
step?: number | string | undefined;
|
2379
2379
|
type?: HTMLInputTypeAttribute | undefined;
|
2380
|
-
value?: string |
|
2380
|
+
value?: string | readonly string[] | number | undefined;
|
2381
2381
|
width?: number | string | undefined;
|
2382
2382
|
|
2383
2383
|
onChange?: ChangeEventHandler<T> | undefined;
|
@@ -2398,7 +2398,7 @@ declare namespace React {
|
|
2398
2398
|
}
|
2399
2399
|
|
2400
2400
|
interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
|
2401
|
-
value?: string |
|
2401
|
+
value?: string | readonly string[] | number | undefined;
|
2402
2402
|
}
|
2403
2403
|
|
2404
2404
|
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -2452,7 +2452,7 @@ declare namespace React {
|
|
2452
2452
|
max?: number | string | undefined;
|
2453
2453
|
min?: number | string | undefined;
|
2454
2454
|
optimum?: number | undefined;
|
2455
|
-
value?: string |
|
2455
|
+
value?: string | readonly string[] | number | undefined;
|
2456
2456
|
}
|
2457
2457
|
|
2458
2458
|
interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -2486,7 +2486,7 @@ declare namespace React {
|
|
2486
2486
|
disabled?: boolean | undefined;
|
2487
2487
|
label?: string | undefined;
|
2488
2488
|
selected?: boolean | undefined;
|
2489
|
-
value?: string |
|
2489
|
+
value?: string | readonly string[] | number | undefined;
|
2490
2490
|
}
|
2491
2491
|
|
2492
2492
|
interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -2497,12 +2497,12 @@ declare namespace React {
|
|
2497
2497
|
|
2498
2498
|
interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
|
2499
2499
|
name?: string | undefined;
|
2500
|
-
value?: string |
|
2500
|
+
value?: string | readonly string[] | number | undefined;
|
2501
2501
|
}
|
2502
2502
|
|
2503
2503
|
interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
|
2504
2504
|
max?: number | string | undefined;
|
2505
|
-
value?: string |
|
2505
|
+
value?: string | readonly string[] | number | undefined;
|
2506
2506
|
}
|
2507
2507
|
|
2508
2508
|
interface SlotHTMLAttributes<T> extends HTMLAttributes<T> {
|
@@ -2530,7 +2530,7 @@ declare namespace React {
|
|
2530
2530
|
name?: string | undefined;
|
2531
2531
|
required?: boolean | undefined;
|
2532
2532
|
size?: number | undefined;
|
2533
|
-
value?: string |
|
2533
|
+
value?: string | readonly string[] | number | undefined;
|
2534
2534
|
onChange?: ChangeEventHandler<T> | undefined;
|
2535
2535
|
}
|
2536
2536
|
|
@@ -2575,7 +2575,7 @@ declare namespace React {
|
|
2575
2575
|
readOnly?: boolean | undefined;
|
2576
2576
|
required?: boolean | undefined;
|
2577
2577
|
rows?: number | undefined;
|
2578
|
-
value?: string |
|
2578
|
+
value?: string | readonly string[] | number | undefined;
|
2579
2579
|
wrap?: string | undefined;
|
2580
2580
|
|
2581
2581
|
onChange?: ChangeEventHandler<T> | undefined;
|
@@ -3165,10 +3165,10 @@ declare namespace React {
|
|
3165
3165
|
// Sync with type of `const Children`.
|
3166
3166
|
interface ReactChildren {
|
3167
3167
|
map<T, C>(
|
3168
|
-
children: C |
|
3168
|
+
children: C | readonly C[],
|
3169
3169
|
fn: (child: C, index: number) => T,
|
3170
3170
|
): C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
|
3171
|
-
forEach<C>(children: C |
|
3171
|
+
forEach<C>(children: C | readonly C[], fn: (child: C, index: number) => void): void;
|
3172
3172
|
count(children: any): number;
|
3173
3173
|
only<C>(children: C): C extends any[] ? never : C;
|
3174
3174
|
toArray(children: ReactNode | ReactNode[]): Array<Exclude<ReactNode, boolean | null | undefined>>;
|