Skip to content

Commit 7e248ca

Browse files
Type Canvas.toBlob/toDataURL quality argument as number (microsoft#1862)
Co-authored-by: saschanaz <[email protected]>
1 parent ec4a1fb commit 7e248ca

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

baselines/dom.generated.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10410,14 +10410,14 @@ interface HTMLCanvasElement extends HTMLElement {
1041010410
getContext(contextId: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext | null;
1041110411
getContext(contextId: string, options?: any): RenderingContext | null;
1041210412
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/toBlob) */
10413-
toBlob(callback: BlobCallback, type?: string, quality?: any): void;
10413+
toBlob(callback: BlobCallback, type?: string, quality?: number): void;
1041410414
/**
1041510415
* Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.
1041610416
* @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.
1041710417
*
1041810418
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/toDataURL)
1041910419
*/
10420-
toDataURL(type?: string, quality?: any): string;
10420+
toDataURL(type?: string, quality?: number): string;
1042110421
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/transferControlToOffscreen) */
1042210422
transferControlToOffscreen(): OffscreenCanvas;
1042310423
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;

baselines/ts5.5/dom.generated.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10398,14 +10398,14 @@ interface HTMLCanvasElement extends HTMLElement {
1039810398
getContext(contextId: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext | null;
1039910399
getContext(contextId: string, options?: any): RenderingContext | null;
1040010400
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/toBlob) */
10401-
toBlob(callback: BlobCallback, type?: string, quality?: any): void;
10401+
toBlob(callback: BlobCallback, type?: string, quality?: number): void;
1040210402
/**
1040310403
* Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.
1040410404
* @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.
1040510405
*
1040610406
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/toDataURL)
1040710407
*/
10408-
toDataURL(type?: string, quality?: any): string;
10408+
toDataURL(type?: string, quality?: number): string;
1040910409
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/transferControlToOffscreen) */
1041010410
transferControlToOffscreen(): OffscreenCanvas;
1041110411
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;

inputfiles/overridingTypes.jsonc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,32 @@
13301330
"getContext(contextId: \"webgl\", options?: WebGLContextAttributes): WebGLRenderingContext | null",
13311331
"getContext(contextId: \"webgl2\", options?: WebGLContextAttributes): WebGL2RenderingContext | null"
13321332
]
1333+
},
1334+
"toBlob": {
1335+
"name": "toBlob",
1336+
"signature": {
1337+
"0": {
1338+
"param": [
1339+
{
1340+
"name": "quality",
1341+
"overrideType": "number"
1342+
}
1343+
],
1344+
}
1345+
}
1346+
},
1347+
"toDataURL": {
1348+
"name": "toDataURL",
1349+
"signature": {
1350+
"0": {
1351+
"param": [
1352+
{
1353+
"name": "quality",
1354+
"overrideType": "number"
1355+
}
1356+
],
1357+
}
1358+
}
13331359
}
13341360
}
13351361
}

0 commit comments

Comments
 (0)