@types/react-dom 19.1.10 → 19.2.0

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 CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for react-dom (https://react.dev/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 01 Oct 2025 17:02:25 GMT
11
+ * Last updated: Wed, 01 Oct 2025 22:02:19 GMT
12
12
  * Dependencies: none
13
13
  * Peer dependencies: [@types/react](https://npmjs.com/package/@types/react)
14
14
 
react-dom/canary.d.ts CHANGED
@@ -32,73 +32,3 @@ import React = require("react");
32
32
  import ReactDOM = require(".");
33
33
 
34
34
  export {};
35
-
36
- declare module "react" {
37
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
38
- interface CacheSignal extends AbortSignal {}
39
- }
40
-
41
- declare const POSTPONED_STATE_SIGIL: unique symbol;
42
- declare module "react-dom/static" {
43
- /**
44
- * This is an opaque type i.e. users should not make any assumptions about its structure.
45
- * It is JSON-serializeable to be a able to store it and retrvieve later for use with {@link https://react.dev/reference/react-dom/server/resume `resume`}.
46
- */
47
- interface PostponedState {
48
- [POSTPONED_STATE_SIGIL]: never;
49
- }
50
-
51
- interface ResumeOptions {
52
- nonce?: string;
53
- signal?: AbortSignal;
54
- onError?: (error: unknown) => string | undefined | void;
55
- }
56
-
57
- interface PrerenderResult {
58
- postponed: null | PostponedState;
59
- }
60
- /**
61
- * @see {@link https://react.dev/reference/react-dom/static/resumeAndPrerender `resumeAndPrerender` reference documentation}
62
- * @version 19.2
63
- */
64
- function resumeAndPrerender(
65
- children: React.ReactNode,
66
- postponedState: PostponedState,
67
- options?: Omit<ResumeOptions, "nonce">,
68
- ): Promise<PrerenderResult>;
69
-
70
- interface PrerenderToNodeStreamResult {
71
- postponed: null | PostponedState;
72
- }
73
- /**
74
- * @see {@link https://react.dev/reference/react-dom/static/resumeAndPrerenderToNodeStream `resumeAndPrerenderToNodeStream`` reference documentation}
75
- * @version 19.2
76
- */
77
- function resumeAndPrerenderToNodeStream(
78
- children: React.ReactNode,
79
- postponedState: PostponedState,
80
- options?: Omit<ResumeOptions, "nonce">,
81
- ): Promise<PrerenderToNodeStreamResult>;
82
- }
83
-
84
- import { PostponedState, ResumeOptions } from "react-dom/static";
85
- declare module "react-dom/server" {
86
- /**
87
- * @see {@link https://react.dev/reference/react-dom/server/resume `resume`` reference documentation}
88
- * @version 19.2
89
- */
90
- function resume(
91
- children: React.ReactNode,
92
- postponedState: PostponedState,
93
- options?: ResumeOptions,
94
- ): Promise<ReactDOMServerReadableStream>;
95
- /**
96
- * @see {@link https://react.dev/reference/react-dom/server/resumeToPipeableStream `resumeToPipeableStream`` reference documentation}
97
- * @version 19.2
98
- */
99
- function resumeToPipeableStream(
100
- children: React.ReactNode,
101
- postponedState: PostponedState,
102
- options?: ResumeOptions,
103
- ): Promise<PipeableStream>;
104
- }
react-dom/index.d.ts CHANGED
@@ -6,6 +6,11 @@ export as namespace ReactDOM;
6
6
 
7
7
  import { Key, ReactNode, ReactPortal } from "react";
8
8
 
9
+ declare module "react" {
10
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
11
+ interface CacheSignal extends AbortSignal {}
12
+ }
13
+
9
14
  export function createPortal(
10
15
  children: ReactNode,
11
16
  container: Element | DocumentFragment,
react-dom/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react-dom",
3
- "version": "19.1.10",
3
+ "version": "19.2.0",
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",
@@ -121,8 +121,8 @@
121
121
  "scripts": {},
122
122
  "dependencies": {},
123
123
  "peerDependencies": {
124
- "@types/react": "^19.0.0"
124
+ "@types/react": "^19.2.0"
125
125
  },
126
- "typesPublisherContentHash": "5dee0b9e44666864c50b2581f281f3fbf396f9059b30dca24ba1fdc1d19ca2e0",
126
+ "typesPublisherContentHash": "4a296bd89e24edb236357aa2daf5e5f23648fa3270267dfef1e71cafb2822417",
127
127
  "typeScriptVersion": "5.2"
128
128
  }
react-dom/server.d.ts CHANGED
@@ -23,12 +23,41 @@ declare global {
23
23
 
24
24
  import { ReactNode } from "react";
25
25
  import { ErrorInfo, ReactFormState } from "./client";
26
+ import { PostponedState, ResumeOptions } from "./static";
26
27
 
27
- export type BootstrapScriptDescriptor = {
28
+ export interface BootstrapScriptDescriptor {
28
29
  src: string;
29
30
  integrity?: string | undefined;
30
31
  crossOrigin?: string | undefined;
31
- };
32
+ }
33
+
34
+ /**
35
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap Import maps}
36
+ */
37
+ // TODO: Ideally TypeScripts standard library would include this type.
38
+ // Until then we keep the prefixed one for future compatibility.
39
+ export interface ReactImportMap {
40
+ /**
41
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#imports `imports` reference}
42
+ */
43
+ imports?: {
44
+ [specifier: string]: string;
45
+ } | undefined;
46
+ /**
47
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#integrity `integrity` reference}
48
+ */
49
+ integrity?: {
50
+ [moduleURL: string]: string;
51
+ } | undefined;
52
+ /**
53
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#scopes `scopes` reference}
54
+ */
55
+ scopes?: {
56
+ [scope: string]: {
57
+ [specifier: string]: string;
58
+ };
59
+ } | undefined;
60
+ }
32
61
 
33
62
  export interface RenderToPipeableStreamOptions {
34
63
  identifierPrefix?: string;
@@ -37,7 +66,15 @@ export interface RenderToPipeableStreamOptions {
37
66
  bootstrapScriptContent?: string;
38
67
  bootstrapScripts?: Array<string | BootstrapScriptDescriptor>;
39
68
  bootstrapModules?: Array<string | BootstrapScriptDescriptor>;
69
+ /**
70
+ * Maximum length of the header content in unicode code units i.e. string.length.
71
+ * Must be a positive integer if specified.
72
+ * @default 2000
73
+ */
74
+ headersLengthHint?: number | undefined;
75
+ importMap?: ReactImportMap | undefined;
40
76
  progressiveChunkSize?: number;
77
+ onHeaders?: ((headers: Headers) => void) | undefined;
41
78
  onShellReady?: () => void;
42
79
  onShellError?: (error: unknown) => void;
43
80
  onAllReady?: () => void;
@@ -86,14 +123,22 @@ export function renderToStaticMarkup(element: ReactNode, options?: ServerOptions
86
123
 
87
124
  export interface RenderToReadableStreamOptions {
88
125
  identifierPrefix?: string;
126
+ importMap?: ReactImportMap | undefined;
89
127
  namespaceURI?: string;
90
128
  nonce?: string;
91
129
  bootstrapScriptContent?: string;
92
130
  bootstrapScripts?: Array<string | BootstrapScriptDescriptor>;
93
131
  bootstrapModules?: Array<string | BootstrapScriptDescriptor>;
132
+ /**
133
+ * Maximum length of the header content in unicode code units i.e. string.length.
134
+ * Must be a positive integer if specified.
135
+ * @default 2000
136
+ */
137
+ headersLengthHint?: number | undefined;
94
138
  progressiveChunkSize?: number;
95
139
  signal?: AbortSignal;
96
140
  onError?: (error: unknown, errorInfo: ErrorInfo) => string | void;
141
+ onHeaders?: ((headers: Headers) => void) | undefined;
97
142
  formState?: ReactFormState | null;
98
143
  }
99
144
 
@@ -111,6 +156,28 @@ export function renderToReadableStream(
111
156
  options?: RenderToReadableStreamOptions,
112
157
  ): Promise<ReactDOMServerReadableStream>;
113
158
 
159
+ export { ResumeOptions };
160
+
161
+ /**
162
+ * @see {@link https://react.dev/reference/react-dom/server/resume `resume`` reference documentation}
163
+ * @version 19.2
164
+ */
165
+ export function resume(
166
+ children: React.ReactNode,
167
+ postponedState: PostponedState,
168
+ options?: ResumeOptions,
169
+ ): Promise<ReactDOMServerReadableStream>;
170
+
171
+ /**
172
+ * @see {@link https://react.dev/reference/react-dom/server/resumeToPipeableStream `resumeToPipeableStream`` reference documentation}
173
+ * @version 19.2
174
+ */
175
+ export function resumeToPipeableStream(
176
+ children: React.ReactNode,
177
+ postponedState: PostponedState,
178
+ options?: ResumeOptions,
179
+ ): Promise<PipeableStream>;
180
+
114
181
  export const version: string;
115
182
 
116
183
  export as namespace ReactDOMServer;
@@ -1 +1 @@
1
- export { renderToReadableStream, renderToStaticMarkup, renderToString } from "./server";
1
+ export { renderToReadableStream, renderToStaticMarkup, renderToString, resume } from "./server";
@@ -1 +1,8 @@
1
- export { renderToPipeableStream, renderToStaticMarkup, renderToString } from "./server";
1
+ export {
2
+ renderToPipeableStream,
3
+ renderToReadableStream,
4
+ renderToStaticMarkup,
5
+ renderToString,
6
+ resume,
7
+ resumeToPipeableStream,
8
+ } from "./server";
react-dom/static.d.ts CHANGED
@@ -26,25 +26,73 @@ declare global {
26
26
 
27
27
  import { ReactNode } from "react";
28
28
  import { ErrorInfo } from "./client";
29
+ export {};
29
30
 
30
- export type BootstrapScriptDescriptor = {
31
+ declare const POSTPONED_STATE_SIGIL: unique symbol;
32
+
33
+ /**
34
+ * This is an opaque type i.e. users should not make any assumptions about its structure.
35
+ * It is JSON-serializeable to be a able to store it and retrvieve later for use with {@link https://react.dev/reference/react-dom/server/resume `resume`}.
36
+ */
37
+ export interface PostponedState {
38
+ [POSTPONED_STATE_SIGIL]: never;
39
+ }
40
+
41
+ /**
42
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap Import maps}
43
+ */
44
+ // TODO: Ideally TypeScripts standard library would include this type.
45
+ // Until then we keep the prefixed one for future compatibility.
46
+ export interface ReactImportMap {
47
+ /**
48
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#imports `imports` reference}
49
+ */
50
+ imports?: {
51
+ [specifier: string]: string;
52
+ } | undefined;
53
+ /**
54
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#integrity `integrity` reference}
55
+ */
56
+ integrity?: {
57
+ [moduleURL: string]: string;
58
+ } | undefined;
59
+ /**
60
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#scopes `scopes` reference}
61
+ */
62
+ scopes?: {
63
+ [scope: string]: {
64
+ [specifier: string]: string;
65
+ };
66
+ } | undefined;
67
+ }
68
+
69
+ export interface BootstrapScriptDescriptor {
31
70
  src: string;
32
71
  integrity?: string | undefined;
33
72
  crossOrigin?: string | undefined;
34
- };
73
+ }
35
74
 
36
75
  export interface PrerenderOptions {
37
76
  bootstrapScriptContent?: string;
38
77
  bootstrapScripts?: Array<string | BootstrapScriptDescriptor>;
39
78
  bootstrapModules?: Array<string | BootstrapScriptDescriptor>;
79
+ /**
80
+ * Maximum length of the header content in unicode code units i.e. string.length.
81
+ * Must be a positive integer if specified.
82
+ * @default 2000
83
+ */
84
+ headersLengthHint?: number | undefined;
40
85
  identifierPrefix?: string;
86
+ importMap?: ReactImportMap | undefined;
41
87
  namespaceURI?: string;
42
88
  onError?: (error: unknown, errorInfo: ErrorInfo) => string | void;
89
+ onHeaders?: (headers: Headers) => void | undefined;
43
90
  progressiveChunkSize?: number;
44
91
  signal?: AbortSignal;
45
92
  }
46
93
 
47
94
  export interface PrerenderResult {
95
+ postponed: null | PostponedState;
48
96
  prelude: ReadableStream<Uint8Array>;
49
97
  }
50
98
 
@@ -60,6 +108,7 @@ export function prerender(
60
108
 
61
109
  export interface PrerenderToNodeStreamResult {
62
110
  prelude: NodeJS.ReadableStream;
111
+ postponed: null | PostponedState;
63
112
  }
64
113
 
65
114
  /**
@@ -75,4 +124,30 @@ export function prerenderToNodeStream(
75
124
  options?: PrerenderOptions,
76
125
  ): Promise<PrerenderToNodeStreamResult>;
77
126
 
127
+ export interface ResumeOptions {
128
+ nonce?: string;
129
+ signal?: AbortSignal;
130
+ onError?: (error: unknown) => string | undefined | void;
131
+ }
132
+
133
+ /**
134
+ * @see {@link https://react.dev/reference/react-dom/static/resumeAndPrerender `resumeAndPrerender` reference documentation}
135
+ * @version 19.2
136
+ */
137
+ export function resumeAndPrerender(
138
+ children: React.ReactNode,
139
+ postponedState: null | PostponedState,
140
+ options?: Omit<ResumeOptions, "nonce">,
141
+ ): Promise<PrerenderResult>;
142
+
143
+ /**
144
+ * @see {@link https://react.dev/reference/react-dom/static/resumeAndPrerenderToNodeStream `resumeAndPrerenderToNodeStream`` reference documentation}
145
+ * @version 19.2
146
+ */
147
+ export function resumeAndPrerenderToNodeStream(
148
+ children: React.ReactNode,
149
+ postponedState: null | PostponedState,
150
+ options?: Omit<ResumeOptions, "nonce">,
151
+ ): Promise<PrerenderToNodeStreamResult>;
152
+
78
153
  export const version: string;
@@ -1 +1 @@
1
- export { prerender, version } from "./static";
1
+ export { prerender, resumeAndPrerender, version } from "./static";
@@ -1 +1,7 @@
1
- export { prerenderToNodeStream, version } from "./static";
1
+ export {
2
+ prerender,
3
+ prerenderToNodeStream,
4
+ resumeAndPrerender,
5
+ resumeAndPrerenderToNodeStream,
6
+ version,
7
+ } from "./static";