@@ -478,6 +478,51 @@ external unmountComponentAtNode: Dom.element => unit =
478
478
[@ mel . module "react-dom" ]
479
479
external flushSync : (unit => unit ) => unit = "flushSync" ;
480
480
481
+ module Experimental : {
482
+ /*
483
+ preinitModule and preloadModule options.
484
+ https://react.dev/reference/react-dom/preinitModule#parameters
485
+ */
486
+ [@ deriving jsProperties]
487
+ type preOptions = {
488
+ /* a required string. It must be 'script'. */
489
+ [@mel.as "as"] [@mel.optional]
490
+ _as: option ([ | ` script ] ),
491
+ /*
492
+ a required string. It must be "anonymous", "use-credentials", and "".
493
+ https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin
494
+ */
495
+ [@mel.optional]
496
+ crossOrigin: option (string ),
497
+ /*
498
+ a string. A cryptographic hash of the module, to verify its authenticity.
499
+ https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
500
+ */
501
+ [@mel.optional]
502
+ integrity: option (string ),
503
+ /*
504
+ a string. A cryptographic nonce to allow the module when using a strict Content Security Policy.
505
+ https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce
506
+ */
507
+ [@mel.optional]
508
+ nonce: option (string ),
509
+ };
510
+
511
+ /* This module is used to bind to APIs for future versions of ReactDOM. There is no guarantee of backwards compatibility or stability. */
512
+ [@ mel . module "react-dom" ]
513
+ external preconnect : string => unit = "preconnect" ;
514
+ [@ mel . module "react-dom" ]
515
+ external prefetchDNS : string => unit = "prefetchDNS" ;
516
+ [@ mel . module "react-dom" ]
517
+ external preinit : string => unit = "preinit" ;
518
+ [@ mel . module "react-dom" ]
519
+ external preinitModule : (string , ~options : preOptions =?, unit ) => unit = "preinitModule" ;
520
+ [@ mel . module "react-dom" ]
521
+ external preload : string => unit = "preload" ;
522
+ [@ mel . module "react-dom" ]
523
+ external preloadModule : (string , ~options : preOptions =?, unit ) => unit = "preloadModule" ;
524
+ }
525
+
481
526
external domElementToObj : Dom . element => Js . t ({..}) = "% identity " ;
482
527
483
528
type style = Style . t ;
0 commit comments