diff --git a/src/components/earth/my-earth.wc.ts b/src/components/earth/my-earth.wc.ts index 34fc6df..301d27f 100644 --- a/src/components/earth/my-earth.wc.ts +++ b/src/components/earth/my-earth.wc.ts @@ -164,21 +164,18 @@ export class MyEarth extends HTMLElement { #loadTextures = () => new Promise((resolve, reject) => { - const img = this.querySelector("img") as HTMLImageElement; + const img = this.querySelector("img"); if (!img) { - reject(new Error("Image not found")); - return; + return reject(new Error("Image not found")); } if (img.complete) { - resolve(img); - return; + return resolve(img); } img.onload = () => resolve(img); - img.onerror = () => - reject(new Error(`Failed to load image ${img.src}`)); + img.onerror = () => reject(new Error(`Failed to load image ${img.src}`)); }); #handleResize = (width: number, height: number) => { diff --git a/src/env.d.ts b/src/env.d.ts index 4bcfb60..f1283b6 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -1,6 +1,16 @@ /// -declare module '*.png?url' { - const url: string; - export default url; +declare module "*.png?url" { + const url: string; + export default url; +} + +declare module "*.webp?url" { + const url: string; + export default url; +} + +declare module "*.glsl?raw" { + const content: string; + export default content; }