Skip to content

Commit

Permalink
Type Canvas.toBlob/toDataURL quality argument as number
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel-rowe committed Dec 12, 2024
1 parent ec4a1fb commit 87e38e6
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
4 changes: 2 additions & 2 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10410,14 +10410,14 @@ interface HTMLCanvasElement extends HTMLElement {
getContext(contextId: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext | null;
getContext(contextId: string, options?: any): RenderingContext | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/toBlob) */
toBlob(callback: BlobCallback, type?: string, quality?: any): void;
toBlob(callback: BlobCallback, type?: string, quality?: number): void;
/**
* Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.
* @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.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/toDataURL)
*/
toDataURL(type?: string, quality?: any): string;
toDataURL(type?: string, quality?: number): string;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/transferControlToOffscreen) */
transferControlToOffscreen(): OffscreenCanvas;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
Expand Down
4 changes: 2 additions & 2 deletions baselines/ts5.5/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10398,14 +10398,14 @@ interface HTMLCanvasElement extends HTMLElement {
getContext(contextId: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext | null;
getContext(contextId: string, options?: any): RenderingContext | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/toBlob) */
toBlob(callback: BlobCallback, type?: string, quality?: any): void;
toBlob(callback: BlobCallback, type?: string, quality?: number): void;
/**
* Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.
* @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.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/toDataURL)
*/
toDataURL(type?: string, quality?: any): string;
toDataURL(type?: string, quality?: number): string;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/transferControlToOffscreen) */
transferControlToOffscreen(): OffscreenCanvas;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
Expand Down
35 changes: 35 additions & 0 deletions inputfiles/overridingTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,41 @@
"getContext(contextId: \"webgl\", options?: WebGLContextAttributes): WebGLRenderingContext | null",
"getContext(contextId: \"webgl2\", options?: WebGLContextAttributes): WebGL2RenderingContext | null"
]
},
"toBlob": {
"name": "toBlob",
"signature": {
"0": {
"param": [
{
"name": "callback"
},
{
"name": "type",
},
{
"name": "quality",
"overrideType": "number"
}
],
}
}
},
"toDataURL": {
"name": "toDataURL",
"signature": {
"0": {
"param": [
{
"name": "type",
},
{
"name": "quality",
"overrideType": "number"
}
],
}
}
}
}
}
Expand Down

0 comments on commit 87e38e6

Please sign in to comment.