-
-
Notifications
You must be signed in to change notification settings - Fork 214
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the problem
In Svelte <=4, it was possible to export JSDOC custom types through the context="module"
<script>
tag by simply declaring the type.
In Svelte 5, it seems that types defined in the module
script are not exported. At least, there's no clear way of doing it or no documentation on it.
Describe the proposed solution
Allow users to export types from the module script, to be imported from anywhere in the project.
$lib/components/MyComponent.svelte
:
<script module>
/** @typedef {"myType"} MyType */
</script>
<script>
</script>
<!-- stuff -->
<style>
</style>
$lib/util/misc.js
:
/** @import { MyType } from "$lib/components/MyComponent.svelte" */
/**
* @param {MyType} x
*/
function stuff(x) {
}
Importance
would make my life easier
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working