@astryxdesign/cli 0.7.11 → 0.7.12-canary.0085c0f

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 (169) hide show
  1. package/api/build/blocks/blocks.d.mts +41 -0
  2. package/api/build/blocks/blocks.mjs +118 -68
  3. package/api/build/kit/rank.mjs +21 -4
  4. package/api/build/kit/words.d.mts +1 -0
  5. package/api/build/kit/words.mjs +1 -1
  6. package/api/component/__fixtures__/resolutions/modules.txt +5 -5
  7. package/api/docs/_adapter.d.mts +22 -0
  8. package/api/docs/_adapter.mjs +81 -3
  9. package/api/docs/docs.doc.mjs +5 -5
  10. package/api/docs/docs.type.d.mts +21 -0
  11. package/api/docs/docs.type.mjs +11 -0
  12. package/api/docs/list/list.d.mts +5 -1
  13. package/api/docs/list/list.mjs +72 -6
  14. package/api/docs/node/node.mjs +2 -40
  15. package/api/doctor/doctor.d.mts +4 -4
  16. package/api/doctor/doctor.mjs +248 -78
  17. package/api/icon/_adapter.d.mts +3 -2
  18. package/api/icon/_adapter.mjs +8 -2
  19. package/api/icon/_authoring.d.mts +1 -0
  20. package/api/icon/_authoring.mjs +594 -67
  21. package/api/icon/_default-look.d.mts +155 -0
  22. package/api/icon/_default-look.mjs +474 -0
  23. package/api/icon/_records.d.mts +1 -1
  24. package/api/icon/_records.mjs +1 -0
  25. package/api/icon/add/add.mjs +269 -43
  26. package/api/icon/icon.type.d.mts +46 -2
  27. package/api/icon/icon.type.mjs +12 -2
  28. package/api/icon/iconAdd.doc.mjs +2 -2
  29. package/api/icon/iconNewDefinition.doc.mjs +3 -2
  30. package/api/icon/iconNewSet.doc.mjs +4 -4
  31. package/api/icon/map/map.mjs +11 -4
  32. package/api/icon/search/search.mjs +10 -9
  33. package/api/index.d.mts +1 -0
  34. package/api/index.mjs +1 -0
  35. package/api/integration/add-helpers.d.mts +15 -1
  36. package/api/integration/add-helpers.mjs +5 -2
  37. package/api/integration/authoring-checks.d.mts +0 -2
  38. package/api/integration/authoring-checks.mjs +1 -6
  39. package/api/logger.mjs +2 -1
  40. package/api/render/_adapter.mjs +9 -0
  41. package/api/render/render.doc.mjs +3 -3
  42. package/api/render/render.type.d.mts +1 -1
  43. package/api/render/render.type.mjs +1 -1
  44. package/api/search/ORDERING.md +3 -0
  45. package/api/search/_adapter.d.mts +32 -3
  46. package/api/search/_adapter.mjs +50 -22
  47. package/api/search/_fit-order.d.mts +47 -0
  48. package/api/search/_fit-order.mjs +257 -0
  49. package/api/search/_main-searcher.mjs +15 -5
  50. package/api/search/exportSearchIndex.doc.d.mts +10 -0
  51. package/api/search/exportSearchIndex.doc.mjs +58 -0
  52. package/api/search/rankSearchIndex.doc.d.mts +10 -0
  53. package/api/search/rankSearchIndex.doc.mjs +79 -0
  54. package/api/search/search-index.d.mts +44 -0
  55. package/api/search/search-index.mjs +270 -0
  56. package/api/search/search.type.d.mts +28 -0
  57. package/api/search/search.type.mjs +17 -0
  58. package/api/swizzle/_adapter.d.mts +1 -0
  59. package/api/swizzle/_adapter.mjs +4 -1
  60. package/api/swizzle/_moduleGraph.d.mts +178 -0
  61. package/api/swizzle/_moduleGraph.mjs +903 -0
  62. package/api/swizzle/copy/copy.d.mts +2 -43
  63. package/api/swizzle/copy/copy.mjs +287 -315
  64. package/api/swizzle/swizzle.d.mts +0 -2
  65. package/api/swizzle/swizzle.doc.mjs +13 -4
  66. package/api/swizzle/swizzle.mjs +3 -7
  67. package/api/swizzle/swizzle.type.d.mts +7 -1
  68. package/api/swizzle/swizzle.type.mjs +4 -2
  69. package/api/template/skeleton/skeleton.mjs +1 -1
  70. package/api/template/template.mjs +1 -0
  71. package/assets/codemods/transforms/v0.1.0/drop-xds-prefix-imports.mjs +1 -1
  72. package/assets/codemods/transforms/v0.1.0/index.mjs +1 -1
  73. package/assets/discover/official-packages.json +40 -0
  74. package/assets/docs/browser-support.doc.mjs +2 -2
  75. package/assets/docs/styling-overview.doc.mjs +6 -2
  76. package/assets/docs/tree/icon-sets.doc.mjs +13 -7
  77. package/assets/docs/tree/render-pages.doc.mjs +3 -3
  78. package/assets/docs/tree/tailwind.doc.mjs +41 -1
  79. package/assets/docs/tree/type-scale.doc.mjs +19 -2
  80. package/assets/templates/blocks/components/Calendar/useCalendarConstraintsHookUsage.doc.mjs +14 -0
  81. package/assets/templates/blocks/components/Calendar/useCalendarConstraintsHookUsage.tsx +146 -0
  82. package/assets/templates/blocks/components/Calendar/useCalendarNavigationHookUsage.doc.mjs +14 -0
  83. package/assets/templates/blocks/components/Calendar/useCalendarNavigationHookUsage.tsx +173 -0
  84. package/assets/templates/blocks/components/Hooks/useInputStatusIconHookUsage.tsx +1 -0
  85. package/assets/templates/blocks/components/Hooks/useInteractiveRoleHookUsage.doc.mjs +14 -0
  86. package/assets/templates/blocks/components/Hooks/useInteractiveRoleHookUsage.tsx +56 -0
  87. package/assets/templates/blocks/components/Hooks/useStreamingTextHookUsage.doc.mjs +2 -2
  88. package/assets/templates/blocks/components/Hooks/useStreamingTextHookUsage.tsx +66 -10
  89. package/assets/templates/blocks/components/Link/useLinkifyHookUsage.doc.mjs +14 -0
  90. package/assets/templates/blocks/components/Link/useLinkifyHookUsage.tsx +39 -0
  91. package/assets/templates/blocks/components/PowerSearch/usePowerSearchConfigHookUsage.doc.mjs +14 -0
  92. package/assets/templates/blocks/components/PowerSearch/usePowerSearchConfigHookUsage.tsx +83 -0
  93. package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.doc.mjs +14 -0
  94. package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.tsx +41 -0
  95. package/assets/templates/blocks/components/Table/TableRowIndexTable.doc.mjs +1 -1
  96. package/assets/templates/blocks/components/Table/TableRowIndexTable.tsx +2 -2
  97. package/assets/templates/blocks/components/Table/useTableColumnSettingsStateHookUsage.doc.mjs +14 -0
  98. package/assets/templates/blocks/components/Table/useTableColumnSettingsStateHookUsage.tsx +97 -0
  99. package/assets/templates/pages/course-detail/page.tsx +699 -0
  100. package/assets/templates/pages/course-detail/template.doc.mjs +37 -0
  101. package/assets/templates/pages/file-explorer/page.tsx +103 -79
  102. package/assets/templates/pages/table-filter/page.tsx +15 -23
  103. package/assets/templates/pages/table-grouped/page.tsx +190 -262
  104. package/assets/templates/pages/table-grouped/template.doc.mjs +0 -2
  105. package/assets/templates/pages/table-inbox/page.tsx +3 -6
  106. package/assets/templates/pages/theme-showcase/page.tsx +724 -792
  107. package/assets/templates/pages/theme-showcase/template.doc.mjs +4 -5
  108. package/assets/templates/themes/butter/butterTheme.ts +2 -2
  109. package/assets/templates/themes/gothic/gothicTheme.ts +16 -0
  110. package/assets/templates/themes/matcha/matchaTheme.ts +1 -1
  111. package/assets/templates/themes/neutral/neutralTheme.ts +6 -0
  112. package/assets/templates/themes/stone/stoneTheme.ts +1 -1
  113. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
  114. package/assets/templates/themes/y2k/y2kTheme.ts +2 -2
  115. package/authoring/doctypes/template/type.ts +1 -0
  116. package/clients/cli/commands/docs.doc.mjs +5 -1
  117. package/clients/cli/commands/docs.mjs +30 -2
  118. package/clients/cli/commands/experimental/icon.mjs +56 -14
  119. package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
  120. package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +2 -1
  121. package/clients/cli/commands/experimental-icon-new-set.doc.mjs +2 -2
  122. package/clients/cli/commands/experimental-render.doc.mjs +1 -1
  123. package/clients/cli/commands/swizzle.doc.mjs +12 -3
  124. package/clients/cli/commands/swizzle.mjs +33 -9
  125. package/clients/cli/commands/template.mjs +204 -181
  126. package/clients/cli/lib/resolve-theme.mjs +16 -7
  127. package/foundation/discovery/component-discovery.mjs +1 -1
  128. package/foundation/discovery/component-loader.d.mts +1 -1
  129. package/foundation/discovery/doc-types.mjs +9 -2
  130. package/foundation/discovery/hook-discovery.mjs +31 -8
  131. package/foundation/discovery/icon-ranking.d.mts +27 -3
  132. package/foundation/discovery/icon-ranking.mjs +125 -8
  133. package/foundation/discovery/icon-set-checks.mjs +44 -35
  134. package/foundation/discovery/icon-set-discovery.d.mts +13 -0
  135. package/foundation/discovery/icon-set-discovery.mjs +25 -0
  136. package/foundation/discovery/icon-set-writer.d.mts +258 -20
  137. package/foundation/discovery/icon-set-writer.mjs +785 -87
  138. package/foundation/discovery/module-exports.d.mts +3 -2
  139. package/foundation/discovery/module-exports.mjs +167 -37
  140. package/foundation/discovery/template-adapter.mjs +2 -2
  141. package/foundation/doc-compiler/import.d.mts +5 -1
  142. package/foundation/doc-compiler/import.mjs +40 -6
  143. package/foundation/fs/import-url.d.mts +20 -0
  144. package/foundation/fs/import-url.mjs +22 -0
  145. package/foundation/fs/module-loader.d.mts +24 -3
  146. package/foundation/fs/module-loader.mjs +69 -47
  147. package/foundation/fs/paths.d.mts +2 -1
  148. package/foundation/fs/paths.mjs +3 -4
  149. package/foundation/render/charts.d.mts +59 -0
  150. package/foundation/render/charts.mjs +216 -0
  151. package/foundation/render/embedded-imports.d.mts +7 -7
  152. package/foundation/render/embedded-imports.mjs +63 -54
  153. package/foundation/render/page-host.d.mts +4 -0
  154. package/foundation/render/page-host.mjs +45 -0
  155. package/foundation/render/page-worker.mjs +350 -57
  156. package/foundation/render/render-page.d.mts +11 -6
  157. package/foundation/render/render-page.mjs +164 -54
  158. package/foundation/render/ts-paths.d.mts +63 -0
  159. package/foundation/render/ts-paths.mjs +138 -0
  160. package/foundation/response/error-codes.doc.mjs +3 -3
  161. package/foundation/response/error-codes.mjs +3 -2
  162. package/foundation/text/levenshtein.d.mts +6 -1
  163. package/foundation/text/levenshtein.mjs +25 -9
  164. package/foundation/text/shell-arg.d.mts +14 -0
  165. package/foundation/text/shell-arg.mjs +17 -0
  166. package/foundation/text/suggest-order.d.mts +8 -1
  167. package/foundation/text/suggest-order.mjs +72 -6
  168. package/foundation/xle/registry-core.mjs +1 -1
  169. package/package.json +7 -6
@@ -11,7 +11,10 @@
11
11
  export function iconIdOf(name: string): string;
12
12
  /**
13
13
  * The name an icon set exports an icon as: PascalCase ending in `Icon`
14
- * (`Trash2` → `Trash2Icon`; `TrashIcon` stays).
14
+ * (`Trash2` → `Trash2Icon`; `TrashIcon` stays). A JavaScript name cannot
15
+ * start with a digit, so a name that starts with one is refused.
16
+ * {@link iconNaming} keeps a library prefix to prevent this (`fa0` →
17
+ * `Fa0Icon`).
15
18
  * @param {string} name
16
19
  */
17
20
  export function iconExportName(name: string): string;
@@ -27,7 +30,11 @@ export function variantExportName(iconName: string, variant: string): string;
27
30
  * `selector` names, else the only set.
28
31
  * @param {string} cwd
29
32
  * @param {string} [selector] a set name
30
- * @returns {Promise<{packageDir: string, pkg: Record<string, any>, root: string, set: DiscoveredIconSet, sets: DiscoveredIconSet[]}>}
33
+ * The set's `module` names the package as package.json names it now;
34
+ * `moduleRenamed` says the data file still names an old name, so a command
35
+ * writes the data file even when nothing else changes; `moduleUpdate` gives
36
+ * the old and the new name for the receipt, else null.
37
+ * @returns {Promise<{packageDir: string, pkg: Record<string, any>, root: string, set: DiscoveredIconSet, sets: DiscoveredIconSet[], moduleRenamed: boolean, moduleUpdate: {previous: string, module: string} | null}>}
31
38
  */
32
39
  export function findLocalIconSet(cwd: string, selector?: string): Promise<{
33
40
  packageDir: string;
@@ -35,6 +42,11 @@ export function findLocalIconSet(cwd: string, selector?: string): Promise<{
35
42
  root: string;
36
43
  set: DiscoveredIconSet;
37
44
  sets: DiscoveredIconSet[];
45
+ moduleRenamed: boolean;
46
+ moduleUpdate: {
47
+ previous: string;
48
+ module: string;
49
+ } | null;
38
50
  }>;
39
51
  /**
40
52
  * A data file's text, in one fixed shape: fields in schema order, `map` keys
@@ -147,7 +159,9 @@ export function nonIconExports(file: string, options?: {
147
159
  export function libraryPrefix(names: string[]): string[];
148
160
  /**
149
161
  * An export's id and the name the set exports it as, with the library prefix
150
- * left out: `featherEye` with prefix `feather` is id `eye`, `EyeIcon`.
162
+ * left out: `featherEye` with prefix `feather` is id `eye`, `EyeIcon`. A
163
+ * name that would start with a digit keeps the prefix (`fa500px` is
164
+ * `fa-500px`, `Fa500pxIcon`).
151
165
  * @param {string} name
152
166
  * @param {string[]} prefix
153
167
  * @returns {{id: string, name: string}}
@@ -166,29 +180,158 @@ export function modulePrefix(file: string, options?: {
166
180
  adapter?: boolean;
167
181
  exclude?: string[];
168
182
  }): string[];
183
+ /**
184
+ * How a module names its icons: the library prefix every icon export shares
185
+ * ({@link modulePrefix}) and the look words its names end in
186
+ * ({@link lookPositions}), read from its icon exports once. A large module
187
+ * reports its reading, as {@link libraryIcons} does.
188
+ * @param {string} file
189
+ * @param {{adapter?: boolean, module?: string, progress?: (line: string) => void}} [options]
190
+ * `module`: the module as the author named it, for progress; `progress`:
191
+ * hears the reading of a large module
192
+ * @returns {{prefix: string[], positions: Array<Set<string>>}}
193
+ */
194
+ export function moduleNaming(file: string, options?: {
195
+ adapter?: boolean;
196
+ module?: string;
197
+ progress?: (line: string) => void;
198
+ }): {
199
+ prefix: string[];
200
+ positions: Array<Set<string>>;
201
+ };
202
+ /**
203
+ * An export's id and set name ({@link iconNaming}) without the look words
204
+ * its library's names end in ({@link lookPositions}):
205
+ * `XOutline24WGHT500Icon` is `x`, `XIcon`.
206
+ * @param {string} name
207
+ * @param {{prefix: string[], positions: Array<Set<string>>}} naming
208
+ * @returns {{id: string, name: string}}
209
+ */
210
+ export function iconNamingWithoutLook(name: string, { prefix, positions }: {
211
+ prefix: string[];
212
+ positions: Array<Set<string>>;
213
+ }): {
214
+ id: string;
215
+ name: string;
216
+ };
217
+ /**
218
+ * The trailing words a library encodes its looks with: a style, a size, a
219
+ * weight (`XOutline24WGHT500Icon` is `x` in the `outline`, `24`, `wght500`
220
+ * look). A trailing position is a look position when, across at least
221
+ * {@link LOOK_MIN_ICONS} icons, at most {@link LOOK_MAX_VALUES} words fill
222
+ * it, each on at least 5% of the icons and together on at least 90%, and
223
+ * those words name a look ({@link namesLook}); the positions are read from
224
+ * the end while they hold. Glyph names never meet that bar (`trash-2` and
225
+ * `clock-10` are a few icons each, and `up` and `down` are directions), so
226
+ * a library that encodes no looks has none. Reads each id once per
227
+ * position and keeps only counts.
228
+ * @param {string[]} ids every icon's id
229
+ * @returns {Array<Set<string>>} the look positions, the last word first
230
+ */
231
+ export function lookPositions(ids: string[]): Array<Set<string>>;
232
+ /**
233
+ * An id's glyph words and its look words, by {@link lookPositions}:
234
+ * `x-outline-24-wght500` is `x` with `[wght500, 24, outline]`, null where
235
+ * the id has no look word.
236
+ * @param {string[]} words
237
+ * @param {Array<Set<string>>} positions
238
+ * @returns {{base: string[], look: Array<string | null>}}
239
+ */
240
+ export function splitLook(words: string[], positions: Array<Set<string>>): {
241
+ base: string[];
242
+ look: Array<string | null>;
243
+ };
244
+ /**
245
+ * The word each look position prefers: a word of `prefer` it has (the set's
246
+ * default variant), else a usual default style word, else the middle of a
247
+ * series of numbered words (`wght300` … `wght700` gives `wght500`), else
248
+ * its first word in order.
249
+ * @param {Array<Set<string>>} positions
250
+ * @param {string[]} [prefer]
251
+ * @returns {string[]}
252
+ */
253
+ export function preferredLook(positions: Array<Set<string>>, prefer?: string[]): string[];
254
+ /**
255
+ * One icon a library gives.
256
+ * @typedef {object} LibraryIcon
257
+ * @property {string} export the library export it reads
258
+ * @property {string} id
259
+ * @property {string} name the name the set exports it as
260
+ * @property {boolean} adapt
261
+ * @property {string[]} aliases the ids of the other names the library
262
+ * exports the icon as, leaving out the library's own name (`lucide-trash`)
263
+ * @property {Array<string | null>} [look] in a library that encodes looks:
264
+ * this export's look words by position, the last word first
265
+ * @property {string[]} [looks] in a library that encodes looks: every
266
+ * export that draws the glyph, this one included
267
+ */
268
+ /**
269
+ * The words a library's looks are named by, and the look a set takes from
270
+ * it: what {@link libraryIcons} found, for the receipt.
271
+ * @typedef {object} LibraryLookSummary
272
+ * @property {string[][]} positions each position's words, sorted, the last
273
+ * word of a name first
274
+ * @property {string[]} preferred the word taken in each position
275
+ * @property {number} exports how many exports draw the icons
276
+ */
169
277
  /**
170
278
  * Every icon a whole library exports, for wrapping it at once: one entry per
171
279
  * component (and, with an adapter, per data export), read by its `…Icon`
172
280
  * export when it has one (an alias of the same value is recorded once), with
173
281
  * its id and the name the set exports it as from the name, the library
174
282
  * prefix left out ({@link libraryPrefix}).
283
+ *
284
+ * A library that encodes looks in its export names ({@link lookPositions})
285
+ * gives one icon per glyph: the look {@link preferredLook} prefers, its id
286
+ * and name without the look words (`XOutline24WGHT500Icon` is `x`,
287
+ * `XIcon`), and its `looks`, every export that draws the glyph.
175
288
  * @param {string} file
176
- * @param {{adapter?: boolean, exclude?: string[]}} [options] `adapter`:
177
- * whether the set declares one; `exclude`: export names that are not icons
178
- * @returns {Array<{export: string, id: string, name: string, adapt: boolean, aliases: string[]}>}
179
- * `aliases`: the ids of the other names the library exports the icon as,
180
- * leaving out the library's own name (`lucide-trash`)
289
+ * @param {{adapter?: boolean, exclude?: string[], prefer?: string[] | ((positions: Array<Set<string>>) => string[]), module?: string, progress?: (line: string) => void, summary?: (summary: LibraryLookSummary) => void}} [options]
290
+ * `adapter`: whether the set declares one; `exclude`: export names that
291
+ * are not icons; `prefer`: look words to prefer (the set's default
292
+ * variant), or a function that gives them from the library's look
293
+ * positions before any glyph is picked; `module`: the module as the author named it, for progress;
294
+ * `progress`: hears the reading of a large module;
295
+ * `summary`: hears the looks found, when the library has any
296
+ * @returns {LibraryIcon[]}
181
297
  */
182
298
  export function libraryIcons(file: string, options?: {
183
299
  adapter?: boolean;
184
300
  exclude?: string[];
185
- }): Array<{
186
- export: string;
187
- id: string;
188
- name: string;
189
- adapt: boolean;
190
- aliases: string[];
191
- }>;
301
+ prefer?: string[] | ((positions: Array<Set<string>>) => string[]);
302
+ module?: string;
303
+ progress?: (line: string) => void;
304
+ summary?: (summary: LibraryLookSummary) => void;
305
+ }): LibraryIcon[];
306
+ /**
307
+ * The library's icons grouped by glyph when its export names encode looks
308
+ * ({@link libraryIcons}), with the look positions and the words preferred.
309
+ * Without look positions the icons are returned as they are.
310
+ * @param {LibraryIcon[]} all every icon, one per export
311
+ * @param {string[]} [prefer]
312
+ * @returns {{icons: LibraryIcon[], positions: Array<Set<string>>, preferred: string[]}}
313
+ */
314
+ export function libraryLooks(all: LibraryIcon[], prefer?: string[]): {
315
+ icons: LibraryIcon[];
316
+ positions: Array<Set<string>>;
317
+ preferred: string[];
318
+ };
319
+ /**
320
+ * Every icon a library exports, one per export: {@link libraryIcons} before
321
+ * looks are grouped. A large module reports its reading, as
322
+ * {@link libraryIcons} does.
323
+ * @param {string} file
324
+ * @param {{adapter?: boolean, exclude?: string[], module?: string, progress?: (line: string) => void}} [options]
325
+ * `module`: the module as the author named it, for progress; `progress`:
326
+ * hears the reading of a large module
327
+ * @returns {LibraryIcon[]}
328
+ */
329
+ export function everyLibraryIcon(file: string, options?: {
330
+ adapter?: boolean;
331
+ exclude?: string[];
332
+ module?: string;
333
+ progress?: (line: string) => void;
334
+ }): LibraryIcon[];
192
335
  /**
193
336
  * The source of one icon definition file, typed IconDefinitionDoc.
194
337
  * @param {{name: string, description: string, words: string[]}} doc
@@ -199,13 +342,20 @@ export function iconDefinitionSource(doc: {
199
342
  words: string[];
200
343
  }): string;
201
344
  /**
202
- * Check a new icon definition for a set: a camelCase name no Astryx
203
- * definition has, a description, and at least one lower-case word.
345
+ * A new definition's name as written in a command: camelCase as given, or
346
+ * kebab-case as the docs list definitions (`ai-helper` is `aiHelper`).
347
+ * @param {string} name
348
+ */
349
+ export function definitionNameFromInput(name: string): string;
350
+ /**
351
+ * Check a new icon definition for a set: a camelCase name (or its kebab-case
352
+ * form, {@link definitionNameFromInput}) no Astryx definition has, a
353
+ * description, and at least one lower-case word.
204
354
  * @param {DiscoveredIconSet} set
205
- * @param {{name: string, description?: string, words?: string[]}} doc
355
+ * @param {{name: string, description?: string, words?: string[]}} given
206
356
  * @returns {{name: string, description: string, words: string[]}}
207
357
  */
208
- export function checkNewDefinition(set: DiscoveredIconSet, doc: {
358
+ export function checkNewDefinition(set: DiscoveredIconSet, given: {
209
359
  name: string;
210
360
  description?: string;
211
361
  words?: string[];
@@ -232,6 +382,15 @@ export function writeDefinitionFile(set: DiscoveredIconSet, doc: {
232
382
  description: string;
233
383
  words: string[];
234
384
  }): () => void;
385
+ /**
386
+ * Whether a generated declaration file declares what its generated module
387
+ * gives, statement by statement however a formatter left either file
388
+ * ({@link statementTrees}); the header comment is ignored.
389
+ * @param {string} actual the declaration file as it is
390
+ * @param {string} expected {@link generatedTypesText} for the module
391
+ * @param {string} label the declaration file's path, for a parse error
392
+ */
393
+ export function generatedTypesMatch(actual: string, expected: string, label: string): boolean;
235
394
  /**
236
395
  * The generated icons module of a set, from the package root: `generated`
237
396
  * in its data file, else `<set directory>/<set>.generated.js`.
@@ -297,11 +456,13 @@ export function generatedNamesOf(packageDir: string, generated: string, from: st
297
456
  * differently; and a refresh changes only the icons its module supplies.
298
457
  * @param {string} packageDir
299
458
  * @param {string} generated
300
- * @returns {Map<string, {module: string, source: string}>}
459
+ * @returns {Map<string, {module: string, source: string, adapt: boolean}>}
460
+ * `adapt`: the set's adapter turns the export into a component
301
461
  */
302
462
  export function generatedOrigins(packageDir: string, generated: string): Map<string, {
303
463
  module: string;
304
464
  source: string;
465
+ adapt: boolean;
305
466
  }>;
306
467
  /**
307
468
  * Whether two module specifiers name the same module: the same package
@@ -316,6 +477,34 @@ export function sameIconModule(a: string, b: string): boolean;
316
477
  * @param {string} specifier
317
478
  */
318
479
  export function iconModulePackage(specifier: string): string;
480
+ /**
481
+ * The set's exports that read one file of a package, where a refresh from
482
+ * that package's root can read them from the root instead. An export moves
483
+ * when the root exports the same icon: an export that resolves to the same
484
+ * file and binding. When the subpath export cannot be resolved, a root
485
+ * export of the same name counts. Each maps to the root's
486
+ * export and the module it reads now. Empty unless `root` is a package
487
+ * root, not a subpath or a ./ path.
488
+ * @param {Map<string, {module: string, source: string}>} origins the
489
+ * set's exports ({@link generatedOrigins})
490
+ * @param {{file: string, module: string}} root the refreshed module
491
+ * @param {string[]} rootExports the root's icon exports
492
+ * @param {{packageDir: string, pkg: Record<string, any>}} where
493
+ * @returns {Map<string, {source: string, from: string}>}
494
+ */
495
+ export function packageRootMoves(origins: Map<string, {
496
+ module: string;
497
+ source: string;
498
+ }>, root: {
499
+ file: string;
500
+ module: string;
501
+ }, rootExports: string[], where: {
502
+ packageDir: string;
503
+ pkg: Record<string, any>;
504
+ }): Map<string, {
505
+ source: string;
506
+ from: string;
507
+ }>;
319
508
  /**
320
509
  * Write the set's generated module and its declaration file
321
510
  * ({@link generatedModuleText}). Returns whether either changed, and a
@@ -469,6 +658,55 @@ export class IconSetAuthoringError extends Error {
469
658
  }
470
659
  /** The theme map the generated module writes. */
471
660
  export const THEME_MAP_NAME: "themeIcons";
661
+ /**
662
+ * One icon a library gives.
663
+ */
664
+ export type LibraryIcon = {
665
+ /**
666
+ * the library export it reads
667
+ */
668
+ export: string;
669
+ id: string;
670
+ /**
671
+ * the name the set exports it as
672
+ */
673
+ name: string;
674
+ adapt: boolean;
675
+ /**
676
+ * the ids of the other names the library
677
+ * exports the icon as, leaving out the library's own name (`lucide-trash`)
678
+ */
679
+ aliases: string[];
680
+ /**
681
+ * in a library that encodes looks:
682
+ * this export's look words by position, the last word first
683
+ */
684
+ look?: (string | null)[] | undefined;
685
+ /**
686
+ * in a library that encodes looks: every
687
+ * export that draws the glyph, this one included
688
+ */
689
+ looks?: string[] | undefined;
690
+ };
691
+ /**
692
+ * The words a library's looks are named by, and the look a set takes from
693
+ * it: what {@link libraryIcons} found, for the receipt.
694
+ */
695
+ export type LibraryLookSummary = {
696
+ /**
697
+ * each position's words, sorted, the last
698
+ * word of a name first
699
+ */
700
+ positions: string[][];
701
+ /**
702
+ * the word taken in each position
703
+ */
704
+ preferred: string[];
705
+ /**
706
+ * how many exports draw the icons
707
+ */
708
+ exports: number;
709
+ };
472
710
  export type DiscoveredIconSet = import("./icon-set-discovery.mjs").DiscoveredIconSet;
473
711
  export type IconSetData = import("../../authoring/doctypes/icon-set/type").IconSetData;
474
712
  /**