@types/react-dom 19.1.9 → 19.1.11
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 +1 -1
- react-dom/canary.d.ts +67 -0
- react-dom/package.json +2 -2
- react-dom/server.d.ts +46 -2
- react-dom/static.d.ts +38 -2
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:
|
|
11
|
+
* Last updated: Wed, 01 Oct 2025 17:34:27 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
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @definitelytyped/no-self-import -- self-imports in module augmentations aren't self-imports */
|
|
2
|
+
/* eslint-disable @definitelytyped/no-declare-current-package -- The module augmentations are optional */
|
|
1
3
|
/**
|
|
2
4
|
* These are types for things that are present in the upcoming React 18 release.
|
|
3
5
|
*
|
|
@@ -35,3 +37,68 @@ declare module "react" {
|
|
|
35
37
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
36
38
|
interface CacheSignal extends AbortSignal {}
|
|
37
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/react-dom",
|
|
3
|
-
"version": "19.1.
|
|
3
|
+
"version": "19.1.11",
|
|
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",
|
|
@@ -123,6 +123,6 @@
|
|
|
123
123
|
"peerDependencies": {
|
|
124
124
|
"@types/react": "^19.0.0"
|
|
125
125
|
},
|
|
126
|
-
"typesPublisherContentHash": "
|
|
126
|
+
"typesPublisherContentHash": "df97d62b7c8884b591468a10b2188d6a5a1f7767ccab6c0a7248e2cfdbe534e6",
|
|
127
127
|
"typeScriptVersion": "5.2"
|
|
128
128
|
}
|
react-dom/server.d.ts
CHANGED
|
@@ -24,11 +24,39 @@ declare global {
|
|
|
24
24
|
import { ReactNode } from "react";
|
|
25
25
|
import { ErrorInfo, ReactFormState } from "./client";
|
|
26
26
|
|
|
27
|
-
export
|
|
27
|
+
export interface BootstrapScriptDescriptor {
|
|
28
28
|
src: string;
|
|
29
29
|
integrity?: string | undefined;
|
|
30
30
|
crossOrigin?: string | undefined;
|
|
31
|
-
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap Import maps}
|
|
35
|
+
*/
|
|
36
|
+
// TODO: Ideally TypeScripts standard library would include this type.
|
|
37
|
+
// Until then we keep the prefixed one for future compatibility.
|
|
38
|
+
export interface ReactImportMap {
|
|
39
|
+
/**
|
|
40
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#imports `imports` reference}
|
|
41
|
+
*/
|
|
42
|
+
imports?: {
|
|
43
|
+
[specifier: string]: string;
|
|
44
|
+
} | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#integrity `integrity` reference}
|
|
47
|
+
*/
|
|
48
|
+
integrity?: {
|
|
49
|
+
[moduleURL: string]: string;
|
|
50
|
+
} | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#scopes `scopes` reference}
|
|
53
|
+
*/
|
|
54
|
+
scopes?: {
|
|
55
|
+
[scope: string]: {
|
|
56
|
+
[specifier: string]: string;
|
|
57
|
+
};
|
|
58
|
+
} | undefined;
|
|
59
|
+
}
|
|
32
60
|
|
|
33
61
|
export interface RenderToPipeableStreamOptions {
|
|
34
62
|
identifierPrefix?: string;
|
|
@@ -37,7 +65,15 @@ export interface RenderToPipeableStreamOptions {
|
|
|
37
65
|
bootstrapScriptContent?: string;
|
|
38
66
|
bootstrapScripts?: Array<string | BootstrapScriptDescriptor>;
|
|
39
67
|
bootstrapModules?: Array<string | BootstrapScriptDescriptor>;
|
|
68
|
+
/**
|
|
69
|
+
* Maximum length of the header content in unicode code units i.e. string.length.
|
|
70
|
+
* Must be a positive integer if specified.
|
|
71
|
+
* @default 2000
|
|
72
|
+
*/
|
|
73
|
+
headersLengthHint?: number | undefined;
|
|
74
|
+
importMap?: ReactImportMap | undefined;
|
|
40
75
|
progressiveChunkSize?: number;
|
|
76
|
+
onHeaders?: ((headers: Headers) => void) | undefined;
|
|
41
77
|
onShellReady?: () => void;
|
|
42
78
|
onShellError?: (error: unknown) => void;
|
|
43
79
|
onAllReady?: () => void;
|
|
@@ -86,14 +122,22 @@ export function renderToStaticMarkup(element: ReactNode, options?: ServerOptions
|
|
|
86
122
|
|
|
87
123
|
export interface RenderToReadableStreamOptions {
|
|
88
124
|
identifierPrefix?: string;
|
|
125
|
+
importMap?: ReactImportMap | undefined;
|
|
89
126
|
namespaceURI?: string;
|
|
90
127
|
nonce?: string;
|
|
91
128
|
bootstrapScriptContent?: string;
|
|
92
129
|
bootstrapScripts?: Array<string | BootstrapScriptDescriptor>;
|
|
93
130
|
bootstrapModules?: Array<string | BootstrapScriptDescriptor>;
|
|
131
|
+
/**
|
|
132
|
+
* Maximum length of the header content in unicode code units i.e. string.length.
|
|
133
|
+
* Must be a positive integer if specified.
|
|
134
|
+
* @default 2000
|
|
135
|
+
*/
|
|
136
|
+
headersLengthHint?: number | undefined;
|
|
94
137
|
progressiveChunkSize?: number;
|
|
95
138
|
signal?: AbortSignal;
|
|
96
139
|
onError?: (error: unknown, errorInfo: ErrorInfo) => string | void;
|
|
140
|
+
onHeaders?: ((headers: Headers) => void) | undefined;
|
|
97
141
|
formState?: ReactFormState | null;
|
|
98
142
|
}
|
|
99
143
|
|
react-dom/static.d.ts
CHANGED
|
@@ -27,19 +27,55 @@ declare global {
|
|
|
27
27
|
import { ReactNode } from "react";
|
|
28
28
|
import { ErrorInfo } from "./client";
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap Import maps}
|
|
32
|
+
*/
|
|
33
|
+
// TODO: Ideally TypeScripts standard library would include this type.
|
|
34
|
+
// Until then we keep the prefixed one for future compatibility.
|
|
35
|
+
export interface ReactImportMap {
|
|
36
|
+
/**
|
|
37
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#imports `imports` reference}
|
|
38
|
+
*/
|
|
39
|
+
imports?: {
|
|
40
|
+
[specifier: string]: string;
|
|
41
|
+
} | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#integrity `integrity` reference}
|
|
44
|
+
*/
|
|
45
|
+
integrity?: {
|
|
46
|
+
[moduleURL: string]: string;
|
|
47
|
+
} | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#scopes `scopes` reference}
|
|
50
|
+
*/
|
|
51
|
+
scopes?: {
|
|
52
|
+
[scope: string]: {
|
|
53
|
+
[specifier: string]: string;
|
|
54
|
+
};
|
|
55
|
+
} | undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface BootstrapScriptDescriptor {
|
|
31
59
|
src: string;
|
|
32
60
|
integrity?: string | undefined;
|
|
33
61
|
crossOrigin?: string | undefined;
|
|
34
|
-
}
|
|
62
|
+
}
|
|
35
63
|
|
|
36
64
|
export interface PrerenderOptions {
|
|
37
65
|
bootstrapScriptContent?: string;
|
|
38
66
|
bootstrapScripts?: Array<string | BootstrapScriptDescriptor>;
|
|
39
67
|
bootstrapModules?: Array<string | BootstrapScriptDescriptor>;
|
|
68
|
+
/**
|
|
69
|
+
* Maximum length of the header content in unicode code units i.e. string.length.
|
|
70
|
+
* Must be a positive integer if specified.
|
|
71
|
+
* @default 2000
|
|
72
|
+
*/
|
|
73
|
+
headersLengthHint?: number | undefined;
|
|
40
74
|
identifierPrefix?: string;
|
|
75
|
+
importMap?: ImportMap | undefined;
|
|
41
76
|
namespaceURI?: string;
|
|
42
77
|
onError?: (error: unknown, errorInfo: ErrorInfo) => string | void;
|
|
78
|
+
onHeaders?: (headers: Headers) => void | undefined;
|
|
43
79
|
progressiveChunkSize?: number;
|
|
44
80
|
signal?: AbortSignal;
|
|
45
81
|
}
|