You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, huge thanks for this library! 🎉 It's a joy to work with.
I'm running into an issue with global exports defined in <script context="module" /> blocks. The generated type annotation does not properly reflect the static export.
Say for example I have the following single component:
Say I publish this package as my-cool-welcome-svelte-component, then in another typescript-powered Svelte app I can import the component and log() as expected:
However, TS will error and say that log is not exported by my-cool-welcome-svelte-component. I am not a TypeScript expert, so please forgive if my thinking is incorrect, but the issue appears to be that log will be typed as a static class method rather than a normal export.
Currently the types/welcome.svelte.d.ts looks as follows:
Is there an issue with my setup or is this a limitation of Sveld? If it's a limitation, do you guys by chance have an idea how one could still make log() appear as a normal export type log = (message: string) => void;?
The text was updated successfully, but these errors were encountered:
First of all, huge thanks for this library! 🎉 It's a joy to work with.
I'm running into an issue with global exports defined in
<script context="module" />
blocks. The generated type annotation does not properly reflect the static export.Say for example I have the following single component:
To generate type definitions with Sveld I'd add the following
index.js
file:Say I publish this package as
my-cool-welcome-svelte-component
, then in another typescript-powered Svelte app I can import the component andlog()
as expected:However, TS will error and say that
log
is not exported bymy-cool-welcome-svelte-component
. I am not a TypeScript expert, so please forgive if my thinking is incorrect, but the issue appears to be thatlog
will be typed as a static class method rather than a normal export.Currently the
types/welcome.svelte.d.ts
looks as follows:Is there an issue with my setup or is this a limitation of Sveld? If it's a limitation, do you guys by chance have an idea how one could still make
log()
appear as a normalexport type log = (message: string) => void;
?The text was updated successfully, but these errors were encountered: