Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/DOMAPI.res
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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<int>,
data: Uint8ClampedArray.t,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ImageData/colorSpace)
*/
Expand Down
4 changes: 2 additions & 2 deletions src/DOMAPI/ImageData.res
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>,
external makeWithData: (
~data: Uint8ClampedArray.t,
~sw: int,
~sh: int=?,
~settings: imageDataSettings=?,
Expand Down
11 changes: 11 additions & 0 deletions tests/DOMAPI/ImageData__test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions tests/DOMAPI/ImageData__test.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
open DOMAPI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rename file to ImageData_test.res please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx!


let imageData = ImageData.makeWithData(~data=Uint8ClampedArray.fromArray([]), ~sw=100, ~sh=100)

imageData.data->TypedArray.length->Console.log