@@ -480,6 +480,72 @@ external flushSync: (unit => unit) => unit = "flushSync";
480
480
481
481
module Experimental : {
482
482
/* This module is used to bind to APIs for future versions of ReactDOM. There is no guarantee of backwards compatibility or stability. */
483
+ /*
484
+ preload options.
485
+ https://react.dev/reference/react-dom/preload#parameters
486
+ */
487
+ type preloadOptions ;
488
+
489
+ [@ mel . obj ]
490
+ external preloadOptions : (
491
+ /* Its possible values are audio, document, embed, fetch, font, image, object, script, style, track, video, worker. */
492
+ ~_as : [
493
+ | ` audio
494
+ | ` document
495
+ | ` embed
496
+ | ` fetch
497
+ | ` font
498
+ | ` image
499
+ | [@ mel . as "object" ] ` object_
500
+ | ` script
501
+ | ` style
502
+ | ` track
503
+ | ` video
504
+ | ` worker
505
+ ] ,
506
+ /*
507
+ Suggests a relative priority for fetching the resource.
508
+ The possible values are auto (the default), high, and low.
509
+ */
510
+ ~fetchPriority : [ ` auto | ` high | ` low ] =?,
511
+ /*
512
+ The Referrer header to send when fetching.
513
+ Its possible values are no-referrer-when-downgrade (the default), no-referrer, origin, origin-when-cross-origin, and unsafe-url.
514
+ */
515
+ ~referrerPolicy : [
516
+ | [@ mel . as "no-referrer" ] ` noReferrer
517
+ | [@ mel . as "no-referrer-when-downgrade" ] ` noReferrerWhenDowngrade
518
+ | [@ mel . as "origin" ] ` origin
519
+ | [@ mel . as "origin-when-cross-origin" ] ` originWhenCrossOrigin
520
+ | [@ mel . as "unsafe-url" ] ` unsafeUrl
521
+ ] =?,
522
+ /*
523
+ For use only with as: "image". Specifies the source set of the image.
524
+ https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images
525
+ */
526
+ ~imageSrcSet : string =?,
527
+ /*
528
+ For use only with as: "image". Specifies the source sizes of the image.
529
+ https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images
530
+ */
531
+ ~imageSizes : string =?,
532
+ /*
533
+ a required string. It must be "anonymous", "use-credentials", and "".
534
+ https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin
535
+ */
536
+ ~crossOrigin : string =?,
537
+ /*
538
+ A cryptographic hash of the module, to verify its authenticity.
539
+ https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
540
+ */
541
+ ~integrity : string =?,
542
+ /*
543
+ A cryptographic nonce to allow the module when using a strict Content Security Policy.
544
+ https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce
545
+ */
546
+ ~nonce : string =?,
547
+ unit
548
+ ) => preloadOptions ;
483
549
484
550
/*
485
551
preinit options.
@@ -562,7 +628,7 @@ module Experimental: {
562
628
[@ mel . module "react-dom" ]
563
629
external preinitModule : (string , ~options : preOptions =?, unit ) => unit = "preinitModule" ;
564
630
[@ mel . module "react-dom" ]
565
- external preload : string => unit = "preload" ;
631
+ external preload : ( string , ~ options : preloadOptions =? , unit ) => unit = "preload" ;
566
632
[@ mel . module "react-dom" ]
567
633
external preloadModule : (string , ~options : preOptions =?, unit ) => unit = "preloadModule" ;
568
634
}
0 commit comments