-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Generate types for src/service-worker.js
#8127
Comments
We can't generate such types into the types folder because they still need to be manually referenced inside |
Also document how to get types working inside the file closes #8127
* fix: exclude service worker from tsconfig Also document how to get types working inside the file closes #8127 * ws -> sw Co-authored-by: Rich Harris <hello@rich-harris.dev>
The problem with this is that if you import anything inside the |
Describe the problem
At present you need to add types for the service worker to clue TypeScript in about the
WebWorker
scope and setself
toServiceWorkerGlobalScope
.Describe the proposed solution
SvelteKit should generate types into the types folder.
Alternatives considered
Writing my own types. It typically involves adding triple-slash directives in my
src/service-worker.js
.And creating
src/service-worker.d.ts
Importance
nice to have
Additional Information
TS Context: microsoft/TypeScript#14877.
The text was updated successfully, but these errors were encountered: