@@ -478,6 +478,169 @@ external unmountComponentAtNode: Dom.element => unit =
478478[@ mel . module "react-dom" ]
479479external flushSync : (unit => unit ) => unit = "flushSync" ;
480480
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+ 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+ (
493+ ~_as : [
494+ | ` audio
495+ | ` document
496+ | ` embed
497+ | ` fetch
498+ | ` font
499+ | ` image
500+ | [@ mel . as "object" ] ` object_
501+ | ` script
502+ | ` style
503+ | ` track
504+ | ` video
505+ | ` worker
506+ ] ,
507+ /*
508+ Suggests a relative priority for fetching the resource.
509+ The possible values are auto (the default), high, and low.
510+ */
511+ ~fetchPriority : [ | ` auto | ` high | ` low ] =?,
512+ /*
513+ The Referrer header to send when fetching.
514+ Its possible values are no-referrer-when-downgrade (the default), no-referrer, origin, origin-when-cross-origin, and unsafe-url.
515+ */
516+ ~referrerPolicy : [
517+ | [@ mel . as "no-referrer" ] ` noReferrer
518+ | [@ mel . as "no-referrer-when-downgrade" ]
519+ ` noReferrerWhenDowngrade
520+ | [@ mel . as "origin" ] ` origin
521+ | [@ mel . as "origin-when-cross-origin" ]
522+ ` originWhenCrossOrigin
523+ | [@ mel . as "unsafe-url" ] ` unsafeUrl
524+ ]
525+ =?,
526+ /*
527+ For use only with as: "image". Specifies the source set of the image.
528+ https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images
529+ */
530+ ~imageSrcSet : string =?,
531+ /*
532+ For use only with as: "image". Specifies the source sizes of the image.
533+ https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images
534+ */
535+ ~imageSizes : string =?,
536+ /*
537+ a required string. It must be "anonymous", "use-credentials", and "".
538+ https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin
539+ */
540+ ~crossOrigin : string =?,
541+ /*
542+ A cryptographic hash of the module, to verify its authenticity.
543+ https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
544+ */
545+ ~integrity : string =?,
546+ /*
547+ A cryptographic nonce to allow the module when using a strict Content Security Policy.
548+ https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce
549+ */
550+ ~nonce : string =?,
551+ unit
552+ ) =>
553+ preloadOptions ;
554+
555+ /*
556+ preinit options.
557+ https://react.dev/reference/react-dom/preinit#parameters
558+ */
559+ [@ deriving jsProperties]
560+ type preinitOptions = {
561+ /* possible values: "script" or "style" */
562+ [@mel.as "as"]
563+ _as: [ | ` script | ` style ] ,
564+ /*
565+ Suggests a relative priority for fetching the resource.
566+ The possible values are auto (the default), high, and low.
567+ */
568+ [@mel.optional]
569+ fetchPriority: option ([ | ` auto | ` high | ` low ] ),
570+ /*
571+ Required with Stylesheets (`style). Says where to insert the stylesheet relative to others.
572+ Stylesheets with higher precedence can override those with lower precedence.
573+ The possible values are reset, low, medium, high.
574+ */
575+ [@mel.optional]
576+ precedence: option ([ | ` reset | ` low | ` medium | ` high ] ),
577+ /*
578+ a required string. It must be "anonymous", "use-credentials", and "".
579+ https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin
580+ */
581+ [@mel.optional]
582+ crossOrigin: option (string ),
583+ /*
584+ A cryptographic hash of the module, to verify its authenticity.
585+ https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
586+ */
587+ [@mel.optional]
588+ integrity: option (string ),
589+ /*
590+ A cryptographic nonce to allow the module when using a strict Content Security Policy.
591+ https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce
592+ */
593+ [@mel.optional]
594+ nonce: option (string ),
595+ };
596+
597+ /*
598+ preinitModule and preloadModule options.
599+ https://react.dev/reference/react-dom/preinitModule#parameters
600+ https://react.dev/reference/react-dom/preloadModule#parameters
601+ */
602+ [@ deriving jsProperties]
603+ type preOptions = {
604+ /* It must be 'script'. */
605+ [@mel.as "as"]
606+ _as: [ | ` script ] ,
607+ /*
608+ a required string. It must be "anonymous", "use-credentials", and "".
609+ https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin
610+ */
611+ [@mel.optional]
612+ crossOrigin: option (string ),
613+ /*
614+ A cryptographic hash of the module, to verify its authenticity.
615+ https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
616+ */
617+ [@mel.optional]
618+ integrity: option (string ),
619+ /*
620+ A cryptographic nonce to allow the module when using a strict Content Security Policy.
621+ https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce
622+ */
623+ [@mel.optional]
624+ nonce: option (string ),
625+ };
626+
627+ [@ mel . module "react-dom" ] external preconnect : string => unit = "preconnect" ;
628+ [@ mel . module "react-dom" ]
629+ external prefetchDNS : string => unit = "prefetchDNS" ;
630+ [@ mel . module "react-dom" ]
631+ external preinit : (string , ~options : preinitOptions =?, unit ) => unit =
632+ "preinit" ;
633+ [@ mel . module "react-dom" ]
634+ external preinitModule : (string , ~options : preOptions =?, unit ) => unit =
635+ "preinitModule" ;
636+ [@ mel . module "react-dom" ]
637+ external preload : (string , ~options : preloadOptions =?, unit ) => unit =
638+ "preload" ;
639+ [@ mel . module "react-dom" ]
640+ external preloadModule : (string , ~options : preOptions =?, unit ) => unit =
641+ "preloadModule" ;
642+ };
643+
481644external domElementToObj : Dom . element => Js . t ({..}) = "% identity " ;
482645
483646type style = Style . t ;
0 commit comments