Skip to content

Commit 2906274

Browse files
committed
style(react-dom): formatted Experimental module
1 parent 562c8c5 commit 2906274

File tree

2 files changed

+122
-106
lines changed

2 files changed

+122
-106
lines changed

src/ReactDOM.re

+45-37
Original file line numberDiff line numberDiff line change
@@ -479,47 +479,52 @@ external flushSync: (unit => unit) => unit = "flushSync";
479479

480480
module Experimental = {
481481
type preloadOptions;
482-
482+
483483
[@mel.obj]
484-
external preloadOptions: (
485-
~_as: [
486-
| `audio
487-
| `document
488-
| `embed
489-
| `fetch
490-
| `font
491-
| `image
492-
| [@mel.as "object"] `object_
493-
| `script
494-
| `style
495-
| `track
496-
| `video
497-
| `worker
498-
],
499-
~fetchPriority: [ `auto | `high | `low ]=?,
500-
~referrerPolicy: [
501-
| [@mel.as "no-referrer"] `noReferrer
502-
| [@mel.as "no-referrer-when-downgrade"] `noReferrerWhenDowngrade
503-
| [@mel.as "origin"] `origin
504-
| [@mel.as "origin-when-cross-origin"] `originWhenCrossOrigin
505-
| [@mel.as "unsafe-url"] `unsafeUrl
506-
]=?,
484+
external preloadOptions:
485+
(
486+
~_as: [
487+
| `audio
488+
| `document
489+
| `embed
490+
| `fetch
491+
| `font
492+
| `image
493+
| [@mel.as "object"] `object_
494+
| `script
495+
| `style
496+
| `track
497+
| `video
498+
| `worker
499+
],
500+
~fetchPriority: [ | `auto | `high | `low]=?,
501+
~referrerPolicy: [
502+
| [@mel.as "no-referrer"] `noReferrer
503+
| [@mel.as "no-referrer-when-downgrade"]
504+
`noReferrerWhenDowngrade
505+
| [@mel.as "origin"] `origin
506+
| [@mel.as "origin-when-cross-origin"]
507+
`originWhenCrossOrigin
508+
| [@mel.as "unsafe-url"] `unsafeUrl
509+
]
510+
=?,
507511
~imageSrcSet: string=?,
508512
~imageSizes: string=?,
509513
~crossOrigin: string=?,
510514
~integrity: string=?,
511515
~nonce: string=?,
512-
unit
513-
) => preloadOptions;
516+
unit
517+
) =>
518+
preloadOptions;
514519

515520
[@deriving jsProperties]
516521
type preinitOptions = {
517522
[@mel.as "as"]
518-
_as: [ | `script | `style ],
523+
_as: [ | `script | `style],
519524
[@mel.optional]
520-
fetchPriority: option([ `auto | `high | `low ]),
525+
fetchPriority: option([ | `auto | `high | `low]),
521526
[@mel.optional]
522-
precedence: option([ `reset | `low | `medium | `high ]),
527+
precedence: option([ | `reset | `low | `medium | `high]),
523528
[@mel.optional]
524529
crossOrigin: option(string),
525530
[@mel.optional]
@@ -531,7 +536,7 @@ module Experimental = {
531536
[@deriving jsProperties]
532537
type preOptions = {
533538
[@mel.as "as"]
534-
_as: [ | `script ],
539+
_as: [ | `script],
535540
[@mel.optional]
536541
crossOrigin: option(string),
537542
[@mel.optional]
@@ -540,19 +545,22 @@ module Experimental = {
540545
nonce: option(string),
541546
};
542547

543-
[@mel.module "react-dom"]
544-
external preconnect: string => unit = "preconnect";
548+
[@mel.module "react-dom"] external preconnect: string => unit = "preconnect";
545549
[@mel.module "react-dom"]
546550
external prefetchDNS: string => unit = "prefetchDNS";
547551
[@mel.module "react-dom"]
548-
external preinit: (string, ~options: preinitOptions=?, unit) => unit = "preinit";
552+
external preinit: (string, ~options: preinitOptions=?, unit) => unit =
553+
"preinit";
549554
[@mel.module "react-dom"]
550-
external preinitModule: (string, ~options: preOptions=?, unit) => unit = "preinitModule";
555+
external preinitModule: (string, ~options: preOptions=?, unit) => unit =
556+
"preinitModule";
551557
[@mel.module "react-dom"]
552-
external preload: (string, ~options: preloadOptions=?, unit) => unit = "preload";
558+
external preload: (string, ~options: preloadOptions=?, unit) => unit =
559+
"preload";
553560
[@mel.module "react-dom"]
554-
external preloadModule: (string, ~options: preOptions=?, unit) => unit = "preloadModule";
555-
}
561+
external preloadModule: (string, ~options: preOptions=?, unit) => unit =
562+
"preloadModule";
563+
};
556564

557565
external domElementToObj: Dom.element => Js.t({..}) = "%identity";
558566

src/ReactDOM.rei

+77-69
Original file line numberDiff line numberDiff line change
@@ -487,65 +487,70 @@ module Experimental: {
487487
type preloadOptions;
488488

489489
[@mel.obj]
490-
external preloadOptions: (
490+
external preloadOptions:
491491
/* 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;
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;
549554

550555
/*
551556
preinit options.
@@ -555,20 +560,20 @@ module Experimental: {
555560
type preinitOptions = {
556561
/* possible values: "script" or "style" */
557562
[@mel.as "as"]
558-
_as: [ | `script | `style ],
563+
_as: [ | `script | `style],
559564
/*
560565
Suggests a relative priority for fetching the resource.
561566
The possible values are auto (the default), high, and low.
562567
*/
563568
[@mel.optional]
564-
fetchPriority: option([ `auto | `high | `low ]),
569+
fetchPriority: option([ | `auto | `high | `low]),
565570
/*
566571
Required with Stylesheets (`style). Says where to insert the stylesheet relative to others.
567572
Stylesheets with higher precedence can override those with lower precedence.
568573
The possible values are reset, low, medium, high.
569574
*/
570575
[@mel.optional]
571-
precedence: option([ `reset | `low | `medium | `high ]),
576+
precedence: option([ | `reset | `low | `medium | `high]),
572577
/*
573578
a required string. It must be "anonymous", "use-credentials", and "".
574579
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin
@@ -598,7 +603,7 @@ module Experimental: {
598603
type preOptions = {
599604
/* It must be 'script'. */
600605
[@mel.as "as"]
601-
_as: [ | `script ],
606+
_as: [ | `script],
602607
/*
603608
a required string. It must be "anonymous", "use-credentials", and "".
604609
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin
@@ -619,19 +624,22 @@ module Experimental: {
619624
nonce: option(string),
620625
};
621626

622-
[@mel.module "react-dom"]
623-
external preconnect: string => unit = "preconnect";
627+
[@mel.module "react-dom"] external preconnect: string => unit = "preconnect";
624628
[@mel.module "react-dom"]
625629
external prefetchDNS: string => unit = "prefetchDNS";
626630
[@mel.module "react-dom"]
627-
external preinit: (string, ~options: preinitOptions=?, unit) => unit = "preinit";
631+
external preinit: (string, ~options: preinitOptions=?, unit) => unit =
632+
"preinit";
628633
[@mel.module "react-dom"]
629-
external preinitModule: (string, ~options: preOptions=?, unit) => unit = "preinitModule";
634+
external preinitModule: (string, ~options: preOptions=?, unit) => unit =
635+
"preinitModule";
630636
[@mel.module "react-dom"]
631-
external preload: (string, ~options: preloadOptions=?, unit) => unit = "preload";
637+
external preload: (string, ~options: preloadOptions=?, unit) => unit =
638+
"preload";
632639
[@mel.module "react-dom"]
633-
external preloadModule: (string, ~options: preOptions=?, unit) => unit = "preloadModule";
634-
}
640+
external preloadModule: (string, ~options: preOptions=?, unit) => unit =
641+
"preloadModule";
642+
};
635643

636644
external domElementToObj: Dom.element => Js.t({..}) = "%identity";
637645

0 commit comments

Comments
 (0)