@types/react 18.0.21 → 18.0.24
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 +0 -27
- react/index.d.ts +6 -6
- react/next.d.ts +57 -1
- 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: Thu,
|
11
|
+
* Last updated: Thu, 27 Oct 2022 11:32:50 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/experimental.d.ts
CHANGED
@@ -103,33 +103,6 @@ declare module '.' {
|
|
103
103
|
*/
|
104
104
|
export const SuspenseList: ExoticComponent<SuspenseListProps>;
|
105
105
|
|
106
|
-
interface ThenableImpl<T> {
|
107
|
-
then(onFulfill: (value: T) => unknown, onReject: (error: unknown) => unknown): void | PromiseLike<unknown>;
|
108
|
-
}
|
109
|
-
interface UntrackedThenable<T> extends ThenableImpl<T> {
|
110
|
-
status?: void;
|
111
|
-
}
|
112
|
-
|
113
|
-
export interface PendingThenable<T> extends ThenableImpl<T> {
|
114
|
-
status: 'pending';
|
115
|
-
}
|
116
|
-
|
117
|
-
export interface FulfilledThenable<T> extends ThenableImpl<T> {
|
118
|
-
status: 'fulfilled';
|
119
|
-
value: T;
|
120
|
-
}
|
121
|
-
|
122
|
-
export interface RejectedThenable<T> extends ThenableImpl<T> {
|
123
|
-
status: 'rejected';
|
124
|
-
reason: unknown;
|
125
|
-
}
|
126
|
-
|
127
|
-
export type Thenable<T> = UntrackedThenable<T> | PendingThenable<T> | FulfilledThenable<T> | RejectedThenable<T>;
|
128
|
-
|
129
|
-
export type Usable<T> = Thenable<T> | Context<T>;
|
130
|
-
|
131
|
-
export function experimental_use<T>(usable: Usable<T>): T;
|
132
|
-
|
133
106
|
// tslint:disable-next-line ban-types
|
134
107
|
export function experimental_useEvent<T extends Function>(event: T): T;
|
135
108
|
}
|
react/index.d.ts
CHANGED
@@ -1249,6 +1249,8 @@ declare namespace React {
|
|
1249
1249
|
target: EventTarget & T;
|
1250
1250
|
}
|
1251
1251
|
|
1252
|
+
export type ModifierKey = "Alt" | "AltGraph" | "CapsLock" | "Control" | "Fn" | "FnLock" | "Hyper" | "Meta" | "NumLock" | "ScrollLock" | "Shift" | "Super" | "Symbol" | "SymbolLock";
|
1253
|
+
|
1252
1254
|
interface KeyboardEvent<T = Element> extends UIEvent<T, NativeKeyboardEvent> {
|
1253
1255
|
altKey: boolean;
|
1254
1256
|
/** @deprecated */
|
@@ -1258,7 +1260,7 @@ declare namespace React {
|
|
1258
1260
|
/**
|
1259
1261
|
* See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
|
1260
1262
|
*/
|
1261
|
-
getModifierState(key:
|
1263
|
+
getModifierState(key: ModifierKey): boolean;
|
1262
1264
|
/**
|
1263
1265
|
* See the [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#named-key-attribute-values). for possible values
|
1264
1266
|
*/
|
@@ -1284,7 +1286,7 @@ declare namespace React {
|
|
1284
1286
|
/**
|
1285
1287
|
* See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
|
1286
1288
|
*/
|
1287
|
-
getModifierState(key:
|
1289
|
+
getModifierState(key: ModifierKey): boolean;
|
1288
1290
|
metaKey: boolean;
|
1289
1291
|
movementX: number;
|
1290
1292
|
movementY: number;
|
@@ -1303,7 +1305,7 @@ declare namespace React {
|
|
1303
1305
|
/**
|
1304
1306
|
* See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
|
1305
1307
|
*/
|
1306
|
-
getModifierState(key:
|
1308
|
+
getModifierState(key: ModifierKey): boolean;
|
1307
1309
|
metaKey: boolean;
|
1308
1310
|
shiftKey: boolean;
|
1309
1311
|
targetTouches: TouchList;
|
@@ -1857,6 +1859,7 @@ declare namespace React {
|
|
1857
1859
|
hidden?: boolean | undefined;
|
1858
1860
|
id?: string | undefined;
|
1859
1861
|
lang?: string | undefined;
|
1862
|
+
nonce?: string | undefined;
|
1860
1863
|
placeholder?: string | undefined;
|
1861
1864
|
slot?: string | undefined;
|
1862
1865
|
spellCheck?: Booleanish | undefined;
|
@@ -1977,7 +1980,6 @@ declare namespace React {
|
|
1977
1980
|
multiple?: boolean | undefined;
|
1978
1981
|
muted?: boolean | undefined;
|
1979
1982
|
name?: string | undefined;
|
1980
|
-
nonce?: string | undefined;
|
1981
1983
|
noValidate?: boolean | undefined;
|
1982
1984
|
open?: boolean | undefined;
|
1983
1985
|
optimum?: number | undefined;
|
@@ -2390,7 +2392,6 @@ declare namespace React {
|
|
2390
2392
|
defer?: boolean | undefined;
|
2391
2393
|
integrity?: string | undefined;
|
2392
2394
|
noModule?: boolean | undefined;
|
2393
|
-
nonce?: string | undefined;
|
2394
2395
|
referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
|
2395
2396
|
src?: string | undefined;
|
2396
2397
|
type?: string | undefined;
|
@@ -2421,7 +2422,6 @@ declare namespace React {
|
|
2421
2422
|
|
2422
2423
|
interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
|
2423
2424
|
media?: string | undefined;
|
2424
|
-
nonce?: string | undefined;
|
2425
2425
|
scoped?: boolean | undefined;
|
2426
2426
|
type?: string | undefined;
|
2427
2427
|
}
|
react/next.d.ts
CHANGED
@@ -27,4 +27,60 @@ import React = require('.');
|
|
27
27
|
|
28
28
|
export {};
|
29
29
|
|
30
|
-
declare module '.' {
|
30
|
+
declare module '.' {
|
31
|
+
interface ThenableImpl<T> {
|
32
|
+
then(onFulfill: (value: T) => unknown, onReject: (error: unknown) => unknown): void | PromiseLike<unknown>;
|
33
|
+
}
|
34
|
+
interface UntrackedThenable<T> extends ThenableImpl<T> {
|
35
|
+
status?: void;
|
36
|
+
}
|
37
|
+
|
38
|
+
export interface PendingThenable<T> extends ThenableImpl<T> {
|
39
|
+
status: 'pending';
|
40
|
+
}
|
41
|
+
|
42
|
+
export interface FulfilledThenable<T> extends ThenableImpl<T> {
|
43
|
+
status: 'fulfilled';
|
44
|
+
value: T;
|
45
|
+
}
|
46
|
+
|
47
|
+
export interface RejectedThenable<T> extends ThenableImpl<T> {
|
48
|
+
status: 'rejected';
|
49
|
+
reason: unknown;
|
50
|
+
}
|
51
|
+
|
52
|
+
export type Thenable<T> = UntrackedThenable<T> | PendingThenable<T> | FulfilledThenable<T> | RejectedThenable<T>;
|
53
|
+
|
54
|
+
export type Usable<T> = Thenable<T> | Context<T>;
|
55
|
+
|
56
|
+
export function use<T>(usable: Usable<T>): T;
|
57
|
+
|
58
|
+
interface ServerContextJSONArray extends ReadonlyArray<ServerContextJSONArray> {}
|
59
|
+
export type ServerContextJSONValue =
|
60
|
+
| string
|
61
|
+
| boolean
|
62
|
+
| number
|
63
|
+
| null
|
64
|
+
| ServerContextJSONArray
|
65
|
+
| { [key: string]: ServerContextJSONValue };
|
66
|
+
export interface ServerContext<T extends ServerContextJSONValue> {
|
67
|
+
Provider: Provider<T>;
|
68
|
+
}
|
69
|
+
/**
|
70
|
+
* Accepts a context object (the value returned from `React.createContext` or `React.createServerContext`) and returns the current
|
71
|
+
* context value, as given by the nearest context provider for the given context.
|
72
|
+
*
|
73
|
+
* @version 16.8.0
|
74
|
+
* @see https://reactjs.org/docs/hooks-reference.html#usecontext
|
75
|
+
*/
|
76
|
+
function useContext<T extends ServerContextJSONValue>(context: ServerContext<T>): T;
|
77
|
+
export function createServerContext<T extends ServerContextJSONValue>(
|
78
|
+
globalName: string,
|
79
|
+
defaultValue: T,
|
80
|
+
): ServerContext<T>;
|
81
|
+
|
82
|
+
// tslint:disable-next-line ban-types
|
83
|
+
export function cache<CachedFunction extends Function>(fn: CachedFunction): CachedFunction;
|
84
|
+
|
85
|
+
export function unstable_useCacheRefresh(): () => void;
|
86
|
+
}
|
react/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "18.0.
|
3
|
+
"version": "18.0.24",
|
4
4
|
"description": "TypeScript definitions for React",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
|
6
6
|
"license": "MIT",
|
@@ -146,7 +146,7 @@
|
|
146
146
|
"@types/scheduler": "*",
|
147
147
|
"csstype": "^3.0.2"
|
148
148
|
},
|
149
|
-
"typesPublisherContentHash": "
|
149
|
+
"typesPublisherContentHash": "7834dcdae9bdbf084395b391465cbd6a7e838a24ca26482cf3bd8fe799f1c88f",
|
150
150
|
"typeScriptVersion": "4.1",
|
151
151
|
"exports": {
|
152
152
|
".": {
|