|
| 1 | +/** |
| 2 | + * Defaults values for TypeDoc options |
| 3 | + * @module |
| 4 | + */ |
1 | 5 | import type { BundledLanguage } from "@gerrit0/mini-shiki";
|
2 | 6 | import * as TagDefaults from "./tsdoc-defaults.js";
|
3 | 7 | import type { EnumKeys } from "../enum.js";
|
4 | 8 | import type { ReflectionKind } from "../../models/index.js";
|
5 | 9 |
|
6 |
| -/** |
7 |
| - * Default values for TypeDoc options. This object should not be modified. |
8 |
| - * |
9 |
| - * @privateRemarks |
10 |
| - * These are declared here, rather than within the option declaration, so that |
11 |
| - * they can be exposed as a part of the public API. The unfortunate type declaration |
12 |
| - * is to control the type which appears in the generated documentation. |
13 |
| - */ |
14 |
| -export const OptionDefaults: { |
15 |
| - excludeNotDocumentedKinds: readonly EnumKeys<typeof ReflectionKind>[]; |
16 |
| - excludeTags: readonly `@${string}`[]; |
17 |
| - blockTags: readonly `@${string}`[]; |
18 |
| - inlineTags: readonly `@${string}`[]; |
19 |
| - modifierTags: readonly `@${string}`[]; |
20 |
| - cascadedModifierTags: readonly `@${string}`[]; |
21 |
| - notRenderedTags: readonly `@${string}`[]; |
22 |
| - highlightLanguages: readonly BundledLanguage[]; |
23 |
| - sort: readonly string[]; |
24 |
| - kindSortOrder: readonly EnumKeys<typeof ReflectionKind>[]; |
25 |
| - requiredToBeDocumented: readonly EnumKeys<typeof ReflectionKind>[]; |
26 |
| -} = { |
27 |
| - excludeNotDocumentedKinds: [ |
28 |
| - "Module", |
29 |
| - "Namespace", |
30 |
| - "Enum", |
31 |
| - // Not including enum member here by default |
32 |
| - "Variable", |
33 |
| - "Function", |
34 |
| - "Class", |
35 |
| - "Interface", |
36 |
| - "Constructor", |
37 |
| - "Property", |
38 |
| - "Method", |
39 |
| - "CallSignature", |
40 |
| - "IndexSignature", |
41 |
| - "ConstructorSignature", |
42 |
| - "Accessor", |
43 |
| - "GetSignature", |
44 |
| - "SetSignature", |
45 |
| - "TypeAlias", |
46 |
| - "Reference", |
47 |
| - ], |
48 |
| - excludeTags: [ |
49 |
| - "@override", |
50 |
| - "@virtual", |
51 |
| - "@privateRemarks", |
52 |
| - "@satisfies", |
53 |
| - "@overload", |
54 |
| - "@inline", |
55 |
| - ], |
56 |
| - blockTags: TagDefaults.blockTags, |
57 |
| - inlineTags: TagDefaults.inlineTags, |
58 |
| - modifierTags: TagDefaults.modifierTags, |
59 |
| - cascadedModifierTags: ["@alpha", "@beta", "@experimental"], |
60 |
| - notRenderedTags: [ |
61 |
| - "@showCategories", |
62 |
| - "@showGroups", |
63 |
| - "@hideCategories", |
64 |
| - "@hideGroups", |
65 |
| - "@expand", |
66 |
| - "@summary", |
67 |
| - "@group", |
68 |
| - "@groupDescription", |
69 |
| - "@category", |
70 |
| - "@categoryDescription", |
71 |
| - ], |
72 |
| - highlightLanguages: [ |
73 |
| - "bash", |
74 |
| - "console", |
75 |
| - "css", |
76 |
| - "html", |
77 |
| - "javascript", |
78 |
| - "json", |
79 |
| - "jsonc", |
80 |
| - "json5", |
81 |
| - "yaml", |
82 |
| - "tsx", |
83 |
| - "typescript", |
84 |
| - ], |
85 |
| - sort: ["kind", "instance-first", "alphabetical-ignoring-documents"], |
86 |
| - kindSortOrder: [ |
87 |
| - "Document", |
88 |
| - "Project", |
89 |
| - "Module", |
90 |
| - "Namespace", |
91 |
| - "Enum", |
92 |
| - "EnumMember", |
93 |
| - "Class", |
94 |
| - "Interface", |
95 |
| - "TypeAlias", |
| 10 | +export const excludeNotDocumentedKinds: readonly EnumKeys< |
| 11 | + typeof ReflectionKind |
| 12 | +>[] = [ |
| 13 | + "Module", |
| 14 | + "Namespace", |
| 15 | + "Enum", |
| 16 | + // Not including enum member here by default |
| 17 | + "Variable", |
| 18 | + "Function", |
| 19 | + "Class", |
| 20 | + "Interface", |
| 21 | + "Constructor", |
| 22 | + "Property", |
| 23 | + "Method", |
| 24 | + "CallSignature", |
| 25 | + "IndexSignature", |
| 26 | + "ConstructorSignature", |
| 27 | + "Accessor", |
| 28 | + "GetSignature", |
| 29 | + "SetSignature", |
| 30 | + "TypeAlias", |
| 31 | + "Reference", |
| 32 | +]; |
| 33 | + |
| 34 | +export const excludeTags: readonly `@${string}`[] = [ |
| 35 | + "@override", |
| 36 | + "@virtual", |
| 37 | + "@privateRemarks", |
| 38 | + "@satisfies", |
| 39 | + "@overload", |
| 40 | + "@inline", |
| 41 | +]; |
| 42 | + |
| 43 | +export const blockTags: readonly `@${string}`[] = TagDefaults.blockTags; |
| 44 | +export const inlineTags: readonly `@${string}`[] = TagDefaults.inlineTags; |
| 45 | +export const modifierTags: readonly `@${string}`[] = TagDefaults.modifierTags; |
| 46 | + |
| 47 | +export const cascadedModifierTags: readonly `@${string}`[] = [ |
| 48 | + "@alpha", |
| 49 | + "@beta", |
| 50 | + "@experimental", |
| 51 | +]; |
| 52 | + |
| 53 | +export const notRenderedTags: readonly `@${string}`[] = [ |
| 54 | + "@showCategories", |
| 55 | + "@showGroups", |
| 56 | + "@hideCategories", |
| 57 | + "@hideGroups", |
| 58 | + "@expand", |
| 59 | + "@summary", |
| 60 | + "@group", |
| 61 | + "@groupDescription", |
| 62 | + "@category", |
| 63 | + "@categoryDescription", |
| 64 | +]; |
| 65 | + |
| 66 | +export const highlightLanguages: readonly BundledLanguage[] = [ |
| 67 | + "bash", |
| 68 | + "console", |
| 69 | + "css", |
| 70 | + "html", |
| 71 | + "javascript", |
| 72 | + "json", |
| 73 | + "jsonc", |
| 74 | + "json5", |
| 75 | + "yaml", |
| 76 | + "tsx", |
| 77 | + "typescript", |
| 78 | +]; |
| 79 | + |
| 80 | +export const sort: readonly string[] = [ |
| 81 | + "kind", |
| 82 | + "instance-first", |
| 83 | + "alphabetical-ignoring-documents", |
| 84 | +]; |
| 85 | + |
| 86 | +export const kindSortOrder: readonly EnumKeys<typeof ReflectionKind>[] = [ |
| 87 | + "Document", |
| 88 | + "Project", |
| 89 | + "Module", |
| 90 | + "Namespace", |
| 91 | + "Enum", |
| 92 | + "EnumMember", |
| 93 | + "Class", |
| 94 | + "Interface", |
| 95 | + "TypeAlias", |
| 96 | + |
| 97 | + "Constructor", |
| 98 | + "Property", |
| 99 | + "Variable", |
| 100 | + "Function", |
| 101 | + "Accessor", |
| 102 | + "Method", |
96 | 103 |
|
97 |
| - "Constructor", |
98 |
| - "Property", |
99 |
| - "Variable", |
100 |
| - "Function", |
101 |
| - "Accessor", |
102 |
| - "Method", |
| 104 | + "Reference", |
| 105 | +]; |
103 | 106 |
|
104 |
| - "Reference", |
105 |
| - ], |
106 |
| - requiredToBeDocumented: [ |
107 |
| - "Enum", |
108 |
| - "EnumMember", |
109 |
| - "Variable", |
110 |
| - "Function", |
111 |
| - "Class", |
112 |
| - "Interface", |
113 |
| - "Property", |
114 |
| - "Method", |
115 |
| - "Accessor", |
116 |
| - "TypeAlias", |
117 |
| - ], |
118 |
| -}; |
| 107 | +export const requiredToBeDocumented: readonly EnumKeys< |
| 108 | + typeof ReflectionKind |
| 109 | +>[] = [ |
| 110 | + "Enum", |
| 111 | + "EnumMember", |
| 112 | + "Variable", |
| 113 | + "Function", |
| 114 | + "Class", |
| 115 | + "Interface", |
| 116 | + "Property", |
| 117 | + "Method", |
| 118 | + "Accessor", |
| 119 | + "TypeAlias", |
| 120 | +]; |
0 commit comments