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