Closed kewp closed 8 months ago
Can you provide PR with fix?
On 11. 5. 2023 8:51, kewp wrote:
i'm getting type errors when using svelecte with typescript (in sveltekit):
<Svelecte
renderer='color-blocks' |Type 'string' is not assignable to type 'null | undefined'.ts(2322) (property) renderer?: null | undefined |— Reply to this email directly, view it on GitHub https://github.com/mskocik/svelecte/issues/167, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCU5FALSOLTZA6JHFVPXETXFSEAPANCNFSM6AAAAAAX5VH6JI. You are receiving this because you are subscribed to this thread.Message ID: @.***>
I'm just getting started with typescript. Not sure how you make a library that works with typescript and without. Normally I start by putting lang='ts'
at the top of my svelte files and then annotate everything like let renderer: string | null
.
Struggling to get a hard link but if you go to Select.svelte.d.ts
here you'll see how this library does it - should work with both normal JS imports and with typescript https://www.npmjs.com/package/svelte-select?activeTab=code
I know these types can be generated from svelte-kit package command. But that's the thing, I would need to refactor the whole codebase to svelte-kit project. Which is scheduled for v4 with better docs etc. but I have no time for it now.
On 11. 5. 2023 10:25, kewp wrote:
Struggling to get a hard link but if you go to |Select.svelte.d.ts| here you'll see how this library does it - should work with both normal JS imports and with typescript https://www.npmjs.com/package/svelte-select?activeTab=code
— Reply to this email directly, view it on GitHub https://github.com/mskocik/svelecte/issues/167#issuecomment-1543559259, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCU5FHNT4TGY2Q7GHLHCJ3XFSO6TANCNFSM6AAAAAAX5VH6JI. You are receiving this because you commented.Message ID: @.***>
Don't you just need that one file i.e. Svelecte.d.ts
?
This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 3 days.
i'm getting type errors when using svelecte with typescript (in sveltekit):