kit
kit copied to clipboard
Make global declaration the default
Describe the problem
Seems like every day someone will have an issue with trying to import types in src/app.d.ts
Describe the proposed solution
Why not make the declare global { version the default?
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
IIRC declare global only works if there is an import in the file
Ah, I was wondering what I must be missing
Adding something to force it to be a module might be confusing, although it may still help, e.g.:
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
// and what to do when importing types
declare global {
namespace App {
interface Locals {
name: string
}
// interface PageData {}
// interface Error {}
// interface Platform {}
}
}
// this line can be removed if you add an import to this file:
export default undefined;