Skip to content

Commit 252361a

Browse files
committed
fix!: rename a few bindings for better clarity
1 parent d369927 commit 252361a

30 files changed

Lines changed: 132 additions & 185 deletions

src/CanvasAPI/Path2D.res

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 15 additions & 42 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,7 +239,7 @@ 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 =
242+
external fillWithPath: (canvasRenderingContext2D, ~path: path2D, ~fillRule: canvasFillRule=?) => unit =
243243
"fill"
244244

245245
/**
@@ -252,7 +252,7 @@ external stroke: canvasRenderingContext2D => unit = "stroke"
252252
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/stroke)
253253
*/
254254
@send
255-
external stroke2: (canvasRenderingContext2D, path2D) => unit = "stroke"
255+
external strokeWithPath: (canvasRenderingContext2D, path2D) => unit = "stroke"
256256

257257
/**
258258
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clip)
@@ -264,7 +264,7 @@ external clip: (canvasRenderingContext2D, ~fillRule: canvasFillRule=?) => unit =
264264
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clip)
265265
*/
266266
@send
267-
external clip2: (canvasRenderingContext2D, ~path: path2D, ~fillRule: canvasFillRule=?) => unit =
267+
external clipWithPath: (canvasRenderingContext2D, ~path: path2D, ~fillRule: canvasFillRule=?) => unit =
268268
"clip"
269269

270270
/**
@@ -282,7 +282,7 @@ external isPointInPath: (
282282
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInPath)
283283
*/
284284
@send
285-
external isPointInPath2: (
285+
external isPointInPathWithPath: (
286286
canvasRenderingContext2D,
287287
~path: path2D,
288288
~x: float,
@@ -301,7 +301,7 @@ external isPointInStroke: (canvasRenderingContext2D, ~x: float, ~y: float) => bo
301301
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInStroke)
302302
*/
303303
@send
304-
external isPointInStroke2: (canvasRenderingContext2D, ~path: path2D, ~x: float, ~y: float) => bool =
304+
external isPointInStrokeWithPath: (canvasRenderingContext2D, ~path: path2D, ~x: float, ~y: float) => bool =
305305
"isPointInStroke"
306306

307307
/**
@@ -314,7 +314,7 @@ external drawFocusIfNeeded: (canvasRenderingContext2D, element) => unit = "drawF
314314
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded)
315315
*/
316316
@send
317-
external drawFocusIfNeeded2: (canvasRenderingContext2D, ~path: path2D, ~element: element) => unit =
317+
external drawFocusIfNeededWithPath: (canvasRenderingContext2D, ~path: path2D, ~element: element) => unit =
318318
"drawFocusIfNeeded"
319319

320320
/**
@@ -649,7 +649,7 @@ external createImageData: (
649649
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createImageData)
650650
*/
651651
@send
652-
external createImageData2: (canvasRenderingContext2D, imageData) => imageData = "createImageData"
652+
external createImageDataFrom: (canvasRenderingContext2D, imageData) => imageData = "createImageData"
653653

654654
/**
655655
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getImageData)
@@ -679,7 +679,7 @@ external putImageData: (
679679
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/putImageData)
680680
*/
681681
@send
682-
external putImageData2: (
682+
external putImageDataWithDirtyRect: (
683683
canvasRenderingContext2D,
684684
~imagedata: imageData,
685685
~dx: int,
@@ -780,33 +780,6 @@ external roundRect: (
780780
) => unit = "roundRect"
781781

782782
/**
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)
810783
*/
811784
@send
812785
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/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)