sveld 0.32.6 → 0.32.7

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 (3) hide show
  1. package/README.md +7 -4
  2. package/lib/index.js +451 -451
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1300,9 +1300,11 @@ Descriptions are optional for every slot, including the default slot. Put prose
1300
1300
  * @slot {Type} slot-name [slot description]
1301
1301
  * @snippet {Type} snippet-name [snippet description]
1302
1302
  */
1303
+ ```
1303
1304
 
1304
1305
  Omit the `slot-name` to type the default slot.
1305
1306
 
1307
+ ```js
1306
1308
  /**
1307
1309
  * @slot {Type}
1308
1310
  * @snippet {Type}
@@ -1581,6 +1583,8 @@ export default class Component extends SvelteComponentTyped<
1581
1583
 
1582
1584
  For events with complex object payloads, use `@property` to document individual fields. The main comment becomes the event description.
1583
1585
 
1586
+ This is the idiomatic way to describe each field of an event detail. An inline object literal such as `@event {{ items: string[]; added: string[] }} change` types the payload but cannot carry per-field descriptions, since a nested block comment would terminate the host JSDoc. Declare the detail with `@type {object}` and `@property` instead to document every field.
1587
+
1584
1588
  **Signature:**
1585
1589
 
1586
1590
  ```js
@@ -2118,8 +2122,7 @@ Because `sveld` targets JavaScript-only usage as a baseline, generics use the st
2118
2122
  * @typedef {{ id: string | number; [key: string]: any; }} DataTableRow
2119
2123
  * @typedef {Exclude<keyof Row, "id">} DataTableKey<Row>
2120
2124
  * @typedef {{ key: DataTableKey<Row>; value: string; }} DataTableHeader<Row=DataTableRow>
2121
- * @template {DataTableRow} <Row extends DataTableRow = DataTableRow>
2122
- * @generics {Row extends DataTableRow = DataTableRow} Row
2125
+ * @template {DataTableRow} [Row=DataTableRow]
2123
2126
  */
2124
2127
 
2125
2128
  let {
@@ -2142,8 +2145,7 @@ Because `sveld` targets JavaScript-only usage as a baseline, generics use the st
2142
2145
  * @typedef {{ id: string | number; [key: string]: any; }} DataTableRow
2143
2146
  * @typedef {Exclude<keyof Row, "id">} DataTableKey<Row>
2144
2147
  * @typedef {{ key: DataTableKey<Row>; value: string; }} DataTableHeader<Row=DataTableRow>
2145
- * @template {DataTableRow} <Row extends DataTableRow = DataTableRow>
2146
- * @generics {Row extends DataTableRow = DataTableRow} Row
2148
+ * @template {DataTableRow} [Row=DataTableRow]
2147
2149
  */
2148
2150
 
2149
2151
  /** @type {ReadonlyArray<DataTableHeader<Row>>} */
@@ -2160,6 +2162,7 @@ Generated output looks like this:
2160
2162
 
2161
2163
  ```ts
2162
2164
  export type ComponentProps<Row extends DataTableRow = DataTableRow> = {
2165
+ headers?: ReadonlyArray<DataTableHeader<Row>>;
2163
2166
  rows?: ReadonlyArray<Row>;
2164
2167
  };
2165
2168