@@ -4,6 +4,8 @@ type nodeStream // NodeJs.Stream.stream
44
55type readableStream // WebAPI.FileAPI.readableStream
66
7+ type postponedState
8+
79type prerenderOptions <'error > = {
810 bootstrapScriptContent ?: string ,
911 bootstrapScripts ?: array <string >,
@@ -15,16 +17,46 @@ type prerenderOptions<'error> = {
1517 signal ?: abortSignal ,
1618}
1719
18- type staticResult = {prelude : readableStream }
20+ type staticResult = {prelude : readableStream , postponed : postponedState }
1921
22+ /**
23+ prerender renders a React tree to a static HTML string using a Web Stream.
24+ [Read more on the React Documentation](https://react.dev/reference/react-dom/static/prerender)
25+ */
2026@module ("react-dom/static" )
2127external prerender : (React .element , ~options : prerenderOptions <'error >= ?) => promise <staticResult > =
2228 "prerender"
2329
24- type staticResultNode = {prelude : nodeStream }
30+ /**
31+ resumeAndPrerender continues a prerendered React tree to a static HTML string using a Web Stream.
32+ [Read more on the React Documentation](https://react.dev/reference/react-dom/static/resumeAndPrerender)
33+ */
34+ @module ("react-dom/static" )
35+ external resumeAndPrerender : (
36+ React .element ,
37+ postponedState ,
38+ ~options : prerenderOptions <'error >= ?,
39+ ) => promise <staticResult > = "resumeAndPrerender"
40+
41+ type staticResultNode = {prelude : nodeStream , postponed : postponedState }
2542
43+ /**
44+ prerenderToNodeStream renders a React tree to a static HTML string using a Node.js Stream.
45+ [Read more on the React Documentation](https://react.dev/reference/react-dom/static/prerenderToNodeStream)
46+ */
2647@module ("react-dom/static" )
2748external prerenderToNodeStream : (
2849 React .element ,
2950 ~options : prerenderOptions <'error >= ?,
3051) => promise <staticResultNode > = "prerenderToNodeStream"
52+
53+ /**
54+ resumeAndPrerenderToNodeStream continues a prerendered React tree to a static HTML string using a a Node.js Stream.
55+ [Read more on the React Documentation](https://react.dev/reference/react-dom/static/resumeAndPrerenderToNodeStream)
56+ */
57+ @module ("react-dom/static" )
58+ external resumeAndPrerenderToNodeStream : (
59+ React .element ,
60+ postponedState ,
61+ ~options : prerenderOptions <'error >= ?,
62+ ) => promise <staticResultNode > = "resumeAndPrerenderToNodeStream"
0 commit comments