Skip to content

Commit ae828b2

Browse files
committed
Respect optional parameters in functions
1 parent 8dc9ae7 commit ae828b2

File tree

172 files changed

+1778
-1430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+1778
-1430
lines changed

src/CSSFontLoadingAPI/FontFace.res

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ open Prelude
55
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace)
66
*/
77
@new
8-
external make: (~family: string, ~source: unknown, ~descriptors: fontFaceDescriptors) => fontFace =
9-
"FontFace"
8+
external make: (
9+
~family: string,
10+
~source: unknown,
11+
~descriptors: fontFaceDescriptors=?,
12+
) => fontFace = "FontFace"
1013

1114
/**
1215
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace/load)

src/CSSFontLoadingAPI/FontFaceSet.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ external clear: fontFaceSet => unit = "clear"
130130
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/load)
131131
*/
132132
@send
133-
external load: (fontFaceSet, ~font: string, ~text: string) => Promise.t<array<fontFace>> = "load"
133+
external load: (fontFaceSet, ~font: string, ~text: string=?) => Promise.t<array<fontFace>> = "load"
134134

135135
/**
136136
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/check)
137137
*/
138138
@send
139-
external check: (fontFaceSet, ~font: string, ~text: string) => bool = "check"
139+
external check: (fontFaceSet, ~font: string, ~text: string=?) => bool = "check"

src/CanvasAPI/OffscreenCanvas.res

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Returns null if the canvas has already been initialized with another context typ
129129
external getContext: (
130130
offscreenCanvas,
131131
~contextId: offscreenRenderingContextId,
132-
~options: any,
132+
~options: any=?,
133133
) => offscreenRenderingContext = "getContext"
134134

135135
/**
@@ -146,4 +146,5 @@ The argument, if provided, is a dictionary that controls the encoding options of
146146
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas/convertToBlob)
147147
*/
148148
@send
149-
external convertToBlob: (offscreenCanvas, imageEncodeOptions) => Promise.t<blob> = "convertToBlob"
149+
external convertToBlob: (offscreenCanvas, ~options: imageEncodeOptions=?) => Promise.t<blob> =
150+
"convertToBlob"

src/ChannelMessagingAPI/MessagePort.res

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,11 @@ Throws a "DataCloneError" DOMException if transfer contains duplicate objects or
126126
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
127127
*/
128128
@send
129-
external postMessage2: (messagePort, ~message: any, ~options: structuredSerializeOptions) => unit =
130-
"postMessage"
129+
external postMessage2: (
130+
messagePort,
131+
~message: any,
132+
~options: structuredSerializeOptions=?,
133+
) => unit = "postMessage"
131134

132135
/**
133136
Begins dispatching messages received on the port.

src/ClipboardAPI/ClipboardItem.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ open Prelude
66
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ClipboardItem)
77
*/
88
@new
9-
external make: (~items: any, ~options: clipboardItemOptions) => clipboardItem = "ClipboardItem"
9+
external make: (~items: any, ~options: clipboardItemOptions=?) => clipboardItem = "ClipboardItem"
1010

1111
/**
1212
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ClipboardItem/getType)

src/CredentialManagementAPI/CredentialsContainer.res

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ open CredentialManagementAPI
44
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/get)
55
*/
66
@send
7-
external get: (credentialsContainer, credentialRequestOptions) => Promise.t<credential> = "get"
7+
external get: (
8+
credentialsContainer,
9+
~options: credentialRequestOptions=?,
10+
) => Promise.t<credential> = "get"
811

912
/**
1013
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/store)
@@ -16,8 +19,10 @@ external store: (credentialsContainer, credential) => Promise.t<unit> = "store"
1619
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/create)
1720
*/
1821
@send
19-
external create: (credentialsContainer, credentialCreationOptions) => Promise.t<credential> =
20-
"create"
22+
external create: (
23+
credentialsContainer,
24+
~options: credentialCreationOptions=?,
25+
) => Promise.t<credential> = "create"
2126

2227
/**
2328
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/preventSilentAccess)

src/DOMAPI/Animation.res

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ open DOMAPI
55
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation)
66
*/
77
@new
8-
external make: (~effect: animationEffect, ~timeline: animationTimeline) => animation = "Animation"
8+
external make: (~effect: animationEffect=?, ~timeline: animationTimeline=?) => animation =
9+
"Animation"
910

1011
/**
1112
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

src/DOMAPI/AnimationEffect.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ external getComputedTiming: animationEffect => computedEffectTiming = "getComput
1616
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AnimationEffect/updateTiming)
1717
*/
1818
@send
19-
external updateTiming: (animationEffect, optionalEffectTiming) => unit = "updateTiming"
19+
external updateTiming: (animationEffect, ~timing: optionalEffectTiming=?) => unit = "updateTiming"

src/DOMAPI/CSSStyleDeclaration.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ external setProperty: (
2626
cssStyleDeclaration,
2727
~property: string,
2828
~value: string,
29-
~priority: string,
29+
~priority: string=?,
3030
) => unit = "setProperty"
3131

3232
/**

src/DOMAPI/CSSStyleSheet.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ open DOMAPI
44
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet)
55
*/
66
@new
7-
external make: cssStyleSheetInit => cssStyleSheet = "CSSStyleSheet"
7+
external make: (~options: cssStyleSheetInit=?) => cssStyleSheet = "CSSStyleSheet"
88

99
/**
1010
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/insertRule)
1111
*/
1212
@send
13-
external insertRule: (cssStyleSheet, ~rule: string, ~index: int) => int = "insertRule"
13+
external insertRule: (cssStyleSheet, ~rule: string, ~index: int=?) => int = "insertRule"
1414

1515
/**
1616
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/deleteRule)

0 commit comments

Comments
 (0)