Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Webapi.Canvas.toBlob & Webapi.Canvas.toDataUrl methods #111

Merged
merged 1 commit into from
Nov 3, 2022
Merged
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
8 changes: 8 additions & 0 deletions src/Webapi/Webapi__Canvas.res
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ module WebGl = Webapi__Canvas__WebGl
module CanvasElement = {
@send external getContext2d: (Dom.element, @as("2d") _) => Canvas2d.t = "getContext"
@send external getContextWebGl: (Dom.element, @as("webgl") _) => WebGl.glT = "getContext"
@send external toBlob: (Dom.element, Blob.t => unit) => unit = "toBlob"
@send external toBlobWithType: (Dom.element, Blob.t => unit, string) => unit = "toBlob"
@send
external toBlobWithTypeAndQuality: (Dom.element, Blob.t => unit, string, float) => unit = "toBlob"
@send external toDataUrl: Dom.element => unit = "toDataUrl"
@send external toDataUrlWithType: (Dom.element, string) => unit = "toDataUrl"
@send
external toDataUrlWithTypeAndEncoderOptions: (Dom.element, string, float) => unit = "toDataUrl"
@get external height: Dom.element => int = "height"
@set external setHeight: (Dom.element, int) => unit = "height"
@get external width: Dom.element => int = "width"
Expand Down