Skip to content

Commit a446431

Browse files
authored
feat: Add disableAliases option (#1576)
Resolves #1571
1 parent 8aad0d5 commit a446431

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/lib/converter/symbols.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export function convertSymbol(
7373
// but aren't aliased symbols because `export *` was used.
7474
const previous = context.project.getReflectionFromSymbol(symbol);
7575
if (
76+
!context.converter.application.options.getValue("disableAliases") &&
7677
previous &&
7778
previous.parent?.kindOf(ReflectionKind.Module | ReflectionKind.Project)
7879
) {
@@ -704,7 +705,10 @@ function convertAlias(
704705
const reflection = context.project.getReflectionFromSymbol(
705706
context.resolveAliasedSymbol(symbol)
706707
);
707-
if (!reflection) {
708+
if (
709+
!reflection ||
710+
context.converter.application.options.getValue("disableAliases")
711+
) {
708712
// We don't have this, convert it.
709713
convertSymbol(
710714
context,

src/lib/utils/options/declaration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export interface TypeDocOptionMap {
4646
excludeNotDocumented: boolean;
4747
excludeInternal: boolean;
4848
disableSources: boolean;
49+
disableAliases: boolean;
4950
includes: string;
5051
media: string;
5152

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ export function addTypeDocOptions(options: Pick<Options, "addDeclaration">) {
7272
"Disables setting the source of a reflection when documenting it.",
7373
type: ParameterType.Boolean,
7474
});
75+
options.addDeclaration({
76+
name: "disableAliases",
77+
help: "Disables creating aliases for shared reflections.",
78+
type: ParameterType.Boolean,
79+
});
7580
options.addDeclaration({
7681
name: "includes",
7782
help:

0 commit comments

Comments
 (0)