-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make global declaration the default #8276
Labels
Comments
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; |
dummdidumm
added a commit
that referenced
this issue
Jan 12, 2023
5 tasks
dummdidumm
added a commit
that referenced
this issue
Jan 12, 2023
Rich-Harris
added a commit
that referenced
this issue
Jan 13, 2023
* fix: adjust `app.d.ts` to diminish confusion about imports closes #8276 * Apply suggestions from code review * Update packages/kit/types/ambient.d.ts Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
This was referenced Sep 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: