rspress-plugin-api-extractor 0.1.0

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.
package/index.d.ts ADDED
@@ -0,0 +1,831 @@
1
+ import { ApiItemKind } from '@microsoft/api-extractor-model';
2
+ import type { ApiModel } from '@microsoft/api-extractor-model';
3
+ import { RspressPlugin } from '@rspress/shared';
4
+ import { Schema } from 'effect';
5
+
6
+ /**
7
+ * RSPress plugin for generating API documentation from API Extractor model
8
+ * files. Config helpers are available under `ApiExtractorPlugin.api`.
9
+ */
10
+ export declare const ApiExtractorPlugin: typeof ApiExtractorPluginImpl & {
11
+ api: {
12
+ fromFolder: typeof fromFolder;
13
+ fromModelsDir: typeof fromModelsDir;
14
+ };
15
+ };
16
+
17
+ /**
18
+ * RSPress plugin for generating API documentation from API Extractor model files
19
+ */
20
+ declare function ApiExtractorPluginImpl(rawOptions: ApiExtractorPluginOptions): RspressPlugin;
21
+
22
+ export declare const ApiExtractorPluginOptions: Schema.mutable<Schema.Struct<{
23
+ api: Schema.optional<Schema.mutable<Schema.Struct<{
24
+ packageName: typeof Schema.String;
25
+ name: Schema.optional<typeof Schema.String>;
26
+ baseRoute: Schema.optional<typeof Schema.String>;
27
+ apiFolder: Schema.optional<Schema.Union<[typeof Schema.String, typeof Schema.Null]>>;
28
+ model: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
29
+ packageJson: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
30
+ versions: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>, Schema.mutable<Schema.Struct<{
31
+ model: Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>;
32
+ packageJson: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
33
+ categories: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
34
+ displayName: typeof Schema.String;
35
+ singularName: typeof Schema.String;
36
+ folderName: typeof Schema.String;
37
+ itemKinds: Schema.optional<Schema.mutable<Schema.Array$<Schema.declare<ApiItemKind, ApiItemKind, readonly [], never>>>>;
38
+ tsdocModifier: Schema.optional<typeof Schema.String>;
39
+ collapsible: Schema.optionalWith<typeof Schema.Boolean, {
40
+ default: () => true;
41
+ }>;
42
+ collapsed: Schema.optionalWith<typeof Schema.Boolean, {
43
+ default: () => true;
44
+ }>;
45
+ overviewHeaders: Schema.optionalWith<Schema.mutable<Schema.Array$<typeof Schema.Number>>, {
46
+ default: () => number[];
47
+ }>;
48
+ }>>>>>;
49
+ source: Schema.optional<Schema.mutable<Schema.Struct<{
50
+ url: typeof Schema.String;
51
+ ref: Schema.optional<typeof Schema.String>;
52
+ }>>>;
53
+ externalPackages: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
54
+ name: typeof Schema.String;
55
+ version: typeof Schema.String;
56
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
57
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
58
+ }>>>>>;
59
+ autoDetectDependencies: Schema.optional<Schema.mutable<Schema.Struct<{
60
+ dependencies: Schema.optionalWith<typeof Schema.Boolean, {
61
+ default: () => false;
62
+ }>;
63
+ devDependencies: Schema.optionalWith<typeof Schema.Boolean, {
64
+ default: () => false;
65
+ }>;
66
+ peerDependencies: Schema.optionalWith<typeof Schema.Boolean, {
67
+ default: () => true;
68
+ }>;
69
+ autoDependencies: Schema.optionalWith<typeof Schema.Boolean, {
70
+ default: () => true;
71
+ }>;
72
+ }>>>;
73
+ ogImage: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Struct<{
74
+ url: typeof Schema.String;
75
+ secureUrl: Schema.optional<typeof Schema.String>;
76
+ type: Schema.optional<typeof Schema.String>;
77
+ width: Schema.optional<typeof Schema.Number>;
78
+ height: Schema.optional<typeof Schema.Number>;
79
+ alt: Schema.optional<typeof Schema.String>;
80
+ }>>]>>;
81
+ llmsPlugin: Schema.optional<Schema.mutable<Schema.Struct<{
82
+ enabled: Schema.optionalWith<typeof Schema.Boolean, {
83
+ default: () => true;
84
+ }>;
85
+ scopes: Schema.optionalWith<typeof Schema.Boolean, {
86
+ default: () => true;
87
+ }>;
88
+ apiTxt: Schema.optionalWith<typeof Schema.Boolean, {
89
+ default: () => true;
90
+ }>;
91
+ showCopyButton: Schema.optionalWith<typeof Schema.Boolean, {
92
+ default: () => true;
93
+ }>;
94
+ showViewOptions: Schema.optionalWith<typeof Schema.Boolean, {
95
+ default: () => true;
96
+ }>;
97
+ copyButtonText: Schema.optionalWith<typeof Schema.String, {
98
+ default: () => string;
99
+ }>;
100
+ viewOptions: Schema.optionalWith<Schema.mutable<Schema.Array$<Schema.Literal<["markdownLink", "chatgpt", "claude"]>>>, {
101
+ default: () => ["markdownLink", "chatgpt", "claude"];
102
+ }>;
103
+ }>>>;
104
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
105
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
106
+ }>>]>>>>;
107
+ theme: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Struct<{
108
+ light: typeof Schema.String;
109
+ dark: typeof Schema.String;
110
+ }>>, Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>]>>;
111
+ categories: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
112
+ displayName: typeof Schema.String;
113
+ singularName: typeof Schema.String;
114
+ folderName: typeof Schema.String;
115
+ itemKinds: Schema.optional<Schema.mutable<Schema.Array$<Schema.declare<ApiItemKind, ApiItemKind, readonly [], never>>>>;
116
+ tsdocModifier: Schema.optional<typeof Schema.String>;
117
+ collapsible: Schema.optionalWith<typeof Schema.Boolean, {
118
+ default: () => true;
119
+ }>;
120
+ collapsed: Schema.optionalWith<typeof Schema.Boolean, {
121
+ default: () => true;
122
+ }>;
123
+ overviewHeaders: Schema.optionalWith<Schema.mutable<Schema.Array$<typeof Schema.Number>>, {
124
+ default: () => number[];
125
+ }>;
126
+ }>>>>>;
127
+ source: Schema.optional<Schema.mutable<Schema.Struct<{
128
+ url: typeof Schema.String;
129
+ ref: Schema.optional<typeof Schema.String>;
130
+ }>>>;
131
+ externalPackages: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
132
+ name: typeof Schema.String;
133
+ version: typeof Schema.String;
134
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
135
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
136
+ }>>>>>;
137
+ autoDetectDependencies: Schema.optional<Schema.mutable<Schema.Struct<{
138
+ dependencies: Schema.optionalWith<typeof Schema.Boolean, {
139
+ default: () => false;
140
+ }>;
141
+ devDependencies: Schema.optionalWith<typeof Schema.Boolean, {
142
+ default: () => false;
143
+ }>;
144
+ peerDependencies: Schema.optionalWith<typeof Schema.Boolean, {
145
+ default: () => true;
146
+ }>;
147
+ autoDependencies: Schema.optionalWith<typeof Schema.Boolean, {
148
+ default: () => true;
149
+ }>;
150
+ }>>>;
151
+ ogImage: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Struct<{
152
+ url: typeof Schema.String;
153
+ secureUrl: Schema.optional<typeof Schema.String>;
154
+ type: Schema.optional<typeof Schema.String>;
155
+ width: Schema.optional<typeof Schema.Number>;
156
+ height: Schema.optional<typeof Schema.Number>;
157
+ alt: Schema.optional<typeof Schema.String>;
158
+ }>>]>>;
159
+ llmsPlugin: Schema.optional<Schema.mutable<Schema.Struct<{
160
+ enabled: Schema.optionalWith<typeof Schema.Boolean, {
161
+ default: () => true;
162
+ }>;
163
+ scopes: Schema.optionalWith<typeof Schema.Boolean, {
164
+ default: () => true;
165
+ }>;
166
+ apiTxt: Schema.optionalWith<typeof Schema.Boolean, {
167
+ default: () => true;
168
+ }>;
169
+ showCopyButton: Schema.optionalWith<typeof Schema.Boolean, {
170
+ default: () => true;
171
+ }>;
172
+ showViewOptions: Schema.optionalWith<typeof Schema.Boolean, {
173
+ default: () => true;
174
+ }>;
175
+ copyButtonText: Schema.optionalWith<typeof Schema.String, {
176
+ default: () => string;
177
+ }>;
178
+ viewOptions: Schema.optionalWith<Schema.mutable<Schema.Array$<Schema.Literal<["markdownLink", "chatgpt", "claude"]>>>, {
179
+ default: () => ["markdownLink", "chatgpt", "claude"];
180
+ }>;
181
+ }>>>;
182
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
183
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
184
+ }>>>;
185
+ apis: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
186
+ packageName: typeof Schema.String;
187
+ name: Schema.optional<typeof Schema.String>;
188
+ baseRoute: Schema.optional<typeof Schema.String>;
189
+ apiFolder: Schema.optional<Schema.Union<[typeof Schema.String, typeof Schema.Null]>>;
190
+ model: Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>;
191
+ packageJson: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
192
+ theme: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Struct<{
193
+ light: typeof Schema.String;
194
+ dark: typeof Schema.String;
195
+ }>>, Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>]>>;
196
+ categories: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
197
+ displayName: typeof Schema.String;
198
+ singularName: typeof Schema.String;
199
+ folderName: typeof Schema.String;
200
+ itemKinds: Schema.optional<Schema.mutable<Schema.Array$<Schema.declare<ApiItemKind, ApiItemKind, readonly [], never>>>>;
201
+ tsdocModifier: Schema.optional<typeof Schema.String>;
202
+ collapsible: Schema.optionalWith<typeof Schema.Boolean, {
203
+ default: () => true;
204
+ }>;
205
+ collapsed: Schema.optionalWith<typeof Schema.Boolean, {
206
+ default: () => true;
207
+ }>;
208
+ overviewHeaders: Schema.optionalWith<Schema.mutable<Schema.Array$<typeof Schema.Number>>, {
209
+ default: () => number[];
210
+ }>;
211
+ }>>>>>;
212
+ source: Schema.optional<Schema.mutable<Schema.Struct<{
213
+ url: typeof Schema.String;
214
+ ref: Schema.optional<typeof Schema.String>;
215
+ }>>>;
216
+ externalPackages: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
217
+ name: typeof Schema.String;
218
+ version: typeof Schema.String;
219
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
220
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
221
+ }>>>>>;
222
+ autoDetectDependencies: Schema.optional<Schema.mutable<Schema.Struct<{
223
+ dependencies: Schema.optionalWith<typeof Schema.Boolean, {
224
+ default: () => false;
225
+ }>;
226
+ devDependencies: Schema.optionalWith<typeof Schema.Boolean, {
227
+ default: () => false;
228
+ }>;
229
+ peerDependencies: Schema.optionalWith<typeof Schema.Boolean, {
230
+ default: () => true;
231
+ }>;
232
+ autoDependencies: Schema.optionalWith<typeof Schema.Boolean, {
233
+ default: () => true;
234
+ }>;
235
+ }>>>;
236
+ ogImage: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Struct<{
237
+ url: typeof Schema.String;
238
+ secureUrl: Schema.optional<typeof Schema.String>;
239
+ type: Schema.optional<typeof Schema.String>;
240
+ width: Schema.optional<typeof Schema.Number>;
241
+ height: Schema.optional<typeof Schema.Number>;
242
+ alt: Schema.optional<typeof Schema.String>;
243
+ }>>]>>;
244
+ llmsPlugin: Schema.optional<Schema.mutable<Schema.Struct<{
245
+ enabled: Schema.optionalWith<typeof Schema.Boolean, {
246
+ default: () => true;
247
+ }>;
248
+ scopes: Schema.optionalWith<typeof Schema.Boolean, {
249
+ default: () => true;
250
+ }>;
251
+ apiTxt: Schema.optionalWith<typeof Schema.Boolean, {
252
+ default: () => true;
253
+ }>;
254
+ showCopyButton: Schema.optionalWith<typeof Schema.Boolean, {
255
+ default: () => true;
256
+ }>;
257
+ showViewOptions: Schema.optionalWith<typeof Schema.Boolean, {
258
+ default: () => true;
259
+ }>;
260
+ copyButtonText: Schema.optionalWith<typeof Schema.String, {
261
+ default: () => string;
262
+ }>;
263
+ viewOptions: Schema.optionalWith<Schema.mutable<Schema.Array$<Schema.Literal<["markdownLink", "chatgpt", "claude"]>>>, {
264
+ default: () => ["markdownLink", "chatgpt", "claude"];
265
+ }>;
266
+ }>>>;
267
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
268
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
269
+ }>>>>>;
270
+ siteUrl: Schema.optional<typeof Schema.String>;
271
+ ogImage: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Struct<{
272
+ url: typeof Schema.String;
273
+ secureUrl: Schema.optional<typeof Schema.String>;
274
+ type: Schema.optional<typeof Schema.String>;
275
+ width: Schema.optional<typeof Schema.Number>;
276
+ height: Schema.optional<typeof Schema.Number>;
277
+ alt: Schema.optional<typeof Schema.String>;
278
+ }>>]>>;
279
+ defaultCategories: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
280
+ displayName: typeof Schema.String;
281
+ singularName: typeof Schema.String;
282
+ folderName: typeof Schema.String;
283
+ itemKinds: Schema.optional<Schema.mutable<Schema.Array$<Schema.declare<ApiItemKind, ApiItemKind, readonly [], never>>>>;
284
+ tsdocModifier: Schema.optional<typeof Schema.String>;
285
+ collapsible: Schema.optionalWith<typeof Schema.Boolean, {
286
+ default: () => true;
287
+ }>;
288
+ collapsed: Schema.optionalWith<typeof Schema.Boolean, {
289
+ default: () => true;
290
+ }>;
291
+ overviewHeaders: Schema.optionalWith<Schema.mutable<Schema.Array$<typeof Schema.Number>>, {
292
+ default: () => number[];
293
+ }>;
294
+ }>>>>>;
295
+ errors: Schema.optional<Schema.mutable<Schema.Struct<{
296
+ example: Schema.optional<Schema.Literal<["suppress", "show"]>>;
297
+ }>>>;
298
+ llmsPlugin: Schema.optional<Schema.Union<[typeof Schema.Boolean, Schema.mutable<Schema.Struct<{
299
+ enabled: Schema.optionalWith<typeof Schema.Boolean, {
300
+ default: () => true;
301
+ }>;
302
+ scopes: Schema.optionalWith<typeof Schema.Boolean, {
303
+ default: () => true;
304
+ }>;
305
+ apiTxt: Schema.optionalWith<typeof Schema.Boolean, {
306
+ default: () => true;
307
+ }>;
308
+ showCopyButton: Schema.optionalWith<typeof Schema.Boolean, {
309
+ default: () => true;
310
+ }>;
311
+ showViewOptions: Schema.optionalWith<typeof Schema.Boolean, {
312
+ default: () => true;
313
+ }>;
314
+ copyButtonText: Schema.optionalWith<typeof Schema.String, {
315
+ default: () => string;
316
+ }>;
317
+ viewOptions: Schema.optionalWith<Schema.mutable<Schema.Array$<Schema.Literal<["markdownLink", "chatgpt", "claude"]>>>, {
318
+ default: () => ["markdownLink", "chatgpt", "claude"];
319
+ }>;
320
+ }>>]>>;
321
+ logLevel: Schema.optional<Schema.Literal<["none", "info", "verbose", "debug", "warn", "error"]>>;
322
+ performance: Schema.optional<Schema.mutable<Schema.Struct<{
323
+ thresholds: Schema.optional<Schema.mutable<Schema.Struct<{
324
+ slowCodeBlock: Schema.optionalWith<typeof Schema.Number, {
325
+ default: () => number;
326
+ }>;
327
+ slowPageGeneration: Schema.optionalWith<typeof Schema.Number, {
328
+ default: () => number;
329
+ }>;
330
+ slowApiLoad: Schema.optionalWith<typeof Schema.Number, {
331
+ default: () => number;
332
+ }>;
333
+ slowFileOperation: Schema.optionalWith<typeof Schema.Number, {
334
+ default: () => number;
335
+ }>;
336
+ slowHttpRequest: Schema.optionalWith<typeof Schema.Number, {
337
+ default: () => number;
338
+ }>;
339
+ slowDbOperation: Schema.optionalWith<typeof Schema.Number, {
340
+ default: () => number;
341
+ }>;
342
+ }>>>;
343
+ showInsights: Schema.optionalWith<typeof Schema.Boolean, {
344
+ default: () => true;
345
+ }>;
346
+ trackDetailedMetrics: Schema.optionalWith<typeof Schema.Boolean, {
347
+ default: () => false;
348
+ }>;
349
+ }>>>;
350
+ }>>;
351
+
352
+ export declare type ApiExtractorPluginOptions = Schema.Schema.Type<typeof ApiExtractorPluginOptions>;
353
+
354
+ /**
355
+ * How to derive each API's `baseRoute`. One of:
356
+ *
357
+ * - omitted — defaults to the template `"{dirname}"`
358
+ * - a template string — supports the `{dirname}` and `{packageName}` tokens,
359
+ * e.g. `"reference/{dirname}"`. A leading slash is normalized in.
360
+ * - a callback — `(info) => string` for full control.
361
+ *
362
+ * Note: the `{packageName}` token is interpolated verbatim, so for a scoped
363
+ * package it yields the scope too (e.g. `@scope/bar`), which is rarely what you
364
+ * want inside a URL path. Prefer `{dirname}` (the folder name, which is the
365
+ * unscoped name in the rslib-builder layout) or the callback form.
366
+ */
367
+ export declare type BaseRoute = string | ((info: FolderInfo) => string);
368
+
369
+ export declare const CategoryConfig: Schema.mutable<Schema.Struct<{
370
+ displayName: typeof Schema.String;
371
+ singularName: typeof Schema.String;
372
+ folderName: typeof Schema.String;
373
+ itemKinds: Schema.optional<Schema.mutable<Schema.Array$<Schema.declare<ApiItemKind, ApiItemKind, readonly [], never>>>>;
374
+ tsdocModifier: Schema.optional<typeof Schema.String>;
375
+ collapsible: Schema.optionalWith<typeof Schema.Boolean, {
376
+ default: () => true;
377
+ }>;
378
+ collapsed: Schema.optionalWith<typeof Schema.Boolean, {
379
+ default: () => true;
380
+ }>;
381
+ overviewHeaders: Schema.optionalWith<Schema.mutable<Schema.Array$<typeof Schema.Number>>, {
382
+ default: () => number[];
383
+ }>;
384
+ }>>;
385
+
386
+ /**
387
+ * Consumer-facing type uses Encoded (input shape with optional fields).
388
+ * Schema.decode fills in defaults at runtime.
389
+ */
390
+ export declare type CategoryConfig = Schema.Schema.Encoded<typeof CategoryConfig>;
391
+
392
+ /**
393
+ * Built-in default categories
394
+ */
395
+ export declare const DEFAULT_CATEGORIES: Record<string, CategoryConfig>;
396
+
397
+ /** Metadata discovered from a single rslib-builder localPaths package folder. */
398
+ export declare interface FolderInfo {
399
+ /** Absolute path to the package folder. */
400
+ dir: string;
401
+ /** Last path segment of `dir`, e.g. "sdk". */
402
+ dirname: string;
403
+ /** package.json "name", e.g. "vitest-agent-sdk" or "\@scope/pkg". */
404
+ packageName: string;
405
+ /** package.json "version" (empty string if absent). */
406
+ version: string;
407
+ /** Absolute path to the resolved *.api.json model. */
408
+ modelPath: string;
409
+ }
410
+
411
+ /**
412
+ * Build a `MultiApiConfig` by discovering fields from a single package folder
413
+ * produced by `@savvy-web/rslib-builder`'s `localPaths` option.
414
+ */
415
+ declare function fromFolder(dir: string, overrides?: FromFolderOptions): MultiApiConfig;
416
+
417
+ /** Overrides for `fromFolder`. Any MultiApiConfig field wins over discovery. */
418
+ export declare type FromFolderOptions = Omit<Partial<MultiApiConfig>, "baseRoute"> & {
419
+ baseRoute?: BaseRoute;
420
+ /** Base for resolving a relative `dir`. Defaults to process.cwd(). */
421
+ cwd?: string;
422
+ };
423
+
424
+ /**
425
+ * Strictly scan a parent directory of package folders and build one
426
+ * `MultiApiConfig` per subfolder. Every non-dotfile subdirectory MUST be a
427
+ * valid model folder. `options` (minus `cwd`) is applied as shared defaults.
428
+ */
429
+ declare function fromModelsDir(parentDir: string, options?: FromModelsDirOptions): MultiApiConfig[];
430
+
431
+ /** Shared defaults for `fromModelsDir`, applied to every discovered entry. */
432
+ export declare type FromModelsDirOptions = FromFolderOptions;
433
+
434
+ /**
435
+ * Result from a model loader function
436
+ */
437
+ export declare interface LoadedModel {
438
+ /** The API model */
439
+ model: ApiModel;
440
+ /** Optional source config returned by the loader */
441
+ source?: SourceConfig;
442
+ }
443
+
444
+ export declare const LogLevel: Schema.Literal<["none", "info", "verbose", "debug", "warn", "error"]>;
445
+
446
+ export declare type LogLevel = Schema.Schema.Type<typeof LogLevel>;
447
+
448
+ export declare const MultiApiConfig: Schema.mutable<Schema.Struct<{
449
+ packageName: typeof Schema.String;
450
+ name: Schema.optional<typeof Schema.String>;
451
+ baseRoute: Schema.optional<typeof Schema.String>;
452
+ apiFolder: Schema.optional<Schema.Union<[typeof Schema.String, typeof Schema.Null]>>;
453
+ model: Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>;
454
+ packageJson: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
455
+ theme: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Struct<{
456
+ light: typeof Schema.String;
457
+ dark: typeof Schema.String;
458
+ }>>, Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>]>>;
459
+ categories: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
460
+ displayName: typeof Schema.String;
461
+ singularName: typeof Schema.String;
462
+ folderName: typeof Schema.String;
463
+ itemKinds: Schema.optional<Schema.mutable<Schema.Array$<Schema.declare<ApiItemKind, ApiItemKind, readonly [], never>>>>;
464
+ tsdocModifier: Schema.optional<typeof Schema.String>;
465
+ collapsible: Schema.optionalWith<typeof Schema.Boolean, {
466
+ default: () => true;
467
+ }>;
468
+ collapsed: Schema.optionalWith<typeof Schema.Boolean, {
469
+ default: () => true;
470
+ }>;
471
+ overviewHeaders: Schema.optionalWith<Schema.mutable<Schema.Array$<typeof Schema.Number>>, {
472
+ default: () => number[];
473
+ }>;
474
+ }>>>>>;
475
+ source: Schema.optional<Schema.mutable<Schema.Struct<{
476
+ url: typeof Schema.String;
477
+ ref: Schema.optional<typeof Schema.String>;
478
+ }>>>;
479
+ externalPackages: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
480
+ name: typeof Schema.String;
481
+ version: typeof Schema.String;
482
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
483
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
484
+ }>>>>>;
485
+ autoDetectDependencies: Schema.optional<Schema.mutable<Schema.Struct<{
486
+ dependencies: Schema.optionalWith<typeof Schema.Boolean, {
487
+ default: () => false;
488
+ }>;
489
+ devDependencies: Schema.optionalWith<typeof Schema.Boolean, {
490
+ default: () => false;
491
+ }>;
492
+ peerDependencies: Schema.optionalWith<typeof Schema.Boolean, {
493
+ default: () => true;
494
+ }>;
495
+ autoDependencies: Schema.optionalWith<typeof Schema.Boolean, {
496
+ default: () => true;
497
+ }>;
498
+ }>>>;
499
+ ogImage: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Struct<{
500
+ url: typeof Schema.String;
501
+ secureUrl: Schema.optional<typeof Schema.String>;
502
+ type: Schema.optional<typeof Schema.String>;
503
+ width: Schema.optional<typeof Schema.Number>;
504
+ height: Schema.optional<typeof Schema.Number>;
505
+ alt: Schema.optional<typeof Schema.String>;
506
+ }>>]>>;
507
+ llmsPlugin: Schema.optional<Schema.mutable<Schema.Struct<{
508
+ enabled: Schema.optionalWith<typeof Schema.Boolean, {
509
+ default: () => true;
510
+ }>;
511
+ scopes: Schema.optionalWith<typeof Schema.Boolean, {
512
+ default: () => true;
513
+ }>;
514
+ apiTxt: Schema.optionalWith<typeof Schema.Boolean, {
515
+ default: () => true;
516
+ }>;
517
+ showCopyButton: Schema.optionalWith<typeof Schema.Boolean, {
518
+ default: () => true;
519
+ }>;
520
+ showViewOptions: Schema.optionalWith<typeof Schema.Boolean, {
521
+ default: () => true;
522
+ }>;
523
+ copyButtonText: Schema.optionalWith<typeof Schema.String, {
524
+ default: () => string;
525
+ }>;
526
+ viewOptions: Schema.optionalWith<Schema.mutable<Schema.Array$<Schema.Literal<["markdownLink", "chatgpt", "claude"]>>>, {
527
+ default: () => ["markdownLink", "chatgpt", "claude"];
528
+ }>;
529
+ }>>>;
530
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
531
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
532
+ }>>;
533
+
534
+ export declare type MultiApiConfig = Schema.Schema.Type<typeof MultiApiConfig>;
535
+
536
+ export declare const OpenGraphImageConfig: Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Struct<{
537
+ url: typeof Schema.String;
538
+ secureUrl: Schema.optional<typeof Schema.String>;
539
+ type: Schema.optional<typeof Schema.String>;
540
+ width: Schema.optional<typeof Schema.Number>;
541
+ height: Schema.optional<typeof Schema.Number>;
542
+ alt: Schema.optional<typeof Schema.String>;
543
+ }>>]>;
544
+
545
+ export declare type OpenGraphImageConfig = Schema.Schema.Type<typeof OpenGraphImageConfig>;
546
+
547
+ export declare const OpenGraphImageMetadata: Schema.mutable<Schema.Struct<{
548
+ url: typeof Schema.String;
549
+ secureUrl: Schema.optional<typeof Schema.String>;
550
+ type: Schema.optional<typeof Schema.String>;
551
+ width: Schema.optional<typeof Schema.Number>;
552
+ height: Schema.optional<typeof Schema.Number>;
553
+ alt: Schema.optional<typeof Schema.String>;
554
+ }>>;
555
+
556
+ export declare type OpenGraphImageMetadata = Schema.Schema.Type<typeof OpenGraphImageMetadata>;
557
+
558
+ export declare const OpenGraphMetadata: Schema.mutable<Schema.Struct<{
559
+ siteUrl: typeof Schema.String;
560
+ pageRoute: typeof Schema.String;
561
+ description: typeof Schema.String;
562
+ publishedTime: typeof Schema.String;
563
+ modifiedTime: typeof Schema.String;
564
+ section: typeof Schema.String;
565
+ tags: Schema.mutable<Schema.Array$<typeof Schema.String>>;
566
+ ogImage: Schema.optional<Schema.mutable<Schema.Struct<{
567
+ url: typeof Schema.String;
568
+ secureUrl: Schema.optional<typeof Schema.String>;
569
+ type: Schema.optional<typeof Schema.String>;
570
+ width: Schema.optional<typeof Schema.Number>;
571
+ height: Schema.optional<typeof Schema.Number>;
572
+ alt: Schema.optional<typeof Schema.String>;
573
+ }>>>;
574
+ ogType: typeof Schema.String;
575
+ }>>;
576
+
577
+ export declare type OpenGraphMetadata = Schema.Schema.Type<typeof OpenGraphMetadata>;
578
+
579
+ export declare const SingleApiConfig: Schema.mutable<Schema.Struct<{
580
+ packageName: typeof Schema.String;
581
+ name: Schema.optional<typeof Schema.String>;
582
+ baseRoute: Schema.optional<typeof Schema.String>;
583
+ apiFolder: Schema.optional<Schema.Union<[typeof Schema.String, typeof Schema.Null]>>;
584
+ model: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
585
+ packageJson: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
586
+ versions: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>, Schema.mutable<Schema.Struct<{
587
+ model: Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>;
588
+ packageJson: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
589
+ categories: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
590
+ displayName: typeof Schema.String;
591
+ singularName: typeof Schema.String;
592
+ folderName: typeof Schema.String;
593
+ itemKinds: Schema.optional<Schema.mutable<Schema.Array$<Schema.declare<ApiItemKind, ApiItemKind, readonly [], never>>>>;
594
+ tsdocModifier: Schema.optional<typeof Schema.String>;
595
+ collapsible: Schema.optionalWith<typeof Schema.Boolean, {
596
+ default: () => true;
597
+ }>;
598
+ collapsed: Schema.optionalWith<typeof Schema.Boolean, {
599
+ default: () => true;
600
+ }>;
601
+ overviewHeaders: Schema.optionalWith<Schema.mutable<Schema.Array$<typeof Schema.Number>>, {
602
+ default: () => number[];
603
+ }>;
604
+ }>>>>>;
605
+ source: Schema.optional<Schema.mutable<Schema.Struct<{
606
+ url: typeof Schema.String;
607
+ ref: Schema.optional<typeof Schema.String>;
608
+ }>>>;
609
+ externalPackages: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
610
+ name: typeof Schema.String;
611
+ version: typeof Schema.String;
612
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
613
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
614
+ }>>>>>;
615
+ autoDetectDependencies: Schema.optional<Schema.mutable<Schema.Struct<{
616
+ dependencies: Schema.optionalWith<typeof Schema.Boolean, {
617
+ default: () => false;
618
+ }>;
619
+ devDependencies: Schema.optionalWith<typeof Schema.Boolean, {
620
+ default: () => false;
621
+ }>;
622
+ peerDependencies: Schema.optionalWith<typeof Schema.Boolean, {
623
+ default: () => true;
624
+ }>;
625
+ autoDependencies: Schema.optionalWith<typeof Schema.Boolean, {
626
+ default: () => true;
627
+ }>;
628
+ }>>>;
629
+ ogImage: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Struct<{
630
+ url: typeof Schema.String;
631
+ secureUrl: Schema.optional<typeof Schema.String>;
632
+ type: Schema.optional<typeof Schema.String>;
633
+ width: Schema.optional<typeof Schema.Number>;
634
+ height: Schema.optional<typeof Schema.Number>;
635
+ alt: Schema.optional<typeof Schema.String>;
636
+ }>>]>>;
637
+ llmsPlugin: Schema.optional<Schema.mutable<Schema.Struct<{
638
+ enabled: Schema.optionalWith<typeof Schema.Boolean, {
639
+ default: () => true;
640
+ }>;
641
+ scopes: Schema.optionalWith<typeof Schema.Boolean, {
642
+ default: () => true;
643
+ }>;
644
+ apiTxt: Schema.optionalWith<typeof Schema.Boolean, {
645
+ default: () => true;
646
+ }>;
647
+ showCopyButton: Schema.optionalWith<typeof Schema.Boolean, {
648
+ default: () => true;
649
+ }>;
650
+ showViewOptions: Schema.optionalWith<typeof Schema.Boolean, {
651
+ default: () => true;
652
+ }>;
653
+ copyButtonText: Schema.optionalWith<typeof Schema.String, {
654
+ default: () => string;
655
+ }>;
656
+ viewOptions: Schema.optionalWith<Schema.mutable<Schema.Array$<Schema.Literal<["markdownLink", "chatgpt", "claude"]>>>, {
657
+ default: () => ["markdownLink", "chatgpt", "claude"];
658
+ }>;
659
+ }>>>;
660
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
661
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
662
+ }>>]>>>>;
663
+ theme: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Struct<{
664
+ light: typeof Schema.String;
665
+ dark: typeof Schema.String;
666
+ }>>, Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>]>>;
667
+ categories: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
668
+ displayName: typeof Schema.String;
669
+ singularName: typeof Schema.String;
670
+ folderName: typeof Schema.String;
671
+ itemKinds: Schema.optional<Schema.mutable<Schema.Array$<Schema.declare<ApiItemKind, ApiItemKind, readonly [], never>>>>;
672
+ tsdocModifier: Schema.optional<typeof Schema.String>;
673
+ collapsible: Schema.optionalWith<typeof Schema.Boolean, {
674
+ default: () => true;
675
+ }>;
676
+ collapsed: Schema.optionalWith<typeof Schema.Boolean, {
677
+ default: () => true;
678
+ }>;
679
+ overviewHeaders: Schema.optionalWith<Schema.mutable<Schema.Array$<typeof Schema.Number>>, {
680
+ default: () => number[];
681
+ }>;
682
+ }>>>>>;
683
+ source: Schema.optional<Schema.mutable<Schema.Struct<{
684
+ url: typeof Schema.String;
685
+ ref: Schema.optional<typeof Schema.String>;
686
+ }>>>;
687
+ externalPackages: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
688
+ name: typeof Schema.String;
689
+ version: typeof Schema.String;
690
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
691
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
692
+ }>>>>>;
693
+ autoDetectDependencies: Schema.optional<Schema.mutable<Schema.Struct<{
694
+ dependencies: Schema.optionalWith<typeof Schema.Boolean, {
695
+ default: () => false;
696
+ }>;
697
+ devDependencies: Schema.optionalWith<typeof Schema.Boolean, {
698
+ default: () => false;
699
+ }>;
700
+ peerDependencies: Schema.optionalWith<typeof Schema.Boolean, {
701
+ default: () => true;
702
+ }>;
703
+ autoDependencies: Schema.optionalWith<typeof Schema.Boolean, {
704
+ default: () => true;
705
+ }>;
706
+ }>>>;
707
+ ogImage: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Struct<{
708
+ url: typeof Schema.String;
709
+ secureUrl: Schema.optional<typeof Schema.String>;
710
+ type: Schema.optional<typeof Schema.String>;
711
+ width: Schema.optional<typeof Schema.Number>;
712
+ height: Schema.optional<typeof Schema.Number>;
713
+ alt: Schema.optional<typeof Schema.String>;
714
+ }>>]>>;
715
+ llmsPlugin: Schema.optional<Schema.mutable<Schema.Struct<{
716
+ enabled: Schema.optionalWith<typeof Schema.Boolean, {
717
+ default: () => true;
718
+ }>;
719
+ scopes: Schema.optionalWith<typeof Schema.Boolean, {
720
+ default: () => true;
721
+ }>;
722
+ apiTxt: Schema.optionalWith<typeof Schema.Boolean, {
723
+ default: () => true;
724
+ }>;
725
+ showCopyButton: Schema.optionalWith<typeof Schema.Boolean, {
726
+ default: () => true;
727
+ }>;
728
+ showViewOptions: Schema.optionalWith<typeof Schema.Boolean, {
729
+ default: () => true;
730
+ }>;
731
+ copyButtonText: Schema.optionalWith<typeof Schema.String, {
732
+ default: () => string;
733
+ }>;
734
+ viewOptions: Schema.optionalWith<Schema.mutable<Schema.Array$<Schema.Literal<["markdownLink", "chatgpt", "claude"]>>>, {
735
+ default: () => ["markdownLink", "chatgpt", "claude"];
736
+ }>;
737
+ }>>>;
738
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
739
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
740
+ }>>;
741
+
742
+ export declare type SingleApiConfig = Schema.Schema.Type<typeof SingleApiConfig>;
743
+
744
+ export declare const SourceConfig: Schema.mutable<Schema.Struct<{
745
+ url: typeof Schema.String;
746
+ ref: Schema.optional<typeof Schema.String>;
747
+ }>>;
748
+
749
+ export declare type SourceConfig = Schema.Schema.Type<typeof SourceConfig>;
750
+
751
+ export declare const VersionConfig: Schema.mutable<Schema.Struct<{
752
+ model: Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>;
753
+ packageJson: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
754
+ categories: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
755
+ displayName: typeof Schema.String;
756
+ singularName: typeof Schema.String;
757
+ folderName: typeof Schema.String;
758
+ itemKinds: Schema.optional<Schema.mutable<Schema.Array$<Schema.declare<ApiItemKind, ApiItemKind, readonly [], never>>>>;
759
+ tsdocModifier: Schema.optional<typeof Schema.String>;
760
+ collapsible: Schema.optionalWith<typeof Schema.Boolean, {
761
+ default: () => true;
762
+ }>;
763
+ collapsed: Schema.optionalWith<typeof Schema.Boolean, {
764
+ default: () => true;
765
+ }>;
766
+ overviewHeaders: Schema.optionalWith<Schema.mutable<Schema.Array$<typeof Schema.Number>>, {
767
+ default: () => number[];
768
+ }>;
769
+ }>>>>>;
770
+ source: Schema.optional<Schema.mutable<Schema.Struct<{
771
+ url: typeof Schema.String;
772
+ ref: Schema.optional<typeof Schema.String>;
773
+ }>>>;
774
+ externalPackages: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
775
+ name: typeof Schema.String;
776
+ version: typeof Schema.String;
777
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
778
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
779
+ }>>>>>;
780
+ autoDetectDependencies: Schema.optional<Schema.mutable<Schema.Struct<{
781
+ dependencies: Schema.optionalWith<typeof Schema.Boolean, {
782
+ default: () => false;
783
+ }>;
784
+ devDependencies: Schema.optionalWith<typeof Schema.Boolean, {
785
+ default: () => false;
786
+ }>;
787
+ peerDependencies: Schema.optionalWith<typeof Schema.Boolean, {
788
+ default: () => true;
789
+ }>;
790
+ autoDependencies: Schema.optionalWith<typeof Schema.Boolean, {
791
+ default: () => true;
792
+ }>;
793
+ }>>>;
794
+ ogImage: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Struct<{
795
+ url: typeof Schema.String;
796
+ secureUrl: Schema.optional<typeof Schema.String>;
797
+ type: Schema.optional<typeof Schema.String>;
798
+ width: Schema.optional<typeof Schema.Number>;
799
+ height: Schema.optional<typeof Schema.Number>;
800
+ alt: Schema.optional<typeof Schema.String>;
801
+ }>>]>>;
802
+ llmsPlugin: Schema.optional<Schema.mutable<Schema.Struct<{
803
+ enabled: Schema.optionalWith<typeof Schema.Boolean, {
804
+ default: () => true;
805
+ }>;
806
+ scopes: Schema.optionalWith<typeof Schema.Boolean, {
807
+ default: () => true;
808
+ }>;
809
+ apiTxt: Schema.optionalWith<typeof Schema.Boolean, {
810
+ default: () => true;
811
+ }>;
812
+ showCopyButton: Schema.optionalWith<typeof Schema.Boolean, {
813
+ default: () => true;
814
+ }>;
815
+ showViewOptions: Schema.optionalWith<typeof Schema.Boolean, {
816
+ default: () => true;
817
+ }>;
818
+ copyButtonText: Schema.optionalWith<typeof Schema.String, {
819
+ default: () => string;
820
+ }>;
821
+ viewOptions: Schema.optionalWith<Schema.mutable<Schema.Array$<Schema.Literal<["markdownLink", "chatgpt", "claude"]>>>, {
822
+ default: () => ["markdownLink", "chatgpt", "claude"];
823
+ }>;
824
+ }>>>;
825
+ tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown), readonly [], never>>;
826
+ compilerOptions: Schema.optional<typeof Schema.Unknown>;
827
+ }>>;
828
+
829
+ export declare type VersionConfig = Schema.Schema.Type<typeof VersionConfig>;
830
+
831
+ export { }