@rust-js/resources 0.0.1

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.
@@ -0,0 +1,542 @@
1
+ //! [React DOM](https://react.dev/reference/react-dom): portals, resource
2
+ //! hints and forms here; putting React on a page in [`client`]; rendering to
3
+ //! HTML in [`server`] and [`prerender`] (`react-dom/static`).
4
+
5
+ use super::*;
6
+
7
+ /// [`createPortal`](https://react.dev/reference/react-dom/createPortal):
8
+ /// `children`, rendered into `container`, somewhere else in the DOM. Events
9
+ /// still bubble through the React tree.
10
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom#createPortal")]
11
+ pub fn create_portal(children: impl Node, container: &webapi::Element) -> Element {
12
+ unreachable!()
13
+ }
14
+
15
+ /// `createPortal(children, container, key)`.
16
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom#createPortal")]
17
+ pub fn create_portal_with_key(children: impl Node, container: &webapi::Element, key: impl Key) -> Element {
18
+ unreachable!()
19
+ }
20
+
21
+ /// [`flushSync`](https://react.dev/reference/react-dom/flushSync): apply the
22
+ /// updates in `f` to the DOM before returning.
23
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom#flushSync")]
24
+ pub fn flush_sync(f: impl FnOnce() + 'static) {
25
+ unreachable!()
26
+ }
27
+
28
+ unsafe extern "Rust" {
29
+ /// React DOM's version, like `"19.3.0"`.
30
+ #[link_name = "react-dom#version"]
31
+ pub safe static VERSION: &'static str;
32
+ }
33
+
34
+ // ── Resource hints ──────────────────────────────────────────────────────
35
+
36
+ /// [`prefetchDNS`](https://react.dev/reference/react-dom/prefetchDNS): look up
37
+ /// a server's IP address early.
38
+ #[cfg(react = "19.0")]
39
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom#prefetchDNS")]
40
+ pub fn prefetch_dns(href: &str) {
41
+ unreachable!()
42
+ }
43
+
44
+ /// [`preconnect`](https://react.dev/reference/react-dom/preconnect): connect
45
+ /// to a server early.
46
+ #[cfg(react = "19.0")]
47
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom#preconnect")]
48
+ pub fn preconnect(href: &str) {
49
+ unreachable!()
50
+ }
51
+
52
+ /// What a resource is, for [`preload`] and [`preinit`].
53
+ #[cfg(react = "19.0")]
54
+ pub enum As {
55
+ #[cfg_attr(rust_js, rust_js::name = "audio")]
56
+ Audio,
57
+ #[cfg_attr(rust_js, rust_js::name = "document")]
58
+ Document,
59
+ #[cfg_attr(rust_js, rust_js::name = "embed")]
60
+ Embed,
61
+ #[cfg_attr(rust_js, rust_js::name = "fetch")]
62
+ Fetch,
63
+ #[cfg_attr(rust_js, rust_js::name = "font")]
64
+ Font,
65
+ #[cfg_attr(rust_js, rust_js::name = "image")]
66
+ Image,
67
+ #[cfg_attr(rust_js, rust_js::name = "object")]
68
+ Object,
69
+ #[cfg_attr(rust_js, rust_js::name = "script")]
70
+ Script,
71
+ #[cfg_attr(rust_js, rust_js::name = "style")]
72
+ Style,
73
+ #[cfg_attr(rust_js, rust_js::name = "track")]
74
+ Track,
75
+ #[cfg_attr(rust_js, rust_js::name = "video")]
76
+ Video,
77
+ #[cfg_attr(rust_js, rust_js::name = "worker")]
78
+ Worker,
79
+ }
80
+
81
+ /// Declares an options object: `new(..)` makes it with its required fields,
82
+ /// and a method per optional one.
83
+ macro_rules! options {
84
+ ($(#[doc = $doc:literal])* $(#[cfg($cfg:meta)])? $name:ident($new:literal $(, $arg:ident: $argty:ty)*) { $($(#[doc = $fdoc:literal])* $(#[cfg($fcfg:meta)])? $field:ident: $ty:ty = $js:literal;)* }) => {
85
+ $(#[doc = $doc])*
86
+ $(#[cfg($cfg)])?
87
+ pub struct $name(PhantomData<JsObject>);
88
+
89
+ $(#[cfg($cfg)])?
90
+ impl $name {
91
+ #[cfg_attr(rust_js, rust_js::link_name = $new)]
92
+ pub fn new($($arg: $argty),*) -> $name {
93
+ unreachable!()
94
+ }
95
+
96
+ $(
97
+ $(#[doc = $fdoc])*
98
+ $(#[cfg($fcfg)])?
99
+ #[cfg_attr(rust_js, rust_js::link_name = concat!("prop ", $js))]
100
+ pub fn $field(self, value: $ty) -> $name {
101
+ unreachable!()
102
+ }
103
+ )*
104
+ }
105
+ };
106
+ }
107
+
108
+ options! {
109
+ /// [`preload`]'s options: `PreloadOptions::new(As::Font)`.
110
+ #[cfg(react = "19.0")]
111
+ PreloadOptions("{as}", r#as: As) {
112
+ /// `"anonymous"` or `"use-credentials"`; needed for `As::Fetch`.
113
+ cross_origin: impl Value = "crossOrigin";
114
+ referrer_policy: impl Value = "referrerPolicy";
115
+ integrity: impl Value = "integrity";
116
+ /// Its MIME type.
117
+ r#type: impl Value = "type";
118
+ nonce: impl Value = "nonce";
119
+ /// `"auto"`, `"high"` or `"low"`.
120
+ fetch_priority: impl Value = "fetchPriority";
121
+ /// For `As::Image`.
122
+ image_src_set: impl Value = "imageSrcSet";
123
+ image_sizes: impl Value = "imageSizes";
124
+ }
125
+ }
126
+
127
+ /// [`preload`](https://react.dev/reference/react-dom/preload): fetch a
128
+ /// resource you'll need soon.
129
+ #[cfg(react = "19.0")]
130
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom#preload")]
131
+ pub fn preload(href: &str, options: PreloadOptions) {
132
+ unreachable!()
133
+ }
134
+
135
+ options! {
136
+ /// [`preload_module`]'s and [`preinit_module`]'s options.
137
+ #[cfg(react = "19.0")]
138
+ ModuleOptions("{}") {
139
+ cross_origin: impl Value = "crossOrigin";
140
+ integrity: impl Value = "integrity";
141
+ nonce: impl Value = "nonce";
142
+ }
143
+ }
144
+
145
+ /// [`preloadModule`](https://react.dev/reference/react-dom/preloadModule):
146
+ /// fetch an ES module you'll need soon.
147
+ #[cfg(react = "19.0")]
148
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom#preloadModule")]
149
+ pub fn preload_module(href: &str, options: ModuleOptions) {
150
+ unreachable!()
151
+ }
152
+
153
+ /// What [`preinit`] loads: a script or a stylesheet.
154
+ #[cfg(react = "19.0")]
155
+ pub enum Init {
156
+ #[cfg_attr(rust_js, rust_js::name = "script")]
157
+ Script,
158
+ #[cfg_attr(rust_js, rust_js::name = "style")]
159
+ Style,
160
+ }
161
+
162
+ options! {
163
+ /// [`preinit`]'s options: `PreinitOptions::new(Init::Style).precedence("high")`.
164
+ #[cfg(react = "19.0")]
165
+ PreinitOptions("{as}", r#as: Init) {
166
+ /// A stylesheet's place among others: `"reset"`, `"low"`, `"medium"`
167
+ /// or `"high"`. A stylesheet needs one.
168
+ precedence: impl Value = "precedence";
169
+ cross_origin: impl Value = "crossOrigin";
170
+ integrity: impl Value = "integrity";
171
+ nonce: impl Value = "nonce";
172
+ fetch_priority: impl Value = "fetchPriority";
173
+ }
174
+ }
175
+
176
+ /// [`preinit`](https://react.dev/reference/react-dom/preinit): fetch and run
177
+ /// a script, or insert a stylesheet, early.
178
+ #[cfg(react = "19.0")]
179
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom#preinit")]
180
+ pub fn preinit(href: &str, options: PreinitOptions) {
181
+ unreachable!()
182
+ }
183
+
184
+ /// [`preinitModule`](https://react.dev/reference/react-dom/preinitModule):
185
+ /// fetch and run an ES module early.
186
+ #[cfg(react = "19.0")]
187
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom#preinitModule")]
188
+ pub fn preinit_module(href: &str, options: ModuleOptions) {
189
+ unreachable!()
190
+ }
191
+
192
+ // ── Forms ───────────────────────────────────────────────────────────────
193
+
194
+ /// [`useFormStatus`](https://react.dev/reference/react-dom/hooks/useFormStatus):
195
+ /// the last submission of the `<form>` this component is in.
196
+ #[cfg(react = "19.0")]
197
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom#useFormStatus")]
198
+ pub fn use_form_status() -> &'static FormStatus {
199
+ unreachable!()
200
+ }
201
+
202
+ /// What [`use_form_status`] gives.
203
+ #[cfg(react = "19.0")]
204
+ pub struct FormStatus(PhantomData<JsObject>);
205
+
206
+ #[cfg(react = "19.0")]
207
+ impl FormStatus {
208
+ /// Whether the form is being submitted.
209
+ #[cfg_attr(rust_js, rust_js::link_name = "get pending")]
210
+ pub fn pending(&self) -> bool {
211
+ unreachable!()
212
+ }
213
+
214
+ /// What it's submitting, while it is.
215
+ #[cfg_attr(rust_js, rust_js::link_name = "get data")]
216
+ pub fn data(&self) -> Option<&'static webapi::FormData> {
217
+ unreachable!()
218
+ }
219
+
220
+ /// `"get"` or `"post"`.
221
+ #[cfg_attr(rust_js, rust_js::link_name = "get method")]
222
+ pub fn method(&self) -> String {
223
+ unreachable!()
224
+ }
225
+ }
226
+
227
+ /// [`requestFormReset`](https://react.dev/reference/react-dom/requestFormReset):
228
+ /// reset `form` once the current Transition is done.
229
+ #[cfg(react = "19.0")]
230
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom#requestFormReset")]
231
+ pub fn request_form_reset(form: &webapi::HtmlFormElement) {
232
+ unreachable!()
233
+ }
234
+
235
+ /// What [`browser`] marks: content that only renders in the browser.
236
+ #[cfg(react = "19.3")]
237
+ pub struct Browser(PhantomData<JsObject>);
238
+
239
+ #[cfg(react = "19.3")]
240
+ impl Usable for Browser {
241
+ type Output = ();
242
+ }
243
+
244
+ /// [`browser`](https://react.dev/reference/react-dom/browser): `use_(browser(reason))`
245
+ /// renders a component only in the browser. On the server, the nearest
246
+ /// [`suspense`]'s fallback shows instead, and `reason` says why.
247
+ #[cfg(react = "19.3")]
248
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom#browser")]
249
+ pub fn browser(reason: &str) -> Browser {
250
+ unreachable!()
251
+ }
252
+
253
+ // ── react-dom/client ────────────────────────────────────────────────────
254
+
255
+ /// [`react-dom/client`](https://react.dev/reference/react-dom/client): putting
256
+ /// React on a page.
257
+ pub mod client {
258
+ use super::*;
259
+
260
+ /// Where React renders, made by [`create_root`] or [`hydrate_root`].
261
+ pub struct Root(PhantomData<JsObject>);
262
+
263
+ impl Root {
264
+ /// Show `children` in the root's element, replacing what was there.
265
+ #[cfg_attr(rust_js, rust_js::link_name = "render")]
266
+ pub fn render(&self, children: impl Node) {
267
+ unreachable!()
268
+ }
269
+
270
+ /// Take React off the element.
271
+ #[cfg_attr(rust_js, rust_js::link_name = "unmount")]
272
+ pub fn unmount(&self) {
273
+ unreachable!()
274
+ }
275
+ }
276
+
277
+ options! {
278
+ /// A root's options: what to call on errors, and a prefix for [`use_id`]'s ids.
279
+ RootOptions("{}") {
280
+ /// An error an error boundary caught.
281
+ on_caught_error: impl Fn(&Error, &ErrorInfo) + 'static = "onCaughtError";
282
+ /// An error nothing caught.
283
+ on_uncaught_error: impl Fn(&Error, &ErrorInfo) + 'static = "onUncaughtError";
284
+ /// An error React recovered from, like a hydration mismatch.
285
+ on_recoverable_error: impl Fn(&Error, &ErrorInfo) + 'static = "onRecoverableError";
286
+ identifier_prefix: impl Value = "identifierPrefix";
287
+ }
288
+ }
289
+
290
+ /// [`createRoot`](https://react.dev/reference/react-dom/client/createRoot).
291
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/client#createRoot")]
292
+ pub fn create_root(container: &webapi::Element) -> &'static Root {
293
+ unreachable!()
294
+ }
295
+
296
+ /// `createRoot(container, options)`.
297
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/client#createRoot")]
298
+ pub fn create_root_with(container: &webapi::Element, options: RootOptions) -> &'static Root {
299
+ unreachable!()
300
+ }
301
+
302
+ /// [`hydrateRoot`](https://react.dev/reference/react-dom/client/hydrateRoot):
303
+ /// attach React to HTML the server rendered from `children`.
304
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/client#hydrateRoot")]
305
+ pub fn hydrate_root(container: &webapi::Element, children: impl Node) -> &'static Root {
306
+ unreachable!()
307
+ }
308
+
309
+ /// `hydrateRoot(container, children, options)`.
310
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/client#hydrateRoot")]
311
+ pub fn hydrate_root_with(container: &webapi::Element, children: impl Node, options: RootOptions) -> &'static Root {
312
+ unreachable!()
313
+ }
314
+ }
315
+
316
+ // ── react-dom/server ────────────────────────────────────────────────────
317
+
318
+ /// [`react-dom/server`](https://react.dev/reference/react-dom/server):
319
+ /// rendering to HTML. Web streams (browsers, Deno, Bun, edge runtimes), or
320
+ /// Node's streams, or a string.
321
+ pub mod server {
322
+ use super::*;
323
+
324
+ options! {
325
+ /// The options of [`render_to_string`] and [`render_to_static_markup`].
326
+ StringOptions("{}") {
327
+ identifier_prefix: impl Value = "identifierPrefix";
328
+ }
329
+ }
330
+
331
+ /// [`renderToString`](https://react.dev/reference/react-dom/server/renderToString):
332
+ /// HTML that [`client::hydrate_root`] can take over. A suspending
333
+ /// component gets its fallback.
334
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/server#renderToString")]
335
+ pub fn render_to_string(children: impl Node) -> String {
336
+ unreachable!()
337
+ }
338
+
339
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/server#renderToString")]
340
+ pub fn render_to_string_with(children: impl Node, options: StringOptions) -> String {
341
+ unreachable!()
342
+ }
343
+
344
+ /// [`renderToStaticMarkup`](https://react.dev/reference/react-dom/server/renderToStaticMarkup):
345
+ /// HTML that won't be hydrated.
346
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/server#renderToStaticMarkup")]
347
+ pub fn render_to_static_markup(children: impl Node) -> String {
348
+ unreachable!()
349
+ }
350
+
351
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/server#renderToStaticMarkup")]
352
+ pub fn render_to_static_markup_with(children: impl Node, options: StringOptions) -> String {
353
+ unreachable!()
354
+ }
355
+
356
+ options! {
357
+ /// How to stream a page: the scripts that hydrate it, and what to
358
+ /// call on errors.
359
+ StreamOptions("{}") {
360
+ bootstrap_script_content: impl Value = "bootstrapScriptContent";
361
+ bootstrap_scripts: Vec<&'static str> = "bootstrapScripts";
362
+ bootstrap_modules: Vec<&'static str> = "bootstrapModules";
363
+ identifier_prefix: impl Value = "identifierPrefix";
364
+ namespace_uri: impl Value = "namespaceURI";
365
+ nonce: impl Value = "nonce";
366
+ /// Called with each error on the server, recovered from or not.
367
+ on_error: impl Fn(&Error) + 'static = "onError";
368
+ progressive_chunk_size: u32 = "progressiveChunkSize";
369
+ /// Stop rendering, and leave the rest to the client.
370
+ signal: &'static webapi::AbortSignal = "signal";
371
+ #[cfg(react = "19.0")]
372
+ max_headers_length: u32 = "maxHeadersLength";
373
+ /// Called with the `Link` headers for the page's preloads.
374
+ #[cfg(react = "19.0")]
375
+ on_headers: impl Fn(&webapi::Headers) + 'static = "onHeaders";
376
+ /// Called when [`browser`] stops a component rendering here.
377
+ #[cfg(react = "19.3")]
378
+ on_browser_bailout: impl Fn(&Error, &ErrorInfo) + 'static = "onBrowserBailout";
379
+ }
380
+ }
381
+
382
+ /// What [`render_to_readable_stream`] gives: a stream of the page's HTML.
383
+ pub struct RenderStream(PhantomData<JsObject>);
384
+
385
+ impl Deref for RenderStream {
386
+ type Target = webapi::ReadableStream;
387
+
388
+ fn deref(&self) -> &webapi::ReadableStream {
389
+ // Never runs: rust-js compiles this `Deref` to the object itself.
390
+ unsafe { &*(self as *const Self as *const webapi::ReadableStream) }
391
+ }
392
+ }
393
+
394
+ impl RenderStream {
395
+ /// Resolves once everything, suspended parts too, is rendered.
396
+ #[cfg_attr(rust_js, rust_js::link_name = "get allReady")]
397
+ pub fn all_ready(&self) -> Promise<()> {
398
+ unreachable!()
399
+ }
400
+ }
401
+
402
+ /// [`renderToReadableStream`](https://react.dev/reference/react-dom/server/renderToReadableStream):
403
+ /// a Web stream of the page's HTML, sent as it's ready. It rejects if the
404
+ /// page's shell fails.
405
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/server#renderToReadableStream")]
406
+ pub fn render_to_readable_stream(children: impl Node, options: StreamOptions) -> Promise<&'static RenderStream> {
407
+ unreachable!()
408
+ }
409
+
410
+ /// [`resume`](https://react.dev/reference/react-dom/server/resume): finish,
411
+ /// as a Web stream, a page [`prerender`] postponed.
412
+ #[cfg(react = "19.2")]
413
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/server#resume")]
414
+ pub fn resume(children: impl Node, postponed: &Postponed, options: StreamOptions) -> Promise<&'static RenderStream> {
415
+ unreachable!()
416
+ }
417
+
418
+ options! {
419
+ /// [`StreamOptions`], for Node's streams, with when the page's shell
420
+ /// and all of it are ready.
421
+ PipeOptions("{}") {
422
+ bootstrap_script_content: impl Value = "bootstrapScriptContent";
423
+ bootstrap_scripts: Vec<&'static str> = "bootstrapScripts";
424
+ bootstrap_modules: Vec<&'static str> = "bootstrapModules";
425
+ identifier_prefix: impl Value = "identifierPrefix";
426
+ namespace_uri: impl Value = "namespaceURI";
427
+ nonce: impl Value = "nonce";
428
+ on_error: impl Fn(&Error) + 'static = "onError";
429
+ progressive_chunk_size: u32 = "progressiveChunkSize";
430
+ /// When the shell is ready: time to [`pipe`](PipeableStream::pipe).
431
+ on_shell_ready: impl Fn() + 'static = "onShellReady";
432
+ on_shell_error: impl Fn(&Error) + 'static = "onShellError";
433
+ /// When everything is ready, for crawlers and static pages.
434
+ on_all_ready: impl Fn() + 'static = "onAllReady";
435
+ #[cfg(react = "19.0")]
436
+ max_headers_length: u32 = "maxHeadersLength";
437
+ #[cfg(react = "19.3")]
438
+ on_browser_bailout: impl Fn(&Error, &ErrorInfo) + 'static = "onBrowserBailout";
439
+ }
440
+ }
441
+
442
+ /// What [`render_to_pipeable_stream`] gives.
443
+ pub struct PipeableStream(PhantomData<JsObject>);
444
+
445
+ impl PipeableStream {
446
+ /// Send the HTML to a Node `Writable`, like an HTTP response.
447
+ #[cfg_attr(rust_js, rust_js::link_name = "pipe")]
448
+ pub fn pipe<W>(&self, destination: &W) {
449
+ unreachable!()
450
+ }
451
+
452
+ /// Stop rendering, and leave the rest to the client.
453
+ #[cfg_attr(rust_js, rust_js::link_name = "abort")]
454
+ pub fn abort(&self) {
455
+ unreachable!()
456
+ }
457
+ }
458
+
459
+ /// [`renderToPipeableStream`](https://react.dev/reference/react-dom/server/renderToPipeableStream):
460
+ /// the page's HTML, for Node's streams.
461
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/server#renderToPipeableStream")]
462
+ pub fn render_to_pipeable_stream(children: impl Node, options: PipeOptions) -> &'static PipeableStream {
463
+ unreachable!()
464
+ }
465
+
466
+ /// [`resumeToPipeableStream`](https://react.dev/reference/react-dom/server/resumeToPipeableStream):
467
+ /// finish, for Node's streams, a page [`prerender`] postponed.
468
+ #[cfg(react = "19.2")]
469
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/server#resumeToPipeableStream")]
470
+ pub fn resume_to_pipeable_stream(children: impl Node, postponed: &Postponed, options: PipeOptions) -> Promise<&'static PipeableStream> {
471
+ unreachable!()
472
+ }
473
+
474
+ /// What a prerender left for later: JSON, to keep until the request.
475
+ pub struct Postponed(PhantomData<JsObject>);
476
+ }
477
+
478
+ // ── react-dom/static ────────────────────────────────────────────────────
479
+
480
+ /// [`react-dom/static`](https://react.dev/reference/react-dom/static):
481
+ /// rendering a whole page ahead of time, waiting for all of it.
482
+ pub mod prerender {
483
+ #[cfg(react = "19.0")]
484
+ use super::server::{Postponed, StreamOptions};
485
+ #[cfg(react = "19.0")]
486
+ use super::*;
487
+
488
+ /// What a prerender gives: the HTML, and what it left for later.
489
+ #[cfg(react = "19.0")]
490
+ pub struct Prerendered(PhantomData<JsObject>);
491
+
492
+ #[cfg(react = "19.0")]
493
+ impl Prerendered {
494
+ /// The HTML: a Web stream, or, from the `*_to_node_stream`
495
+ /// functions, a Node `Readable`.
496
+ #[cfg_attr(rust_js, rust_js::link_name = "get prelude")]
497
+ pub fn prelude(&self) -> &'static webapi::ReadableStream {
498
+ unreachable!()
499
+ }
500
+
501
+ /// What [`server::resume`] finishes, if anything was postponed.
502
+ #[cfg_attr(rust_js, rust_js::link_name = "get postponed")]
503
+ pub fn postponed(&self) -> Option<&'static Postponed> {
504
+ unreachable!()
505
+ }
506
+ }
507
+
508
+ /// [`prerender`](https://react.dev/reference/react-dom/static/prerender),
509
+ /// with Web streams.
510
+ #[cfg(react = "19.0")]
511
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/static#prerender")]
512
+ pub fn prerender(children: impl Node, options: StreamOptions) -> Promise<&'static Prerendered> {
513
+ unreachable!()
514
+ }
515
+
516
+ /// [`prerenderToNodeStream`](https://react.dev/reference/react-dom/static/prerenderToNodeStream),
517
+ /// with Node's streams.
518
+ #[cfg(react = "19.0")]
519
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/static#prerenderToNodeStream")]
520
+ pub fn prerender_to_node_stream(children: impl Node, options: StreamOptions) -> Promise<&'static Prerendered> {
521
+ unreachable!()
522
+ }
523
+
524
+ /// [`resumeAndPrerender`](https://react.dev/reference/react-dom/static/resumeAndPrerender):
525
+ /// go on with a prerender that was postponed.
526
+ #[cfg(react = "19.0")]
527
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/static#resumeAndPrerender")]
528
+ pub fn resume_and_prerender(children: impl Node, postponed: &Postponed, options: StreamOptions) -> Promise<&'static Prerendered> {
529
+ unreachable!()
530
+ }
531
+
532
+ /// [`resumeAndPrerenderToNodeStream`](https://react.dev/reference/react-dom/static/resumeAndPrerenderToNodeStream).
533
+ #[cfg(react = "19.0")]
534
+ #[cfg_attr(rust_js, rust_js::link_name = "react-dom/static#resumeAndPrerenderToNodeStream")]
535
+ pub fn resume_and_prerender_to_node_stream(
536
+ children: impl Node,
537
+ postponed: &Postponed,
538
+ options: StreamOptions,
539
+ ) -> Promise<&'static Prerendered> {
540
+ unreachable!()
541
+ }
542
+ }