sveld 0.25.10 → 0.25.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +34 -19
  2. package/lib/ComponentParser.d.ts +714 -5
  3. package/lib/ComponentParser.js +1640 -332
  4. package/lib/cli.d.ts +14 -0
  5. package/lib/cli.js +14 -0
  6. package/lib/create-exports.d.ts +41 -0
  7. package/lib/create-exports.js +107 -16
  8. package/lib/element-tag-map.d.ts +69 -0
  9. package/lib/element-tag-map.js +73 -6
  10. package/lib/index.js +4 -4
  11. package/lib/parse-exports.d.ts +22 -0
  12. package/lib/parse-exports.js +22 -0
  13. package/lib/resolve-alias.d.ts +48 -0
  14. package/lib/resolve-alias.js +83 -15
  15. package/lib/rollup-plugin.d.ts +41 -0
  16. package/lib/rollup-plugin.js +97 -8
  17. package/lib/sveld.d.ts +21 -0
  18. package/lib/sveld.js +21 -0
  19. package/lib/writer/MarkdownWriterBase.d.ts +29 -0
  20. package/lib/writer/MarkdownWriterBase.js +70 -0
  21. package/lib/writer/Writer.d.ts +77 -0
  22. package/lib/writer/Writer.js +78 -0
  23. package/lib/writer/WriterMarkdown.d.ts +28 -9
  24. package/lib/writer/WriterMarkdown.js +37 -48
  25. package/lib/writer/markdown-format-utils.d.ts +106 -0
  26. package/lib/writer/markdown-format-utils.js +108 -3
  27. package/lib/writer/markdown-render-utils.d.ts +16 -0
  28. package/lib/writer/markdown-render-utils.js +89 -0
  29. package/lib/writer/writer-json.d.ts +26 -0
  30. package/lib/writer/writer-json.js +80 -3
  31. package/lib/writer/writer-markdown-core.d.ts +19 -14
  32. package/lib/writer/writer-markdown-core.js +22 -114
  33. package/lib/writer/writer-markdown.d.ts +22 -0
  34. package/lib/writer/writer-markdown.js +24 -54
  35. package/lib/writer/writer-ts-definitions-core.d.ts +22 -0
  36. package/lib/writer/writer-ts-definitions-core.js +337 -104
  37. package/lib/writer/writer-ts-definitions.d.ts +58 -0
  38. package/lib/writer/writer-ts-definitions.js +43 -7
  39. package/package.json +1 -1
package/README.md CHANGED
@@ -8,11 +8,11 @@
8
8
 
9
9
  The purpose of this project is to make third party Svelte component libraries compatible with the Svelte Language Server and TypeScript with minimal effort required by the author. For example, TypeScript definitions may be used during development via intelligent code completion in Integrated Development Environments (IDE) like VSCode.
10
10
 
11
- [Carbon Components Svelte](https://github.com/IBM/carbon-components-svelte) uses this library to auto-generate component types and API metadata:
11
+ [Carbon Components Svelte](https://github.com/carbon-design-system/carbon-components-svelte) uses this library to auto-generate component types and API metadata:
12
12
 
13
- - [TypeScript definitions](https://github.com/IBM/carbon-components-svelte/blob/master/types): Component TypeScript definitions
14
- - [Component Index](https://github.com/IBM/carbon-components-svelte/blob/master/COMPONENT_INDEX.md): Markdown file documenting component props, slots, and events
15
- - [Component API](https://github.com/IBM/carbon-components-svelte/blob/master/docs/src/COMPONENT_API.json): Component API metadata in JSON format
13
+ - [TypeScript definitions](https://github.com/carbon-design-system/carbon-components-svelte/blob/master/types): Component TypeScript definitions
14
+ - [Component Index](https://github.com/carbon-design-system/carbon-components-svelte/blob/master/COMPONENT_INDEX.md): Markdown file documenting component props, slots, and events
15
+ - [Component API](https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/COMPONENT_API.json): Component API metadata in JSON format
16
16
 
17
17
  **Note:** `sveld` supports Svelte 3, 4, and 5, but does not support Svelte 5-specific syntax or runes-only usage. Components must use traditional Svelte syntax (e.g., `export let` for props, not `$props()`).
18
18
 
@@ -430,9 +430,12 @@ Output:
430
430
 
431
431
  ```ts
432
432
  export type User = {
433
- /** The user's full name */ name: string;
434
- /** The user's email address */ email: string;
435
- /** The user's age in years */ age: number;
433
+ /** The user's full name */
434
+ name: string;
435
+ /** The user's email address */
436
+ email: string;
437
+ /** The user's age in years */
438
+ age: number;
436
439
  };
437
440
 
438
441
  export type ComponentProps = {
@@ -478,10 +481,14 @@ Output:
478
481
 
479
482
  ```ts
480
483
  export type ComponentConfig = {
481
- /** Whether the component is enabled */ enabled: boolean;
482
- /** The component theme */ theme: string;
483
- /** Optional timeout in milliseconds @default 5000 */ timeout?: number;
484
- /** Optional debug mode flag */ debug?: boolean;
484
+ /** Whether the component is enabled */
485
+ enabled: boolean;
486
+ /** The component theme */
487
+ theme: string;
488
+ /** Optional timeout in milliseconds @default 5000 */
489
+ timeout?: number;
490
+ /** Optional debug mode flag */
491
+ debug?: boolean;
485
492
  };
486
493
 
487
494
  export type ComponentProps = {
@@ -735,9 +742,12 @@ export default class Component extends SvelteComponentTyped<
735
742
  {
736
743
  /** Fired when the user submits the form */
737
744
  submit: CustomEvent<{
738
- /** The user's name */ name: string;
739
- /** The user's email address */ email: string;
740
- /** Whether the user opted into the newsletter */ newsletter: boolean;
745
+ /** The user's name */
746
+ name: string;
747
+ /** The user's email address */
748
+ email: string;
749
+ /** Whether the user opted into the newsletter */
750
+ newsletter: boolean;
741
751
  }>;
742
752
  },
743
753
  Record<string, never>
@@ -782,10 +792,14 @@ export default class Component extends SvelteComponentTyped<
782
792
  {
783
793
  /** Snowball event fired when throwing a snowball */
784
794
  snowball: CustomEvent<{
785
- /** Indicates whether the snowball is tightly packed */ isPacked: boolean;
786
- /** The speed of the snowball in mph */ speed: number;
787
- /** Optional color of the snowball */ color?: string;
788
- /** Optional density with default value @default 0.9 */ density?: number;
795
+ /** Indicates whether the snowball is tightly packed */
796
+ isPacked: boolean;
797
+ /** The speed of the snowball in mph */
798
+ speed: number;
799
+ /** Optional color of the snowball */
800
+ color?: string;
801
+ /** Optional density with default value @default 0.9 */
802
+ density?: number;
789
803
  }>;
790
804
  },
791
805
  Record<string, never>
@@ -1171,7 +1185,8 @@ Output:
1171
1185
 
1172
1186
  ```ts
1173
1187
  export type NotificationData = {
1174
- /** Optional id for deduplication */ id?: string;
1188
+ /** Optional id for deduplication */
1189
+ id?: string;
1175
1190
  kind?: "error" | "info" | "success";
1176
1191
  };
1177
1192