-
Notifications
You must be signed in to change notification settings - Fork 705
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
117 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,118 +1,120 @@ | ||
/** | ||
* Defaults values for TypeDoc options | ||
* @module | ||
*/ | ||
import type { BundledLanguage } from "@gerrit0/mini-shiki"; | ||
import * as TagDefaults from "./tsdoc-defaults.js"; | ||
import type { EnumKeys } from "../enum.js"; | ||
import type { ReflectionKind } from "../../models/index.js"; | ||
|
||
/** | ||
* Default values for TypeDoc options. This object should not be modified. | ||
* | ||
* @privateRemarks | ||
* These are declared here, rather than within the option declaration, so that | ||
* they can be exposed as a part of the public API. The unfortunate type declaration | ||
* is to control the type which appears in the generated documentation. | ||
*/ | ||
export const OptionDefaults: { | ||
excludeNotDocumentedKinds: readonly EnumKeys<typeof ReflectionKind>[]; | ||
excludeTags: readonly `@${string}`[]; | ||
blockTags: readonly `@${string}`[]; | ||
inlineTags: readonly `@${string}`[]; | ||
modifierTags: readonly `@${string}`[]; | ||
cascadedModifierTags: readonly `@${string}`[]; | ||
notRenderedTags: readonly `@${string}`[]; | ||
highlightLanguages: readonly BundledLanguage[]; | ||
sort: readonly string[]; | ||
kindSortOrder: readonly EnumKeys<typeof ReflectionKind>[]; | ||
requiredToBeDocumented: readonly EnumKeys<typeof ReflectionKind>[]; | ||
} = { | ||
excludeNotDocumentedKinds: [ | ||
"Module", | ||
"Namespace", | ||
"Enum", | ||
// Not including enum member here by default | ||
"Variable", | ||
"Function", | ||
"Class", | ||
"Interface", | ||
"Constructor", | ||
"Property", | ||
"Method", | ||
"CallSignature", | ||
"IndexSignature", | ||
"ConstructorSignature", | ||
"Accessor", | ||
"GetSignature", | ||
"SetSignature", | ||
"TypeAlias", | ||
"Reference", | ||
], | ||
excludeTags: [ | ||
"@override", | ||
"@virtual", | ||
"@privateRemarks", | ||
"@satisfies", | ||
"@overload", | ||
"@inline", | ||
], | ||
blockTags: TagDefaults.blockTags, | ||
inlineTags: TagDefaults.inlineTags, | ||
modifierTags: TagDefaults.modifierTags, | ||
cascadedModifierTags: ["@alpha", "@beta", "@experimental"], | ||
notRenderedTags: [ | ||
"@showCategories", | ||
"@showGroups", | ||
"@hideCategories", | ||
"@hideGroups", | ||
"@expand", | ||
"@summary", | ||
"@group", | ||
"@groupDescription", | ||
"@category", | ||
"@categoryDescription", | ||
], | ||
highlightLanguages: [ | ||
"bash", | ||
"console", | ||
"css", | ||
"html", | ||
"javascript", | ||
"json", | ||
"jsonc", | ||
"json5", | ||
"yaml", | ||
"tsx", | ||
"typescript", | ||
], | ||
sort: ["kind", "instance-first", "alphabetical-ignoring-documents"], | ||
kindSortOrder: [ | ||
"Document", | ||
"Project", | ||
"Module", | ||
"Namespace", | ||
"Enum", | ||
"EnumMember", | ||
"Class", | ||
"Interface", | ||
"TypeAlias", | ||
export const excludeNotDocumentedKinds: readonly EnumKeys< | ||
typeof ReflectionKind | ||
>[] = [ | ||
"Module", | ||
"Namespace", | ||
"Enum", | ||
// Not including enum member here by default | ||
"Variable", | ||
"Function", | ||
"Class", | ||
"Interface", | ||
"Constructor", | ||
"Property", | ||
"Method", | ||
"CallSignature", | ||
"IndexSignature", | ||
"ConstructorSignature", | ||
"Accessor", | ||
"GetSignature", | ||
"SetSignature", | ||
"TypeAlias", | ||
"Reference", | ||
]; | ||
|
||
export const excludeTags: readonly `@${string}`[] = [ | ||
"@override", | ||
"@virtual", | ||
"@privateRemarks", | ||
"@satisfies", | ||
"@overload", | ||
"@inline", | ||
]; | ||
|
||
export const blockTags: readonly `@${string}`[] = TagDefaults.blockTags; | ||
export const inlineTags: readonly `@${string}`[] = TagDefaults.inlineTags; | ||
export const modifierTags: readonly `@${string}`[] = TagDefaults.modifierTags; | ||
|
||
export const cascadedModifierTags: readonly `@${string}`[] = [ | ||
"@alpha", | ||
"@beta", | ||
"@experimental", | ||
]; | ||
|
||
export const notRenderedTags: readonly `@${string}`[] = [ | ||
"@showCategories", | ||
"@showGroups", | ||
"@hideCategories", | ||
"@hideGroups", | ||
"@expand", | ||
"@summary", | ||
"@group", | ||
"@groupDescription", | ||
"@category", | ||
"@categoryDescription", | ||
]; | ||
|
||
export const highlightLanguages: readonly BundledLanguage[] = [ | ||
"bash", | ||
"console", | ||
"css", | ||
"html", | ||
"javascript", | ||
"json", | ||
"jsonc", | ||
"json5", | ||
"yaml", | ||
"tsx", | ||
"typescript", | ||
]; | ||
|
||
export const sort: readonly string[] = [ | ||
"kind", | ||
"instance-first", | ||
"alphabetical-ignoring-documents", | ||
]; | ||
|
||
export const kindSortOrder: readonly EnumKeys<typeof ReflectionKind>[] = [ | ||
"Document", | ||
"Project", | ||
"Module", | ||
"Namespace", | ||
"Enum", | ||
"EnumMember", | ||
"Class", | ||
"Interface", | ||
"TypeAlias", | ||
|
||
"Constructor", | ||
"Property", | ||
"Variable", | ||
"Function", | ||
"Accessor", | ||
"Method", | ||
|
||
"Constructor", | ||
"Property", | ||
"Variable", | ||
"Function", | ||
"Accessor", | ||
"Method", | ||
"Reference", | ||
]; | ||
|
||
"Reference", | ||
], | ||
requiredToBeDocumented: [ | ||
"Enum", | ||
"EnumMember", | ||
"Variable", | ||
"Function", | ||
"Class", | ||
"Interface", | ||
"Property", | ||
"Method", | ||
"Accessor", | ||
"TypeAlias", | ||
], | ||
}; | ||
export const requiredToBeDocumented: readonly EnumKeys< | ||
typeof ReflectionKind | ||
>[] = [ | ||
"Enum", | ||
"EnumMember", | ||
"Variable", | ||
"Function", | ||
"Class", | ||
"Interface", | ||
"Property", | ||
"Method", | ||
"Accessor", | ||
"TypeAlias", | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters