Skip to content

Commit edeb2c1

Browse files
committed
fix!: rename a few bindings for better clarity
Get read of ambiguous bindings names such as make2, make3, createPattern3, drawFocusIfNeeded2, etc
1 parent 61b1074 commit edeb2c1

36 files changed

Lines changed: 204 additions & 224 deletions

src/CSSFontLoadingAPI/FontFace.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ external make: (~family: string, ~source: string, ~descriptors: fontFaceDescript
1111
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace)
1212
*/
1313
@new
14-
external make2: (
14+
external fromDataView: (
1515
~family: string,
1616
~source: DataView.t,
1717
~descriptors: fontFaceDescriptors=?,
@@ -21,7 +21,7 @@ external make2: (
2121
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace)
2222
*/
2323
@new
24-
external make3: (
24+
external fromArrayBuffer: (
2525
~family: string,
2626
~source: ArrayBuffer.t,
2727
~descriptors: fontFaceDescriptors=?,

src/CanvasAPI/Path2D.res

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ external make: (~path: path2D=?) => path2D = "Path2D"
1111
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D)
1212
*/
1313
@new
14-
external make2: (~path: string=?) => path2D = "Path2D"
14+
external fromString: (~path: string=?) => path2D = "Path2D"
1515

1616
/**
1717
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/closePath)
@@ -78,32 +78,6 @@ external roundRect: (
7878
~radii_: array<float>=?,
7979
) => unit = "roundRect"
8080

81-
/**
82-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
83-
*/
84-
@send
85-
external roundRect2: (
86-
path2D,
87-
~x: float,
88-
~y: float,
89-
~w: float,
90-
~h: float,
91-
~radii_: array<float>=?,
92-
) => unit = "roundRect"
93-
94-
/**
95-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
96-
*/
97-
@send
98-
external roundRect3: (
99-
path2D,
100-
~x: float,
101-
~y: float,
102-
~w: float,
103-
~h: float,
104-
~radii_: array<float>=?,
105-
) => unit = "roundRect"
106-
10781
/**
10882
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arc)
10983
*/

src/ChannelMessagingAPI/MessagePort.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Throws a "DataCloneError" DOMException if transfer contains duplicate objects or
1919
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
2020
*/
2121
@send
22-
external postMessage2: (
22+
external postMessageWithOptions: (
2323
messagePort,
2424
~message: JSON.t,
2525
~options: structuredSerializeOptions=?,

src/DOMAPI/CanvasRenderingContext2D.res

Lines changed: 32 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ external setTransform: (
8181
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setTransform)
8282
*/
8383
@send
84-
external setTransform2: (canvasRenderingContext2D, ~transform: domMatrix2DInit=?) => unit =
84+
external setTransformWithMatrix: (canvasRenderingContext2D, ~transform: domMatrix2DInit=?) => unit =
8585
"setTransform"
8686

8787
/**
@@ -141,7 +141,7 @@ external createPattern: (
141141
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern)
142142
*/
143143
@send
144-
external createPattern2: (
144+
external createPatternFromSvg: (
145145
canvasRenderingContext2D,
146146
~image: svgImageElement,
147147
~repetition: string,
@@ -151,7 +151,7 @@ external createPattern2: (
151151
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern)
152152
*/
153153
@send
154-
external createPattern3: (
154+
external createPatternFromVideo: (
155155
canvasRenderingContext2D,
156156
~image: htmlVideoElement,
157157
~repetition: string,
@@ -161,7 +161,7 @@ external createPattern3: (
161161
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern)
162162
*/
163163
@send
164-
external createPattern4: (
164+
external createPatternFromCanvas: (
165165
canvasRenderingContext2D,
166166
~image: htmlCanvasElement,
167167
~repetition: string,
@@ -171,7 +171,7 @@ external createPattern4: (
171171
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern)
172172
*/
173173
@send
174-
external createPattern5: (
174+
external createPatternFromImageBitmap: (
175175
canvasRenderingContext2D,
176176
~image: imageBitmap,
177177
~repetition: string,
@@ -181,7 +181,7 @@ external createPattern5: (
181181
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern)
182182
*/
183183
@send
184-
external createPattern6: (
184+
external createPatternFromOffscreenCanvas: (
185185
canvasRenderingContext2D,
186186
~image: offscreenCanvas,
187187
~repetition: string,
@@ -191,7 +191,7 @@ external createPattern6: (
191191
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern)
192192
*/
193193
@send
194-
external createPattern7: (
194+
external createPatternFromVideoFrame: (
195195
canvasRenderingContext2D,
196196
~image: videoFrame,
197197
~repetition: string,
@@ -239,8 +239,11 @@ external fill: (canvasRenderingContext2D, ~fillRule: canvasFillRule=?) => unit =
239239
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fill)
240240
*/
241241
@send
242-
external fill2: (canvasRenderingContext2D, ~path: path2D, ~fillRule: canvasFillRule=?) => unit =
243-
"fill"
242+
external fillWithPath: (
243+
canvasRenderingContext2D,
244+
~path: path2D,
245+
~fillRule: canvasFillRule=?,
246+
) => unit = "fill"
244247

245248
/**
246249
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/stroke)
@@ -252,7 +255,7 @@ external stroke: canvasRenderingContext2D => unit = "stroke"
252255
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/stroke)
253256
*/
254257
@send
255-
external stroke2: (canvasRenderingContext2D, path2D) => unit = "stroke"
258+
external strokeWithPath: (canvasRenderingContext2D, path2D) => unit = "stroke"
256259

257260
/**
258261
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clip)
@@ -264,8 +267,11 @@ external clip: (canvasRenderingContext2D, ~fillRule: canvasFillRule=?) => unit =
264267
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clip)
265268
*/
266269
@send
267-
external clip2: (canvasRenderingContext2D, ~path: path2D, ~fillRule: canvasFillRule=?) => unit =
268-
"clip"
270+
external clipWithPath: (
271+
canvasRenderingContext2D,
272+
~path: path2D,
273+
~fillRule: canvasFillRule=?,
274+
) => unit = "clip"
269275

270276
/**
271277
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInPath)
@@ -282,7 +288,7 @@ external isPointInPath: (
282288
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInPath)
283289
*/
284290
@send
285-
external isPointInPath2: (
291+
external isPointInPathWithPath: (
286292
canvasRenderingContext2D,
287293
~path: path2D,
288294
~x: float,
@@ -301,8 +307,12 @@ external isPointInStroke: (canvasRenderingContext2D, ~x: float, ~y: float) => bo
301307
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInStroke)
302308
*/
303309
@send
304-
external isPointInStroke2: (canvasRenderingContext2D, ~path: path2D, ~x: float, ~y: float) => bool =
305-
"isPointInStroke"
310+
external isPointInStrokeWithPath: (
311+
canvasRenderingContext2D,
312+
~path: path2D,
313+
~x: float,
314+
~y: float,
315+
) => bool = "isPointInStroke"
306316

307317
/**
308318
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded)
@@ -314,8 +324,11 @@ external drawFocusIfNeeded: (canvasRenderingContext2D, element) => unit = "drawF
314324
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded)
315325
*/
316326
@send
317-
external drawFocusIfNeeded2: (canvasRenderingContext2D, ~path: path2D, ~element: element) => unit =
318-
"drawFocusIfNeeded"
327+
external drawFocusIfNeededWithPath: (
328+
canvasRenderingContext2D,
329+
~path: path2D,
330+
~element: element,
331+
) => unit = "drawFocusIfNeeded"
319332

320333
/**
321334
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fillText)
@@ -649,7 +662,7 @@ external createImageData: (
649662
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createImageData)
650663
*/
651664
@send
652-
external createImageData2: (canvasRenderingContext2D, imageData) => imageData = "createImageData"
665+
external createImageDataFrom: (canvasRenderingContext2D, imageData) => imageData = "createImageData"
653666

654667
/**
655668
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getImageData)
@@ -679,7 +692,7 @@ external putImageData: (
679692
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/putImageData)
680693
*/
681694
@send
682-
external putImageData2: (
695+
external putImageDataWithDirtyRect: (
683696
canvasRenderingContext2D,
684697
~imagedata: imageData,
685698
~dx: int,
@@ -780,33 +793,6 @@ external roundRect: (
780793
) => unit = "roundRect"
781794

782795
/**
783-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
784-
*/
785-
@send
786-
external roundRect2: (
787-
canvasRenderingContext2D,
788-
~x: float,
789-
~y: float,
790-
~w: float,
791-
~h: float,
792-
~radii_: array<float>=?,
793-
) => unit = "roundRect"
794-
795-
/**
796-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
797-
*/
798-
@send
799-
external roundRect3: (
800-
canvasRenderingContext2D,
801-
~x: float,
802-
~y: float,
803-
~w: float,
804-
~h: float,
805-
~radii_: array<float>=?,
806-
) => unit = "roundRect"
807-
808-
/**
809-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arc)
810796
*/
811797
@send
812798
external arc: (

src/DOMAPI/CharacterData.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre
2525
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after)
2626
*/
2727
@send
28-
external after2: (T.t, string) => unit = "after"
28+
external afterText: (T.t, string) => unit = "after"
2929

3030
/**
3131
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/appendData)
@@ -49,7 +49,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre
4949
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before)
5050
*/
5151
@send
52-
external before2: (T.t, string) => unit = "before"
52+
external beforeText: (T.t, string) => unit = "before"
5353

5454
/**
5555
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/deleteData)
@@ -92,7 +92,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre
9292
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith)
9393
*/
9494
@send
95-
external replaceWith2: (T.t, string) => unit = "replaceWith"
95+
external replaceWithText: (T.t, string) => unit = "replaceWith"
9696

9797
/**
9898
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/substringData)

src/DOMAPI/DOMMatrix.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ external make: (~init: string=?) => domMatrix = "DOMMatrix"
1111
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrix)
1212
*/
1313
@new
14-
external make2: (~init: array<float>=?) => domMatrix = "DOMMatrix"
14+
external fromFloatArray: (~init: array<float>=?) => domMatrix = "DOMMatrix"
1515

1616
external asDOMMatrixReadOnly: domMatrix => domMatrixReadOnly = "%identity"
1717
@scope("DOMMatrix")

src/DOMAPI/DOMMatrixReadOnly.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ external make: (~init: string=?) => domMatrixReadOnly = "DOMMatrixReadOnly"
1111
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly)
1212
*/
1313
@new
14-
external make2: (~init: array<float>=?) => domMatrixReadOnly = "DOMMatrixReadOnly"
14+
external fromFloatArray: (~init: array<float>=?) => domMatrixReadOnly = "DOMMatrixReadOnly"
1515

1616
@scope("DOMMatrixReadOnly")
1717
external fromMatrix: (~other: domMatrixInit=?) => domMatrixReadOnly = "fromMatrix"

src/DOMAPI/Document.res

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre
3939
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend)
4040
*/
4141
@send
42-
external prepend2: (document, string) => unit = "prepend"
42+
external prependText: (document, string) => unit = "prepend"
4343

4444
/**
4545
Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
@@ -57,7 +57,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre
5757
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append)
5858
*/
5959
@send
60-
external append2: (document, string) => unit = "append"
60+
external appendText: (document, string) => unit = "append"
6161

6262
/**
6363
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
@@ -75,7 +75,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre
7575
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren)
7676
*/
7777
@send
78-
external replaceChildren2: (document, string) => unit = "replaceChildren"
78+
external replaceChildrenText: (document, string) => unit = "replaceChildren"
7979

8080
/**
8181
Returns the first element that is a descendant of node that matches selectors.
@@ -162,7 +162,7 @@ Creates an instance of the element for the specified tag.
162162
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createElement)
163163
*/
164164
@send
165-
external createElement2: (
165+
external createElementWithOptions: (
166166
document,
167167
~localName: string,
168168
~options: elementCreationOptions=?,
@@ -209,7 +209,7 @@ When supplied, options's is can be used to create a customized built-in element.
209209
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createElementNS)
210210
*/
211211
@send
212-
external createElementNS2: (
212+
external createElementNSWithOptions: (
213213
document,
214214
~namespace: string,
215215
~qualifiedName: string,
@@ -394,7 +394,7 @@ Opens a new window and loads a document specified by a given URL. Also, opens a
394394
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/open)
395395
*/
396396
@send
397-
external open2: (document, ~url: string, ~name: string, ~features: string) => window = "open"
397+
external openWindow: (document, ~url: string, ~name: string, ~features: string) => window = "open"
398398

399399
/**
400400
Closes an output stream and forces the sent data to display.

src/DOMAPI/DocumentFragment.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre
3131
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/append)
3232
*/
3333
@send
34-
external append2: (T.t, string) => unit = "append"
34+
external appendText: (T.t, string) => unit = "append"
3535

3636
/**
3737
Returns the first element within node's descendants whose ID is elementId.
@@ -56,7 +56,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre
5656
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/prepend)
5757
*/
5858
@send
59-
external prepend2: (T.t, string) => unit = "prepend"
59+
external prependText: (T.t, string) => unit = "prepend"
6060

6161
/**
6262
Returns the first element that is a descendant of node that matches selectors.
@@ -88,7 +88,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre
8888
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/replaceChildren)
8989
*/
9090
@send
91-
external replaceChildren2: (T.t, string) => unit = "replaceChildren"
91+
external replaceChildrenText: (T.t, string) => unit = "replaceChildren"
9292
}
9393

9494
include Impl({type t = documentFragment})

0 commit comments

Comments
 (0)