1 | import type { BundledTheme as ShikiTheme } from "shiki" with { "resolution-mode": "import" };
|
2 | import type { LogLevel } from "../loggers";
|
3 | import type { SortStrategy } from "../sort";
|
4 | import type { EntryPointStrategy } from "../entry-point";
|
5 | import type { ReflectionKind } from "../../models/reflections/kind";
|
6 | import type { NeverIfInternal } from "..";
|
7 | import type { TranslationProxy } from "../../internationalization/internationalization";
|
8 |
|
9 | export declare const EmitStrategy: {
|
10 | readonly both: "both";
|
11 | readonly docs: "docs";
|
12 | readonly none: "none";
|
13 | };
|
14 |
|
15 | export type EmitStrategy = (typeof EmitStrategy)[keyof typeof EmitStrategy];
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | export declare const CommentStyle: {
|
21 | readonly JSDoc: "jsdoc";
|
22 | readonly Block: "block";
|
23 | readonly Line: "line";
|
24 | readonly All: "all";
|
25 | };
|
26 | export type CommentStyle = (typeof CommentStyle)[keyof typeof CommentStyle];
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export type TypeDocOptions = {
|
34 | [K in keyof TypeDocOptionMap]: unknown extends TypeDocOptionMap[K] ? unknown : TypeDocOptionMap[K] extends ManuallyValidatedOption<infer ManuallyValidated> ? ManuallyValidated : TypeDocOptionMap[K] extends string | string[] | number | boolean ? TypeDocOptionMap[K] : TypeDocOptionMap[K] extends Record<string, boolean> ? Partial<TypeDocOptionMap[K]> | boolean : keyof TypeDocOptionMap[K] | TypeDocOptionMap[K][keyof TypeDocOptionMap[K]];
|
35 | };
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | export type TypeDocOptionValues = {
|
43 | [K in keyof TypeDocOptionMap]: unknown extends TypeDocOptionMap[K] ? unknown : TypeDocOptionMap[K] extends ManuallyValidatedOption<infer ManuallyValidated> ? ManuallyValidated : TypeDocOptionMap[K] extends string | string[] | number | boolean | Record<string, boolean> ? TypeDocOptionMap[K] : TypeDocOptionMap[K][keyof TypeDocOptionMap[K]];
|
44 | };
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | export interface TypeDocOptionMap {
|
61 | options: string;
|
62 | tsconfig: string;
|
63 | compilerOptions: unknown;
|
64 | plugin: string[];
|
65 | lang: string;
|
66 | locales: ManuallyValidatedOption<Record<string, Record<string, string>>>;
|
67 | packageOptions: ManuallyValidatedOption<TypeDocOptions>;
|
68 | entryPoints: string[];
|
69 | entryPointStrategy: typeof EntryPointStrategy;
|
70 | alwaysCreateEntryPointModule: boolean;
|
71 | projectDocuments: string[];
|
72 | exclude: string[];
|
73 | externalPattern: string[];
|
74 | excludeExternals: boolean;
|
75 | excludeNotDocumented: boolean;
|
76 | excludeNotDocumentedKinds: ReflectionKind.KindString[];
|
77 | excludeInternal: boolean;
|
78 | excludePrivate: boolean;
|
79 | excludeProtected: boolean;
|
80 | excludeReferences: boolean;
|
81 | excludeCategories: string[];
|
82 | maxTypeConversionDepth: number;
|
83 | name: string;
|
84 | includeVersion: boolean;
|
85 | disableSources: boolean;
|
86 | sourceLinkTemplate: string;
|
87 | sourceLinkExternal: boolean;
|
88 | markdownLinkExternal: boolean;
|
89 | disableGit: boolean;
|
90 | gitRevision: string;
|
91 | gitRemote: string;
|
92 | readme: string;
|
93 | out: string;
|
94 | json: string;
|
95 | pretty: boolean;
|
96 | emit: typeof EmitStrategy;
|
97 | theme: string;
|
98 | lightHighlightTheme: ShikiTheme;
|
99 | darkHighlightTheme: ShikiTheme;
|
100 | highlightLanguages: string[];
|
101 | customCss: string;
|
102 | customJs: string;
|
103 | markdownItOptions: ManuallyValidatedOption<Record<string, unknown>>;
|
104 | |
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 | markdownItLoader: ManuallyValidatedOption<(parser: any) => void>;
|
125 | basePath: string;
|
126 | cname: string;
|
127 | githubPages: boolean;
|
128 | hostedBaseUrl: string;
|
129 | useHostedBaseUrlForAbsoluteLinks: boolean;
|
130 | cacheBust: boolean;
|
131 | hideGenerator: boolean;
|
132 | customFooterHtml: string;
|
133 | customFooterHtmlDisableWrapper: boolean;
|
134 | hideParameterTypesInTitle: boolean;
|
135 | searchInComments: boolean;
|
136 | searchInDocuments: boolean;
|
137 | cleanOutputDir: boolean;
|
138 | titleLink: string;
|
139 | navigationLinks: ManuallyValidatedOption<Record<string, string>>;
|
140 | sidebarLinks: ManuallyValidatedOption<Record<string, string>>;
|
141 | navigationLeaves: string[];
|
142 | navigation: {
|
143 | includeCategories: boolean;
|
144 | includeGroups: boolean;
|
145 | includeFolders: boolean;
|
146 | compactFolders: boolean;
|
147 | excludeReferences: boolean;
|
148 | };
|
149 | headings: {
|
150 | readme: boolean;
|
151 | document: boolean;
|
152 | };
|
153 | visibilityFilters: ManuallyValidatedOption<{
|
154 | protected?: boolean;
|
155 | private?: boolean;
|
156 | inherited?: boolean;
|
157 | external?: boolean;
|
158 | [tag: `@${string}`]: boolean;
|
159 | }>;
|
160 | searchCategoryBoosts: ManuallyValidatedOption<Record<string, number>>;
|
161 | searchGroupBoosts: ManuallyValidatedOption<Record<string, number>>;
|
162 | commentStyle: typeof CommentStyle;
|
163 | useTsLinkResolution: boolean;
|
164 | preserveLinkText: boolean;
|
165 | jsDocCompatibility: JsDocCompatibility;
|
166 | suppressCommentWarningsInDeclarationFiles: boolean;
|
167 | blockTags: `@${string}`[];
|
168 | inlineTags: `@${string}`[];
|
169 | modifierTags: `@${string}`[];
|
170 | excludeTags: `@${string}`[];
|
171 | externalSymbolLinkMappings: ManuallyValidatedOption<Record<string, Record<string, string>>>;
|
172 | cascadedModifierTags: `@${string}`[];
|
173 | categorizeByGroup: boolean;
|
174 | defaultCategory: string;
|
175 | categoryOrder: string[];
|
176 | groupOrder: string[];
|
177 | sort: SortStrategy[];
|
178 | sortEntryPoints: boolean;
|
179 | kindSortOrder: ReflectionKind.KindString[];
|
180 | treatWarningsAsErrors: boolean;
|
181 | treatValidationWarningsAsErrors: boolean;
|
182 | intentionallyNotExported: string[];
|
183 | validation: ValidationOptions;
|
184 | requiredToBeDocumented: ReflectionKind.KindString[];
|
185 | watch: boolean;
|
186 | preserveWatchOutput: boolean;
|
187 | help: boolean;
|
188 | version: boolean;
|
189 | showConfig: boolean;
|
190 | logLevel: typeof LogLevel;
|
191 | skipErrorChecking: boolean;
|
192 | }
|
193 |
|
194 |
|
195 |
|
196 |
|
197 | export type ManuallyValidatedOption<T> = {
|
198 | __validated: T;
|
199 | };
|
200 | export type ValidationOptions = {
|
201 | |
202 |
|
203 |
|
204 |
|
205 | notExported: boolean;
|
206 | |
207 |
|
208 |
|
209 | invalidLink: boolean;
|
210 | |
211 |
|
212 |
|
213 | notDocumented: boolean;
|
214 | };
|
215 | export type JsDocCompatibility = {
|
216 | |
217 |
|
218 |
|
219 |
|
220 | exampleTag: boolean;
|
221 | |
222 |
|
223 |
|
224 |
|
225 | defaultTag: boolean;
|
226 | |
227 |
|
228 |
|
229 |
|
230 | inheritDocTag: boolean;
|
231 | |
232 |
|
233 |
|
234 |
|
235 | ignoreUnescapedBraces: boolean;
|
236 | };
|
237 |
|
238 |
|
239 |
|
240 | export type KeyToDeclaration<K extends keyof TypeDocOptionMap> = TypeDocOptionMap[K] extends boolean ? BooleanDeclarationOption : TypeDocOptionMap[K] extends string ? StringDeclarationOption : TypeDocOptionMap[K] extends number ? NumberDeclarationOption : TypeDocOptionMap[K] extends string[] ? ArrayDeclarationOption : unknown extends TypeDocOptionMap[K] ? MixedDeclarationOption | ObjectDeclarationOption : TypeDocOptionMap[K] extends ManuallyValidatedOption<unknown> ? (MixedDeclarationOption & {
|
241 | validate(value: unknown, i18n: TranslationProxy): void;
|
242 | }) | (ObjectDeclarationOption & {
|
243 | validate(value: unknown, i18n: TranslationProxy): void;
|
244 | }) : TypeDocOptionMap[K] extends Record<string, boolean> ? FlagsDeclarationOption<TypeDocOptionMap[K]> : TypeDocOptionMap[K] extends Record<string | number, infer U> ? MapDeclarationOption<U> : never;
|
245 | export declare enum ParameterHint {
|
246 | File = 0,
|
247 | Directory = 1
|
248 | }
|
249 | export declare enum ParameterType {
|
250 | String = 0,
|
251 | |
252 |
|
253 |
|
254 | Path = 1,
|
255 | Number = 2,
|
256 | Boolean = 3,
|
257 | Map = 4,
|
258 | Mixed = 5,
|
259 | Array = 6,
|
260 | |
261 |
|
262 |
|
263 | PathArray = 7,
|
264 | |
265 |
|
266 |
|
267 | ModuleArray = 8,
|
268 | |
269 |
|
270 |
|
271 | GlobArray = 9,
|
272 | |
273 |
|
274 |
|
275 | Object = 10,
|
276 | |
277 |
|
278 |
|
279 | Flags = 11
|
280 | }
|
281 | export interface DeclarationOptionBase {
|
282 | |
283 |
|
284 |
|
285 | name: string;
|
286 | |
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 | help: NeverIfInternal<string> | ((i18n: TranslationProxy) => string);
|
294 | /**
|
295 | * The parameter type, used to convert user configuration values into the expected type.
|
296 | * If not set, the type will be a string.
|
297 | */
|
298 | type?: ParameterType;
|
299 | /**
|
300 | * If set, this option will be omitted from `--help`, and attempting to specify it on the command
|
301 | * line will produce an error.
|
302 | */
|
303 | configFileOnly?: boolean;
|
304 | }
|
305 | export interface StringDeclarationOption extends DeclarationOptionBase {
|
306 | /**
|
307 | * Specifies the resolution strategy. If `Path` is provided, values will be resolved according to their
|
308 | * location in a file. If `String` or no value is provided, values will not be resolved.
|
309 | */
|
310 | type?: ParameterType.String | ParameterType.Path;
|
311 | /**
|
312 | * If not specified defaults to the empty string for both `String` and `Path`.
|
313 | */
|
314 | defaultValue?: string;
|
315 | /**
|
316 | * An optional hint for the type of input expected, will be displayed in the help output.
|
317 | */
|
318 | hint?: ParameterHint;
|
319 | /**
|
320 | * An optional validation function that validates a potential value of this option.
|
321 | * The function must throw an Error if the validation fails and should do nothing otherwise.
|
322 | */
|
323 | validate?: (value: string, i18n: TranslationProxy) => void;
|
324 | }
|
325 | export interface NumberDeclarationOption extends DeclarationOptionBase {
|
326 | type: ParameterType.Number;
|
327 | |
328 |
|
329 |
|
330 | minValue?: number;
|
331 | |
332 |
|
333 |
|
334 | maxValue?: number;
|
335 | |
336 |
|
337 |
|
338 | defaultValue?: number;
|
339 | |
340 |
|
341 |
|
342 |
|
343 | validate?: (value: number, i18n: TranslationProxy) => void;
|
344 | }
|
345 | export interface BooleanDeclarationOption extends DeclarationOptionBase {
|
346 | type: ParameterType.Boolean;
|
347 | |
348 |
|
349 |
|
350 | defaultValue?: boolean;
|
351 | }
|
352 | export interface ArrayDeclarationOption extends DeclarationOptionBase {
|
353 | type: ParameterType.Array | ParameterType.PathArray | ParameterType.ModuleArray | ParameterType.GlobArray;
|
354 | |
355 |
|
356 |
|
357 | defaultValue?: readonly string[];
|
358 | |
359 |
|
360 |
|
361 |
|
362 | validate?: (value: string[], i18n: TranslationProxy) => void;
|
363 | }
|
364 | export interface MixedDeclarationOption extends DeclarationOptionBase {
|
365 | type: ParameterType.Mixed;
|
366 | |
367 |
|
368 |
|
369 | defaultValue?: unknown;
|
370 | |
371 |
|
372 |
|
373 |
|
374 | validate?: (value: unknown, i18n: TranslationProxy) => void;
|
375 | }
|
376 | export interface ObjectDeclarationOption extends DeclarationOptionBase {
|
377 | type: ParameterType.Object;
|
378 | |
379 |
|
380 |
|
381 | defaultValue?: unknown;
|
382 | |
383 |
|
384 |
|
385 |
|
386 | validate?: (value: unknown, i18n: TranslationProxy) => void;
|
387 | }
|
388 | export interface MapDeclarationOption<T> extends DeclarationOptionBase {
|
389 | type: ParameterType.Map;
|
390 | |
391 |
|
392 |
|
393 |
|
394 |
|
395 | map: Map<string, T> | Record<string | number, T>;
|
396 | |
397 |
|
398 |
|
399 |
|
400 | defaultValue: T;
|
401 | }
|
402 | export interface FlagsDeclarationOption<T extends Record<string, boolean>> extends DeclarationOptionBase {
|
403 | type: ParameterType.Flags;
|
404 | |
405 |
|
406 |
|
407 | defaults: T;
|
408 | }
|
409 | export type DeclarationOption = StringDeclarationOption | NumberDeclarationOption | BooleanDeclarationOption | MixedDeclarationOption | ObjectDeclarationOption | MapDeclarationOption<unknown> | ArrayDeclarationOption | FlagsDeclarationOption<Record<string, boolean>>;
|
410 | export interface ParameterTypeToOptionTypeMap {
|
411 | [ParameterType.String]: string;
|
412 | [ParameterType.Path]: string;
|
413 | [ParameterType.Number]: number;
|
414 | [ParameterType.Boolean]: boolean;
|
415 | [ParameterType.Mixed]: unknown;
|
416 | [ParameterType.Object]: unknown;
|
417 | [ParameterType.Array]: string[];
|
418 | [ParameterType.PathArray]: string[];
|
419 | [ParameterType.ModuleArray]: string[];
|
420 | [ParameterType.GlobArray]: string[];
|
421 | [ParameterType.Flags]: Record<string, boolean>;
|
422 | [ParameterType.Map]: unknown;
|
423 | }
|
424 | export type DeclarationOptionToOptionType<T extends DeclarationOption> = T extends MapDeclarationOption<infer U> ? U : T extends FlagsDeclarationOption<infer U> ? U : ParameterTypeToOptionTypeMap[Exclude<T["type"], undefined>];
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 | export declare function convert(value: unknown, option: DeclarationOption, i18n: TranslationProxy, configPath: string, oldValue?: unknown): unknown;
|
434 | export declare function getDefaultValue(option: DeclarationOption): unknown;
|