Skip to content

Commit

Permalink
Update client types to match Vite (#6770)
Browse files Browse the repository at this point in the history
* fix(types): Update client types to match Vite's

* chore: changeset
  • Loading branch information
Princesseuh authored Apr 6, 2023
1 parent 72fed68 commit 52d7a4a
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-worms-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Updated types to match newer Vite versions
60 changes: 55 additions & 5 deletions packages/astro/client-base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' {
Expand Down Expand Up @@ -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' {
Expand Down Expand Up @@ -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;
Expand All @@ -265,10 +296,6 @@ declare module '*.otf' {
}

// other
declare module '*.wasm' {
const initWasm: (options: WebAssembly.Imports) => Promise<WebAssembly.Exports>;
export default initWasm;
}
declare module '*.webmanifest' {
const src: string;
export default src;
Expand All @@ -282,6 +309,12 @@ declare module '*.txt' {
export default src;
}

// wasm?init
declare module '*.wasm?init' {
const initWasm: (options: WebAssembly.Imports) => Promise<WebAssembly.Instance>;
export default initWasm;
}

// web worker
declare module '*?worker' {
const workerConstructor: {
Expand All @@ -297,13 +330,30 @@ declare module '*?worker&inline' {
export default workerConstructor;
}

declare module '*?worker&url' {
const src: string;
export default src;
}

declare module '*?sharedworker' {
const sharedWorkerConstructor: {
new (): 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;
Expand Down

0 comments on commit 52d7a4a

Please sign in to comment.