Description
sveld reads Svelte components and generates TypeScript definitions and component documentation for them. You point it at your components, and it writes the types a consumer needs, so editors and the compiler know which props a component accepts. The sample on the site is a button written with Svelte runes, with a type prop, a primary flag, an onclick handler and optional children. The generated output includes a props type with default values taken from JSDoc comments, a rest-props type based on the HTML button element, and a typed children snippet. It also exports a component class that extends SvelteComponentTyped. sveld can write its result as TypeScript, as JSON or as Markdown, so the same analysis can produce type files for your library and reference docs for people who use it. The current version on the site is 0.40.3, and the project is on GitHub in the carbon-design-system organization. It is aimed at developers who publish Svelte component libraries and want typed props and readable docs without writing them by hand.…
Highlights
- TypeScript definitions for Svelte components
- Props types with defaults from JSDoc
- Rest props typed from the wrapped HTML element
- Output as TypeScript, JSON or Markdown
- Source on GitHub in carbon-design-system
Ratings & Reviews
No ratings yet
Be the first to rate Sveld.
People also visit
Sveld FAQ
What does sveld do?
It reads Svelte components and generates TypeScript definitions and documentation, so their props and children are typed.
What output formats does it support?
TypeScript, JSON and Markdown, according to the site.
What do the generated types contain?
A props type with defaults from JSDoc @default tags, rest props typed from the wrapped HTML element, and a children snippet type, plus a component class.
Where is the source?
On GitHub in the carbon-design-system/sveld repository.
What are the best Sveld alternatives?
Popular alternatives to Sveld include Typedoc, Doxdox and Deno Doc. See all Sveld alternatives











