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