Skip to content

Commit 72b808d

Browse files
committed
Ensure unique method names when mixing and extensions are the same name.
1 parent 8a6ab64 commit 72b808d

35 files changed

+145
-97
lines changed

src/CanvasAPI/OffscreenCanvas.res

+1-1
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: JSON.t=?,
133133
) => offscreenRenderingContext = "getContext"
134134

135135
/**

src/ChannelMessagingAPI/MessagePort.res

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Throws a "DataCloneError" DOMException if transfer contains duplicate objects or
116116
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
117117
*/
118118
@send
119-
external postMessage: (messagePort, ~message: any, ~transfer: array<Dict.t<string>>) => unit =
119+
external postMessage: (messagePort, ~message: JSON.t, ~transfer: array<Dict.t<string>>) => unit =
120120
"postMessage"
121121

122122
/**
@@ -128,7 +128,7 @@ Throws a "DataCloneError" DOMException if transfer contains duplicate objects or
128128
@send
129129
external postMessage2: (
130130
messagePort,
131-
~message: any,
131+
~message: JSON.t,
132132
~options: structuredSerializeOptions=?,
133133
) => unit = "postMessage"
134134

src/DOMAPI.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -6003,7 +6003,7 @@ and window = {
60036003
/**
60046004
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/opener)
60056005
*/
6006-
mutable opener: any,
6006+
mutable opener: JSON.t,
60076007
/**
60086008
Refers to either the parent WindowProxy, or itself.
60096009

src/DOMAPI/DOMMatrix.res

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ external toFloat64Array: domMatrix => float64Array = "toFloat64Array"
100100
external toJSON: domMatrix => Dict.t<string> = "toJSON"
101101

102102
@scope("DOMMatrix")
103-
external fromMatrix: (~other: domMatrixInit=?) => domMatrix = "fromMatrix"
103+
external fromMatrixD: (~other: domMatrixInit=?) => domMatrix = "fromMatrix"
104104

105105
@scope("DOMMatrix")
106-
external fromFloat32Array: array<float> => domMatrix = "fromFloat32Array"
106+
external fromFloat32ArrayD: array<float> => domMatrix = "fromFloat32Array"
107107

108108
@scope("DOMMatrix")
109-
external fromFloat64Array: float64Array => domMatrix = "fromFloat64Array"
109+
external fromFloat64ArrayD: float64Array => domMatrix = "fromFloat64Array"
110110

111111
@send
112112
external multiplySelf: (domMatrix, ~other: domMatrixInit=?) => domMatrix = "multiplySelf"

src/DOMAPI/DOMPoint.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ external toJSON: domPoint => Dict.t<string> = "toJSON"
2525
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMPoint/fromPoint_static)
2626
*/
2727
@scope("DOMPoint")
28-
external fromPoint: (~other: domPointInit=?) => domPoint = "fromPoint"
28+
external fromPointD: (~other: domPointInit=?) => domPoint = "fromPoint"

src/DOMAPI/DOMRect.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ external toJSON: domRect => Dict.t<string> = "toJSON"
1919
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRect/fromRect_static)
2020
*/
2121
@scope("DOMRect")
22-
external fromRect: (~other: domRectInit=?) => domRect = "fromRect"
22+
external fromRectD: (~other: domRectInit=?) => domRect = "fromRect"

src/DOMAPI/HTMLCanvasElement.res

+8-4
Original file line numberDiff line numberDiff line change
@@ -730,16 +730,20 @@ Returns an object that provides methods and properties for drawing and manipulat
730730
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/getContext)
731731
*/
732732
@send
733-
external getContext: (htmlCanvasElement, ~contextId: string, ~options: any=?) => renderingContext =
734-
"getContext"
733+
external getContext: (
734+
htmlCanvasElement,
735+
~contextId: string,
736+
~options: JSON.t=?,
737+
) => renderingContext = "getContext"
735738

736739
/**
737740
Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.
738741
@param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.
739742
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/toDataURL)
740743
*/
741744
@send
742-
external toDataURL: (htmlCanvasElement, ~type_: string=?, ~quality: any=?) => string = "toDataURL"
745+
external toDataURL: (htmlCanvasElement, ~type_: string=?, ~quality: JSON.t=?) => string =
746+
"toDataURL"
743747

744748
/**
745749
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/toBlob)
@@ -749,7 +753,7 @@ external toBlob: (
749753
htmlCanvasElement,
750754
~callback: blobCallback,
751755
~type_: string=?,
752-
~quality: any=?,
756+
~quality: JSON.t=?,
753757
) => unit = "toBlob"
754758

755759
/**

src/DOMAPI/HTMLCollectionOf.re.js

+1-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/HTMLSelectElement.res

+2-2
Original file line numberDiff line numberDiff line change
@@ -754,15 +754,15 @@ Removes an element from the collection.
754754
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/remove)
755755
*/
756756
@send
757-
external remove: htmlSelectElement => unit = "remove"
757+
external removeH: htmlSelectElement => unit = "remove"
758758

759759
/**
760760
Removes an element from the collection.
761761
@param index Number that specifies the zero-based index of the element to remove from the collection.
762762
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/remove)
763763
*/
764764
@send
765-
external remove2: (htmlSelectElement, int) => unit = "remove"
765+
external removeH2: (htmlSelectElement, int) => unit = "remove"
766766

767767
/**
768768
Returns whether a form will validate when it is submitted, without having to submit it.

src/DOMAPI/Window.res

+12-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ open EventAPI
1010
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/reportError)
1111
*/
1212
@send
13-
external reportError: (window, any) => unit = "reportError"
13+
external reportError: (window, JSON.t) => unit = "reportError"
1414

1515
/**
1616
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/btoa)
@@ -28,14 +28,14 @@ external atob: (window, string) => string = "atob"
2828
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setTimeout)
2929
*/
3030
@send
31-
external setTimeout: (window, ~handler: string, ~timeout: int=?, ~arguments: any) => int =
31+
external setTimeout: (window, ~handler: string, ~timeout: int=?, ~arguments: JSON.t) => int =
3232
"setTimeout"
3333

3434
/**
3535
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setTimeout)
3636
*/
3737
@send
38-
external setTimeout2: (window, ~handler: unit => unit, ~timeout: int=?, ~arguments: any) => int =
38+
external setTimeout2: (window, ~handler: unit => unit, ~timeout: int=?, ~arguments: JSON.t) => int =
3939
"setTimeout"
4040

4141
/**
@@ -48,15 +48,19 @@ external clearTimeout: (window, int) => unit = "clearTimeout"
4848
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setInterval)
4949
*/
5050
@send
51-
external setInterval: (window, ~handler: string, ~timeout: int=?, ~arguments: any) => int =
51+
external setInterval: (window, ~handler: string, ~timeout: int=?, ~arguments: JSON.t) => int =
5252
"setInterval"
5353

5454
/**
5555
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setInterval)
5656
*/
5757
@send
58-
external setInterval2: (window, ~handler: unit => unit, ~timeout: int=?, ~arguments: any) => int =
59-
"setInterval"
58+
external setInterval2: (
59+
window,
60+
~handler: unit => unit,
61+
~timeout: int=?,
62+
~arguments: JSON.t,
63+
) => int = "setInterval"
6064

6165
/**
6266
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/clearInterval)
@@ -491,7 +495,7 @@ Throws a "DataCloneError" DOMException if transfer array contains duplicate obje
491495
@send
492496
external postMessage: (
493497
window,
494-
~message: any,
498+
~message: JSON.t,
495499
~targetOrigin: string,
496500
~transfer: array<Dict.t<string>>=?,
497501
) => unit = "postMessage"
@@ -509,7 +513,7 @@ Throws a "DataCloneError" DOMException if transfer array contains duplicate obje
509513
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/postMessage)
510514
*/
511515
@send
512-
external postMessage2: (window, ~message: any, ~options: windowPostMessageOptions=?) => unit =
516+
external postMessage2: (window, ~message: JSON.t, ~options: windowPostMessageOptions=?) => unit =
513517
"postMessage"
514518

515519
/**

src/EventAPI.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ and abortSignal = {
196196
/**
197197
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason)
198198
*/
199-
reason: any,
199+
reason: JSON.t,
200200
}
201201

202202
type eventListenerOptions = {mutable capture?: bool}

src/EventAPI/AbortController.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Invoking this method will set this object's AbortSignal's aborted flag and signa
1212
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
1313
*/
1414
@send
15-
external abort: (abortController, ~reason: any=?) => unit = "abort"
15+
external abort: (abortController, ~reason: JSON.t=?) => unit = "abort"

src/EventAPI/AbortSignal.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ external dispatchEvent: (abortSignal, event) => bool = "dispatchEvent"
112112
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
113113
*/
114114
@scope("AbortSignal")
115-
external abort: (~reason: any=?) => abortSignal = "abort"
115+
external abort: (~reason: JSON.t=?) => abortSignal = "abort"
116116

117117
/**
118118
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static)

src/FetchAPI/Request.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ external formData: request => Promise.t<formData> = "formData"
4242
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/json)
4343
*/
4444
@send
45-
external json: request => Promise.t<any> = "json"
45+
external json: request => Promise.t<JSON.t> = "json"
4646

4747
/**
4848
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/text)

src/FetchAPI/Response.res

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ external formData: response => Promise.t<formData> = "formData"
7272
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/json)
7373
*/
7474
@send
75-
external json: response => Promise.t<any> = "json"
75+
external json: response => Promise.t<JSON.t> = "json"
7676

7777
/**
7878
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/text)
@@ -96,7 +96,7 @@ external redirect: (~url: string, ~status: int=?) => response = "redirect"
9696
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/json_static)
9797
*/
9898
@scope("Response")
99-
external json: (~data: any, ~init: responseInit=?) => response = "json"
99+
external jsonR: (~data: JSON.t, ~init: responseInit=?) => response = "json"
100100

101101
/**
102102
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/clone)

src/FileAPI.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ type writableStreamDefaultWriter<'t> = any
139139

140140
type fileSystemWriteChunkType = any
141141

142-
type underlyingSourceCancelCallback = any => Promise.t<unit>
142+
type underlyingSourceCancelCallback = JSON.t => Promise.t<unit>
143143

144144
type blobPropertyBag = {
145145
@as("type") mutable type_?: string,

src/FileAPI/FileSystemWritableFileStream.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ open FileAPI
55
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/abort)
66
*/
77
@send
8-
external abort: (fileSystemWritableFileStream, ~reason: any=?) => Promise.t<unit> = "abort"
8+
external abort: (fileSystemWritableFileStream, ~reason: JSON.t=?) => Promise.t<unit> = "abort"
99

1010
/**
1111
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/close)

src/FileAPI/ReadableStream.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ external make3: unit => unknown = "ReadableStream"
2323
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel)
2424
*/
2525
@send
26-
external cancel: (readableStream<'r>, ~reason: any=?) => Promise.t<unit> = "cancel"
26+
external cancel: (readableStream<'r>, ~reason: JSON.t=?) => Promise.t<unit> = "cancel"
2727

2828
/**
2929
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)

src/FileAPI/WritableStream.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ external make: (
1414
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/abort)
1515
*/
1616
@send
17-
external abort: (writableStream<'w>, ~reason: any=?) => Promise.t<unit> = "abort"
17+
external abort: (writableStream<'w>, ~reason: JSON.t=?) => Promise.t<unit> = "abort"
1818

1919
/**
2020
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/close)

src/FileAPI/WritableStreamDefaultController.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ open FileAPI
55
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
66
*/
77
@send
8-
external error: (writableStreamDefaultController, ~e: any=?) => unit = "error"
8+
external error: (writableStreamDefaultController, ~e: JSON.t=?) => unit = "error"

src/HistoryAPI.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ type history = {
2222
/**
2323
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/History/state)
2424
*/
25-
state: any,
25+
state: JSON.t,
2626
}

src/HistoryAPI/History.res

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ external forward: history => unit = "forward"
2323
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/History/pushState)
2424
*/
2525
@send
26-
external pushState: (history, ~data: any, ~unused: string, ~url: string=?) => unit = "pushState"
26+
external pushState: (history, ~data: JSON.t, ~unused: string, ~url: string=?) => unit = "pushState"
2727

2828
/**
2929
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/History/replaceState)
3030
*/
3131
@send
32-
external replaceState: (history, ~data: any, ~unused: string, ~url: string=?) => unit =
32+
external replaceState: (history, ~data: JSON.t, ~unused: string, ~url: string=?) => unit =
3333
"replaceState"

src/IndexedDBAPI/IDBFactory.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ Throws a "DataError" DOMException if either input is not a valid key.
2828
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBFactory/cmp)
2929
*/
3030
@send
31-
external cmp: (idbFactory, ~first: any, ~second: any) => int = "cmp"
31+
external cmp: (idbFactory, ~first: JSON.t, ~second: JSON.t) => int = "cmp"

src/IndexedDBAPI/IDBIndex.res

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ If successful, request's result will be the value, or undefined if there was no
88
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBIndex/get)
99
*/
1010
@send
11-
external get: (idbIndex, any) => idbRequest<any> = "get"
11+
external get: (idbIndex, any) => idbRequest<JSON.t> = "get"
1212

1313
/**
1414
Retrieves the key of the first record matching the given key or key range in query.
@@ -26,7 +26,7 @@ If successful, request's result will be an Array of the values.
2626
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBIndex/getAll)
2727
*/
2828
@send
29-
external getAll: (idbIndex, ~query: any=?, ~count: int=?) => idbRequest<array<any>> = "getAll"
29+
external getAll: (idbIndex, ~query: any=?, ~count: int=?) => idbRequest<array<JSON.t>> = "getAll"
3030

3131
/**
3232
Retrieves the keys of records matching the given key or key range in query (up to count if given).

src/IndexedDBAPI/IDBObjectStore.res

+7-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ If successful, request's result will be the record's key.
1212
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBObjectStore/put)
1313
*/
1414
@send
15-
external put: (idbObjectStore, ~value: any, ~key: idbValidKey=?) => idbRequest<idbValidKey> = "put"
15+
external put: (idbObjectStore, ~value: JSON.t, ~key: idbValidKey=?) => idbRequest<idbValidKey> =
16+
"put"
1617

1718
/**
1819
Adds or updates a record in store with the given value and key.
@@ -25,7 +26,8 @@ If successful, request's result will be the record's key.
2526
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBObjectStore/add)
2627
*/
2728
@send
28-
external add: (idbObjectStore, ~value: any, ~key: idbValidKey=?) => idbRequest<idbValidKey> = "add"
29+
external add: (idbObjectStore, ~value: JSON.t, ~key: idbValidKey=?) => idbRequest<idbValidKey> =
30+
"add"
2931

3032
/**
3133
Deletes records in store with the given key or in the given key range in query.
@@ -52,7 +54,7 @@ If successful, request's result will be the value, or undefined if there was no
5254
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBObjectStore/get)
5355
*/
5456
@send
55-
external get: (idbObjectStore, any) => idbRequest<any> = "get"
57+
external get: (idbObjectStore, any) => idbRequest<JSON.t> = "get"
5658

5759
/**
5860
Retrieves the key of the first record matching the given key or key range in query.
@@ -70,7 +72,8 @@ If successful, request's result will be an Array of the values.
7072
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBObjectStore/getAll)
7173
*/
7274
@send
73-
external getAll: (idbObjectStore, ~query: any=?, ~count: int=?) => idbRequest<array<any>> = "getAll"
75+
external getAll: (idbObjectStore, ~query: any=?, ~count: int=?) => idbRequest<array<JSON.t>> =
76+
"getAll"
7477

7578
/**
7679
Retrieves the keys of records matching the given key or key range in query (up to count if given).

src/NotificationAPI.res

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type notification = {
6262
/**
6363
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/data)
6464
*/
65-
data: any,
65+
data: JSON.t,
6666
}
6767

6868
type notificationOptions = {
@@ -74,7 +74,7 @@ type notificationOptions = {
7474
mutable badge?: string,
7575
mutable silent?: Null.t<bool>,
7676
mutable requireInteraction?: bool,
77-
mutable data?: any,
77+
mutable data?: JSON.t,
7878
}
7979

8080
type getNotificationOptions = {mutable tag?: string}

0 commit comments

Comments
 (0)