Skip to content

Commit c3842c1

Browse files
committed
Minor improvements to API docs
1 parent 663ce54 commit c3842c1

File tree

5 files changed

+117
-115
lines changed

5 files changed

+117
-115
lines changed

.config/typedoc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"treatWarningsAsErrors": false,
3636
"categorizeByGroup": false,
3737
"categoryOrder": ["Reflections", "Types", "Comments", "*"],
38-
"groupOrder": ["Common", "*"],
38+
"groupOrder": ["Common", "Namespaces", "*"],
3939
"navigationLinks": {
4040
"Docs": "https://typedoc.org",
4141
"Example": "https://typedoc.org/example/index.html",

src/lib/utils/options/defaults.ts

Lines changed: 113 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,120 @@
1+
/**
2+
* Defaults values for TypeDoc options
3+
* @module
4+
*/
15
import type { BundledLanguage } from "@gerrit0/mini-shiki";
26
import * as TagDefaults from "./tsdoc-defaults.js";
37
import type { EnumKeys } from "../enum.js";
48
import type { ReflectionKind } from "../../models/index.js";
59

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",
96103

97-
"Constructor",
98-
"Property",
99-
"Variable",
100-
"Function",
101-
"Accessor",
102-
"Method",
104+
"Reference",
105+
];
103106

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+
];

src/lib/utils/options/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ export type {
3636
OutputSpecification,
3737
} from "./declaration.js";
3838

39-
export { OptionDefaults } from "./defaults.js";
39+
export * as OptionDefaults from "./defaults.js";

src/lib/utils/options/sources/typedoc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
CommentStyle,
77
type TypeDocOptionMap,
88
} from "../declaration.js";
9-
import { OptionDefaults } from "../defaults.js";
9+
import * as OptionDefaults from "../defaults.js";
1010
import { SORT_STRATEGIES } from "../../sort.js";
1111
import { EntryPointStrategy } from "../../entry-point.js";
1212
import { ReflectionKind } from "../../../models/reflections/kind.js";

src/lib/utils/sort.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ReflectionKind } from "../models/reflections/kind.js";
77
import type { DeclarationReflection } from "../models/reflections/declaration.js";
88
import type { Options } from "./options/index.js";
99
import type { DocumentReflection } from "../models/index.js";
10-
import { OptionDefaults } from "./options/defaults.js";
10+
import * as OptionDefaults from "./options/defaults.js";
1111

1212
export const SORT_STRATEGIES = [
1313
"source-order",

0 commit comments

Comments
 (0)