Specify return type for drawable promise
This commit is contained in:
parent
a17b13f83a
commit
533d5ad664
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ export async function getDrawable(url: string): Promise<CanvasImageSource> {
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
return await createImageBitmap(blob);
|
return await createImageBitmap(blob);
|
||||||
} else {
|
} else {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise<HTMLImageElement>((resolve, reject) => {
|
||||||
const img = document.createElement("img");
|
const img = document.createElement("img");
|
||||||
img.crossOrigin = "anonymous";
|
img.crossOrigin = "anonymous";
|
||||||
img.onload = function() {
|
img.onload = function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue