diff --git a/src/DOMAPI.res b/src/DOMAPI.res index be217f4..80fdb61 100644 --- a/src/DOMAPI.res +++ b/src/DOMAPI.res @@ -3020,7 +3020,7 @@ and htmlCollectionOf<'t> = { } /** -A collection of HTML form control elements. +A collection of HTML form control elements. [See HTMLFormControlsCollection on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFormControlsCollection) */ @editor.completeFrom(HTMLFormControlsCollection) and htmlFormControlsCollection = { @@ -9403,7 +9403,7 @@ type imageData = { Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ImageData/data) */ - data: array, + data: Uint8ClampedArray.t, /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ImageData/colorSpace) */ diff --git a/src/DOMAPI/ImageData.res b/src/DOMAPI/ImageData.res index 0598ef6..7cd8701 100644 --- a/src/DOMAPI/ImageData.res +++ b/src/DOMAPI/ImageData.res @@ -10,8 +10,8 @@ external make: (~sw: int, ~sh: int, ~settings: imageDataSettings=?) => imageData [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ImageData) */ @new -external make2: ( - ~data: array, +external makeWithData: ( + ~data: Uint8ClampedArray.t, ~sw: int, ~sh: int=?, ~settings: imageDataSettings=?, diff --git a/tests/DOMAPI/ImageData__test.js b/tests/DOMAPI/ImageData__test.js new file mode 100644 index 0000000..032d1b7 --- /dev/null +++ b/tests/DOMAPI/ImageData__test.js @@ -0,0 +1,11 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + + +let imageData = new ImageData(new Uint8ClampedArray([]), 100, 100); + +console.log(imageData.data.length); + +export { + imageData, +} +/* imageData Not a pure module */ diff --git a/tests/DOMAPI/ImageData__test.res b/tests/DOMAPI/ImageData__test.res new file mode 100644 index 0000000..25ec05a --- /dev/null +++ b/tests/DOMAPI/ImageData__test.res @@ -0,0 +1,5 @@ +open DOMAPI + +let imageData = ImageData.makeWithData(~data=Uint8ClampedArray.fromArray([]), ~sw=100, ~sh=100) + +imageData.data->TypedArray.length->Console.log