Releases: carbon-design-system/sveld
Releases · carbon-design-system/sveld
v0.13.1
v0.13.0
v0.12.1
v0.12.0
Features
-
support props defined via renamed exports (31aec44, #62 contributed by @aabounegm)
Input:
<script> let className = "test"; /** * Just your average CSS class string. * @type {string|null} */ export { className as class }; </script>
Output:
/// <reference types="svelte" /> import { SvelteComponentTyped } from "svelte"; export interface InputProps { /** * Just your average CSS class string. * @default "test" */ class?: string | null; } export default class Input extends SvelteComponentTyped<InputProps, {}, {}> {}
v0.11.1
v0.11.0
Features
-
support writing
<!-- @component -->
comments in Svelte components to TypeScript definitionsInput:
<!-- @component @example <Button> Text </Button> --> <button> <slot /> </button>
Output:
/** * @example * <Button> * Text * </Button> */ export default class Button extends SvelteComponentTyped<ButtonProps, {}, { default: {} }> {}
v0.10.2
Fixes
- tolerate slot spread syntax (
<slot {...props} />
) when parsing Svelte components
Note: the parser will not attempt to infer the type of spread attributes. Add a JSDoc notation if spreading an object to a slot:
<script>
/** @slot {{ a: number; }} */
const props = {
a: 4,
};
</script>
<slot {...props} />