Skip to content

Commit c6cfc02

Browse files
committed
Add more cases of parameter overload
1 parent ae828b2 commit c6cfc02

File tree

74 files changed

+869
-97
lines changed

Some content is hidden

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

74 files changed

+869
-97
lines changed

src/CSSFontLoadingAPI/FontFace.res

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

src/DOMAPI.res

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,15 @@ type selectionMode =
150150
| @as("select") Select
151151
| @as("start") Start
152152

153+
type compositeOperation =
154+
| @as("accumulate") Accumulate
155+
| @as("add") Add
156+
| @as("replace") Replace
157+
158+
type iterationCompositeOperation =
159+
| @as("accumulate") Accumulate
160+
| @as("replace") Replace
161+
153162
type shareData = {
154163
mutable files?: array<file>,
155164
mutable title?: string,
@@ -9183,6 +9192,21 @@ type windowPostMessageOptions = {
91839192
mutable targetOrigin?: string,
91849193
}
91859194

9195+
type keyframeEffectOptions = {
9196+
...effectTiming,
9197+
mutable composite?: compositeOperation,
9198+
mutable pseudoElement?: Null.t<string>,
9199+
mutable iterationComposite?: iterationCompositeOperation,
9200+
}
9201+
9202+
type keyframeAnimationOptions = {
9203+
...keyframeEffectOptions,
9204+
mutable id?: string,
9205+
mutable timeline?: Null.t<animationTimeline>,
9206+
}
9207+
9208+
type elementCreationOptions = {mutable is?: string}
9209+
91869210
type xPathNSResolver = any
91879211

91889212
type timerHandler = any

src/DOMAPI/Document.res

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,21 @@ Creates an instance of the element for the specified tag.
347347
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createElement)
348348
*/
349349
@send
350-
external createElement: (document, ~localName: string, ~options: unknown=?) => element =
350+
external createElement: (document, ~localName: string, ~options: string=?) => element =
351351
"createElement"
352352

353+
/**
354+
Creates an instance of the element for the specified tag.
355+
@param tagName The name of an element.
356+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createElement)
357+
*/
358+
@send
359+
external createElement2: (
360+
document,
361+
~localName: string,
362+
~options: elementCreationOptions=?,
363+
) => element = "createElement"
364+
353365
/**
354366
Returns an element with namespace namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName.
355367
@@ -371,7 +383,31 @@ external createElementNS: (
371383
document,
372384
~namespace: string,
373385
~qualifiedName: string,
374-
~options: unknown=?,
386+
~options: string=?,
387+
) => element = "createElementNS"
388+
389+
/**
390+
Returns an element with namespace namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName.
391+
392+
If localName does not match the Name production an "InvalidCharacterError" DOMException will be thrown.
393+
394+
If one of the following conditions is true a "NamespaceError" DOMException will be thrown:
395+
396+
localName does not match the QName production.
397+
Namespace prefix is not null and namespace is the empty string.
398+
Namespace prefix is "xml" and namespace is not the XML namespace.
399+
qualifiedName or namespace prefix is "xmlns" and namespace is not the XMLNS namespace.
400+
namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is "xmlns".
401+
402+
When supplied, options's is can be used to create a customized built-in element.
403+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createElementNS)
404+
*/
405+
@send
406+
external createElementNS2: (
407+
document,
408+
~namespace: string,
409+
~qualifiedName: string,
410+
~options: elementCreationOptions=?,
375411
) => element = "createElementNS"
376412

377413
/**

src/DOMAPI/Element.res

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,14 @@ external remove: element => unit = "remove"
135135
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
136136
*/
137137
@send
138-
external animate: (element, ~keyframes: any, ~options: unknown=?) => animation = "animate"
138+
external animate: (element, ~keyframes: any, ~options: float=?) => animation = "animate"
139+
140+
/**
141+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
142+
*/
143+
@send
144+
external animate2: (element, ~keyframes: any, ~options: keyframeAnimationOptions=?) => animation =
145+
"animate"
139146

140147
/**
141148
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations)

src/DOMAPI/HTMLAnchorElement.res

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,17 @@ external remove: htmlAnchorElement => unit = "remove"
153153
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
154154
*/
155155
@send
156-
external animate: (htmlAnchorElement, ~keyframes: any, ~options: unknown=?) => animation = "animate"
156+
external animate: (htmlAnchorElement, ~keyframes: any, ~options: float=?) => animation = "animate"
157+
158+
/**
159+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
160+
*/
161+
@send
162+
external animate2: (
163+
htmlAnchorElement,
164+
~keyframes: any,
165+
~options: keyframeAnimationOptions=?,
166+
) => animation = "animate"
157167

158168
/**
159169
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations)

src/DOMAPI/HTMLAreaElement.res

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,17 @@ external remove: htmlAreaElement => unit = "remove"
153153
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
154154
*/
155155
@send
156-
external animate: (htmlAreaElement, ~keyframes: any, ~options: unknown=?) => animation = "animate"
156+
external animate: (htmlAreaElement, ~keyframes: any, ~options: float=?) => animation = "animate"
157+
158+
/**
159+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
160+
*/
161+
@send
162+
external animate2: (
163+
htmlAreaElement,
164+
~keyframes: any,
165+
~options: keyframeAnimationOptions=?,
166+
) => animation = "animate"
157167

158168
/**
159169
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations)

src/DOMAPI/HTMLAudioElement.res

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,17 @@ external remove: htmlAudioElement => unit = "remove"
155155
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
156156
*/
157157
@send
158-
external animate: (htmlAudioElement, ~keyframes: any, ~options: unknown=?) => animation = "animate"
158+
external animate: (htmlAudioElement, ~keyframes: any, ~options: float=?) => animation = "animate"
159+
160+
/**
161+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
162+
*/
163+
@send
164+
external animate2: (
165+
htmlAudioElement,
166+
~keyframes: any,
167+
~options: keyframeAnimationOptions=?,
168+
) => animation = "animate"
159169

160170
/**
161171
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations)

src/DOMAPI/HTMLBRElement.res

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,17 @@ external remove: htmlbrElement => unit = "remove"
153153
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
154154
*/
155155
@send
156-
external animate: (htmlbrElement, ~keyframes: any, ~options: unknown=?) => animation = "animate"
156+
external animate: (htmlbrElement, ~keyframes: any, ~options: float=?) => animation = "animate"
157+
158+
/**
159+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
160+
*/
161+
@send
162+
external animate2: (
163+
htmlbrElement,
164+
~keyframes: any,
165+
~options: keyframeAnimationOptions=?,
166+
) => animation = "animate"
157167

158168
/**
159169
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations)

src/DOMAPI/HTMLBaseElement.res

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,17 @@ external remove: htmlBaseElement => unit = "remove"
153153
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
154154
*/
155155
@send
156-
external animate: (htmlBaseElement, ~keyframes: any, ~options: unknown=?) => animation = "animate"
156+
external animate: (htmlBaseElement, ~keyframes: any, ~options: float=?) => animation = "animate"
157+
158+
/**
159+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
160+
*/
161+
@send
162+
external animate2: (
163+
htmlBaseElement,
164+
~keyframes: any,
165+
~options: keyframeAnimationOptions=?,
166+
) => animation = "animate"
157167

158168
/**
159169
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations)

src/DOMAPI/HTMLBodyElement.res

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,17 @@ external remove: htmlBodyElement => unit = "remove"
153153
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
154154
*/
155155
@send
156-
external animate: (htmlBodyElement, ~keyframes: any, ~options: unknown=?) => animation = "animate"
156+
external animate: (htmlBodyElement, ~keyframes: any, ~options: float=?) => animation = "animate"
157+
158+
/**
159+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
160+
*/
161+
@send
162+
external animate2: (
163+
htmlBodyElement,
164+
~keyframes: any,
165+
~options: keyframeAnimationOptions=?,
166+
) => animation = "animate"
157167

158168
/**
159169
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations)

0 commit comments

Comments
 (0)