From 52d7a4a011a3bb722b522fffd88c5fe9a519a196 Mon Sep 17 00:00:00 2001 From: Erika <3019731+Princesseuh@users.noreply.github.com> Date: Thu, 6 Apr 2023 15:13:13 +0200 Subject: [PATCH] Update client types to match Vite (#6770) * fix(types): Update client types to match Vite's * chore: changeset --- .changeset/fast-worms-agree.md | 5 +++ packages/astro/client-base.d.ts | 60 ++++++++++++++++++++++++++++++--- 2 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 .changeset/fast-worms-agree.md diff --git a/.changeset/fast-worms-agree.md b/.changeset/fast-worms-agree.md new file mode 100644 index 000000000000..02b24f299c8c --- /dev/null +++ b/.changeset/fast-worms-agree.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Updated types to match newer Vite versions diff --git a/packages/astro/client-base.d.ts b/packages/astro/client-base.d.ts index 3c591b64d696..52bd5870fc77 100644 --- a/packages/astro/client-base.d.ts +++ b/packages/astro/client-base.d.ts @@ -178,6 +178,10 @@ declare module '*.module.pcss' { const classes: CSSModuleClasses; export default classes; } +declare module '*.module.sss' { + const classes: CSSModuleClasses; + export default classes; +} // CSS declare module '*.css' { @@ -208,9 +212,31 @@ declare module '*.pcss' { const css: string; export default css; } +declare module '*.sss' { + const css: string; + export default css; +} // Built-in asset types -// see `src/constants.ts` +// see `src/node/constants.ts` + +// images +declare module '*.jfif' { + const src: string; + export default src; +} +declare module '*.pjpeg' { + const src: string; + export default src; +} +declare module '*.pjp' { + const src: string; + export default src; +} +declare module '*.ico' { + const src: string; + export default src; +} // media declare module '*.mp4' { @@ -242,6 +268,11 @@ declare module '*.aac' { export default src; } +declare module '*.opus' { + const src: string; + export default src; +} + // fonts declare module '*.woff' { const src: string; @@ -265,10 +296,6 @@ declare module '*.otf' { } // other -declare module '*.wasm' { - const initWasm: (options: WebAssembly.Imports) => Promise; - export default initWasm; -} declare module '*.webmanifest' { const src: string; export default src; @@ -282,6 +309,12 @@ declare module '*.txt' { export default src; } +// wasm?init +declare module '*.wasm?init' { + const initWasm: (options: WebAssembly.Imports) => Promise; + export default initWasm; +} + // web worker declare module '*?worker' { const workerConstructor: { @@ -297,6 +330,11 @@ declare module '*?worker&inline' { export default workerConstructor; } +declare module '*?worker&url' { + const src: string; + export default src; +} + declare module '*?sharedworker' { const sharedWorkerConstructor: { new (): SharedWorker; @@ -304,6 +342,18 @@ declare module '*?sharedworker' { export default sharedWorkerConstructor; } +declare module '*?sharedworker&inline' { + const sharedWorkerConstructor: { + new (): SharedWorker; + }; + export default sharedWorkerConstructor; +} + +declare module '*?sharedworker&url' { + const src: string; + export default src; +} + declare module '*?raw' { const src: string; export default src;