@types/react-dom 18.3.1 → 18.3.3
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-dom/README.md → react-dom v18.3/README.md +5 -3
- react-dom/package.json → react-dom v18.3/package.json +6 -15
- react-dom/canary.d.ts +0 -184
- react-dom/experimental.d.ts +0 -36
- {react-dom → react-dom v18.3}/LICENSE +0 -0
- {react-dom → react-dom v18.3}/client.d.ts +0 -0
- {react-dom → react-dom v18.3}/index.d.ts +0 -0
- {react-dom → react-dom v18.3}/server.d.ts +0 -0
- {react-dom → react-dom v18.3}/test-utils/index.d.ts +0 -0
@@ -5,11 +5,13 @@
|
|
5
5
|
This package contains type definitions for react-dom (https://reactjs.org).
|
6
6
|
|
7
7
|
# Details
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom.
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom/v18.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
12
|
-
* Dependencies:
|
11
|
+
* Last updated: Mon, 09 Dec 2024 19:32:14 GMT
|
12
|
+
* Dependencies: none
|
13
|
+
|
14
|
+
* Peer dependencies: [@types/react](https://npmjs.com/package/@types/react)
|
13
15
|
|
14
16
|
# Credits
|
15
17
|
These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), [MartynasZilinskas](https://github.com/MartynasZilinskas), [Josh Rutherford](https://github.com/theruther4d), [Jessica Franco](https://github.com/Jessidhia), and [Sebastian Silbermann](https://github.com/eps1lon).
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react-dom",
|
3
|
-
"version": "18.3.
|
3
|
+
"version": "18.3.3",
|
4
4
|
"description": "TypeScript definitions for react-dom",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom",
|
6
6
|
"license": "MIT",
|
@@ -51,21 +51,11 @@
|
|
51
51
|
"default": "./client.d.ts"
|
52
52
|
}
|
53
53
|
},
|
54
|
-
"./canary": {
|
55
|
-
"types": {
|
56
|
-
"default": "./canary.d.ts"
|
57
|
-
}
|
58
|
-
},
|
59
54
|
"./server": {
|
60
55
|
"types": {
|
61
56
|
"default": "./server.d.ts"
|
62
57
|
}
|
63
58
|
},
|
64
|
-
"./experimental": {
|
65
|
-
"types": {
|
66
|
-
"default": "./experimental.d.ts"
|
67
|
-
}
|
68
|
-
},
|
69
59
|
"./test-utils": {
|
70
60
|
"types": {
|
71
61
|
"default": "./test-utils/index.d.ts"
|
@@ -79,9 +69,10 @@
|
|
79
69
|
"directory": "types/react-dom"
|
80
70
|
},
|
81
71
|
"scripts": {},
|
82
|
-
"dependencies": {
|
83
|
-
|
72
|
+
"dependencies": {},
|
73
|
+
"peerDependencies": {
|
74
|
+
"@types/react": "^18.0.0"
|
84
75
|
},
|
85
|
-
"typesPublisherContentHash": "
|
86
|
-
"typeScriptVersion": "
|
76
|
+
"typesPublisherContentHash": "88bb8483261608225395a6d342427942d9ba9d90536ff70a364d60d63cd103d9",
|
77
|
+
"typeScriptVersion": "5.0"
|
87
78
|
}
|
react-dom/canary.d.ts
DELETED
@@ -1,184 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* These are types for things that are present in the upcoming React 18 release.
|
3
|
-
*
|
4
|
-
* Once React 18 is released they can just be moved to the main index file.
|
5
|
-
*
|
6
|
-
* To load the types declared here in an actual project, there are three ways. The easiest one,
|
7
|
-
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
|
8
|
-
* is to add `"react-dom/canary"` to the `"types"` array.
|
9
|
-
*
|
10
|
-
* Alternatively, a specific import syntax can to be used from a typescript file.
|
11
|
-
* This module does not exist in reality, which is why the {} is important:
|
12
|
-
*
|
13
|
-
* ```ts
|
14
|
-
* import {} from 'react-dom/canary'
|
15
|
-
* ```
|
16
|
-
*
|
17
|
-
* It is also possible to include it through a triple-slash reference:
|
18
|
-
*
|
19
|
-
* ```ts
|
20
|
-
* /// <reference types="react-dom/canary" />
|
21
|
-
* ```
|
22
|
-
*
|
23
|
-
* Either the import or the reference only needs to appear once, anywhere in the project.
|
24
|
-
*/
|
25
|
-
|
26
|
-
// See https://github.com/facebook/react/blob/main/packages/react-dom/index.js to see how the exports are declared,
|
27
|
-
// but confirm with published source code (e.g. https://unpkg.com/react-dom@canary) that these exports end up in the published code
|
28
|
-
|
29
|
-
import React = require("react");
|
30
|
-
import ReactDOM = require(".");
|
31
|
-
|
32
|
-
export {};
|
33
|
-
|
34
|
-
declare const REACT_FORM_STATE_SIGIL: unique symbol;
|
35
|
-
|
36
|
-
declare module "." {
|
37
|
-
function prefetchDNS(href: string): void;
|
38
|
-
|
39
|
-
interface PreconnectOptions {
|
40
|
-
// Don't create a helper type.
|
41
|
-
// It would have to be in module scope to be inlined in TS tooltips.
|
42
|
-
// But then it becomes part of the public API.
|
43
|
-
// TODO: Upstream to microsoft/TypeScript-DOM-lib-generator -> w3c/webref
|
44
|
-
// since the spec has a notion of a dedicated type: https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attribute
|
45
|
-
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
46
|
-
}
|
47
|
-
function preconnect(href: string, options?: PreconnectOptions): void;
|
48
|
-
|
49
|
-
type PreloadAs =
|
50
|
-
| "audio"
|
51
|
-
| "document"
|
52
|
-
| "embed"
|
53
|
-
| "fetch"
|
54
|
-
| "font"
|
55
|
-
| "image"
|
56
|
-
| "object"
|
57
|
-
| "track"
|
58
|
-
| "script"
|
59
|
-
| "style"
|
60
|
-
| "video"
|
61
|
-
| "worker";
|
62
|
-
interface PreloadOptions {
|
63
|
-
as: PreloadAs;
|
64
|
-
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
65
|
-
fetchPriority?: "high" | "low" | "auto" | undefined;
|
66
|
-
// TODO: These should only be allowed with `as: 'image'` but it's not trivial to write tests against the full TS support matrix.
|
67
|
-
imageSizes?: string | undefined;
|
68
|
-
imageSrcSet?: string | undefined;
|
69
|
-
integrity?: string | undefined;
|
70
|
-
type?: string | undefined;
|
71
|
-
nonce?: string | undefined;
|
72
|
-
referrerPolicy?: ReferrerPolicy | undefined;
|
73
|
-
}
|
74
|
-
function preload(href: string, options?: PreloadOptions): void;
|
75
|
-
|
76
|
-
// https://html.spec.whatwg.org/multipage/links.html#link-type-modulepreload
|
77
|
-
type PreloadModuleAs = RequestDestination;
|
78
|
-
interface PreloadModuleOptions {
|
79
|
-
/**
|
80
|
-
* @default "script"
|
81
|
-
*/
|
82
|
-
as: PreloadModuleAs;
|
83
|
-
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
84
|
-
integrity?: string | undefined;
|
85
|
-
nonce?: string | undefined;
|
86
|
-
}
|
87
|
-
function preloadModule(href: string, options?: PreloadModuleOptions): void;
|
88
|
-
|
89
|
-
type PreinitAs = "script" | "style";
|
90
|
-
interface PreinitOptions {
|
91
|
-
as: PreinitAs;
|
92
|
-
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
93
|
-
fetchPriority?: "high" | "low" | "auto" | undefined;
|
94
|
-
precedence?: string | undefined;
|
95
|
-
integrity?: string | undefined;
|
96
|
-
nonce?: string | undefined;
|
97
|
-
}
|
98
|
-
function preinit(href: string, options?: PreinitOptions): void;
|
99
|
-
|
100
|
-
// Will be expanded to include all of https://github.com/tc39/proposal-import-attributes
|
101
|
-
type PreinitModuleAs = "script";
|
102
|
-
interface PreinitModuleOptions {
|
103
|
-
/**
|
104
|
-
* @default "script"
|
105
|
-
*/
|
106
|
-
as?: PreinitModuleAs;
|
107
|
-
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
108
|
-
integrity?: string | undefined;
|
109
|
-
nonce?: string | undefined;
|
110
|
-
}
|
111
|
-
function preinitModule(href: string, options?: PreinitModuleOptions): void;
|
112
|
-
|
113
|
-
interface FormStatusNotPending {
|
114
|
-
pending: false;
|
115
|
-
data: null;
|
116
|
-
method: null;
|
117
|
-
action: null;
|
118
|
-
}
|
119
|
-
|
120
|
-
interface FormStatusPending {
|
121
|
-
pending: true;
|
122
|
-
data: FormData;
|
123
|
-
method: string;
|
124
|
-
action: string | ((formData: FormData) => void | Promise<void>);
|
125
|
-
}
|
126
|
-
|
127
|
-
type FormStatus = FormStatusPending | FormStatusNotPending;
|
128
|
-
|
129
|
-
function useFormStatus(): FormStatus;
|
130
|
-
|
131
|
-
function useFormState<State>(
|
132
|
-
action: (state: Awaited<State>) => State | Promise<State>,
|
133
|
-
initialState: Awaited<State>,
|
134
|
-
permalink?: string,
|
135
|
-
): [state: Awaited<State>, dispatch: () => void, isPending: boolean];
|
136
|
-
function useFormState<State, Payload>(
|
137
|
-
action: (state: Awaited<State>, payload: Payload) => State | Promise<State>,
|
138
|
-
initialState: Awaited<State>,
|
139
|
-
permalink?: string,
|
140
|
-
): [state: Awaited<State>, dispatch: (payload: Payload) => void, isPending: boolean];
|
141
|
-
|
142
|
-
function requestFormReset(form: HTMLFormElement): void;
|
143
|
-
}
|
144
|
-
|
145
|
-
declare module "./client" {
|
146
|
-
interface ReactFormState {
|
147
|
-
[REACT_FORM_STATE_SIGIL]: never;
|
148
|
-
}
|
149
|
-
|
150
|
-
interface RootOptions {
|
151
|
-
onUncaughtError?:
|
152
|
-
| ((error: unknown, errorInfo: { componentStack?: string | undefined }) => void)
|
153
|
-
| undefined;
|
154
|
-
onCaughtError?:
|
155
|
-
| ((
|
156
|
-
error: unknown,
|
157
|
-
errorInfo: {
|
158
|
-
componentStack?: string | undefined;
|
159
|
-
errorBoundary?: React.Component<unknown> | undefined;
|
160
|
-
},
|
161
|
-
) => void)
|
162
|
-
| undefined;
|
163
|
-
}
|
164
|
-
|
165
|
-
interface HydrationOptions {
|
166
|
-
formState?: ReactFormState | null;
|
167
|
-
onUncaughtError?:
|
168
|
-
| ((error: unknown, errorInfo: { componentStack?: string | undefined }) => void)
|
169
|
-
| undefined;
|
170
|
-
onCaughtError?:
|
171
|
-
| ((
|
172
|
-
error: unknown,
|
173
|
-
errorInfo: {
|
174
|
-
componentStack?: string | undefined;
|
175
|
-
errorBoundary?: React.Component<unknown> | undefined;
|
176
|
-
},
|
177
|
-
) => void)
|
178
|
-
| undefined;
|
179
|
-
}
|
180
|
-
|
181
|
-
interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_CREATE_ROOT_CONTAINERS {
|
182
|
-
document: Document;
|
183
|
-
}
|
184
|
-
}
|
react-dom/experimental.d.ts
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* These are types for things that are present in the `experimental` builds of React but not yet
|
3
|
-
* on a stable build.
|
4
|
-
*
|
5
|
-
* Once they are promoted to stable they can just be moved to the main index file.
|
6
|
-
*
|
7
|
-
* To load the types declared here in an actual project, there are three ways. The easiest one,
|
8
|
-
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
|
9
|
-
* is to add `"react-dom/experimental"` to the `"types"` array.
|
10
|
-
*
|
11
|
-
* Alternatively, a specific import syntax can to be used from a typescript file.
|
12
|
-
* This module does not exist in reality, which is why the {} is important:
|
13
|
-
*
|
14
|
-
* ```ts
|
15
|
-
* import {} from 'react-dom/experimental'
|
16
|
-
* ```
|
17
|
-
*
|
18
|
-
* It is also possible to include it through a triple-slash reference:
|
19
|
-
*
|
20
|
-
* ```ts
|
21
|
-
* /// <reference types="react-dom/experimental" />
|
22
|
-
* ```
|
23
|
-
*
|
24
|
-
* Either the import or the reference only needs to appear once, anywhere in the project.
|
25
|
-
*/
|
26
|
-
|
27
|
-
// See https://github.com/facebook/react/blob/main/packages/react-dom/index.experimental.js to see how the exports are declared,
|
28
|
-
// but confirm with published source code (e.g. https://unpkg.com/react-dom@experimental) that these exports end up in the published code
|
29
|
-
|
30
|
-
import React = require("react");
|
31
|
-
import ReactDOM = require("./canary");
|
32
|
-
|
33
|
-
export {};
|
34
|
-
|
35
|
-
declare module "." {
|
36
|
-
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|