-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Typescript Generics #2204
Comments
You can use <script lang="ts">
type T = $$Generic<Record<string, number>>;
export let data: T;
export let keys: (keyof T)[];
</script> <script lang="ts">
import Test from './test.svelte';
</script>
<Test data={{ a: 1 }} keys={['a']}></Test> |
That is deprecated syntax.
|
Thx @david-plugge I confirm that it's working well 👍 In the mean time, I'm good with |
Fixed on the language tools side, release pending - but this likely also needs changes in |
take into account boolean attributes #2204
...when detecting script language Related to sveltejs/language-tools#2204
Related to sveltejs/language-tools#2204 / sveltejs/language-tools#2039 The Svelte 5 version of #9486 and #9498
Related to sveltejs/language-tools#2204 / sveltejs/language-tools#2039 The Svelte 5 version of #9486 and #9498 --------- Co-authored-by: Rich Harris <[email protected]> Co-authored-by: Rich Harris <[email protected]>
* fix: handle closing tags in attributes ...when detecting script language Related to sveltejs/language-tools#2204 * Update packages/vite-plugin-svelte/src/utils/compile.js Co-authored-by: Dominik G. <[email protected]> --------- Co-authored-by: Dominik G. <[email protected]>
This works now using the latest version of the extension/svelte-check/svelte |
Describe the bug
In https://github.com/dummdidumm/rfcs/blob/ts-typedefs-within-svelte-components/text/ts-typing-props-slots-events.md#generics I was able to learn about
generics
.I would like to have:
Unfortunalty I get
ERROR: Unterminated string literal
. (probably due to<
and>
parsing).Timing seems great, I'm wondering if sveltejs/svelte#9482 will not solve this at the same time?
Reproduction
https://github.com/jycouet/kit-generics
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: