Skip to content

Commit 7b06bd7

Browse files
authored
fix(docs-gen): drop non default overloads from docs (#1138)
1 parent 0854fe1 commit 7b06bd7

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

.changeset/tame-turkeys-joke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@livekit/api-documenter": patch
3+
---
4+
5+
fix(docs-gen): drop non default overloads from docs

tooling/api-documenter/src/documenters/MarkdownDocumenter.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ import {
7272
getCategorySubfolder,
7373
getFunctionType,
7474
getLinkToSourceOnGitHub,
75+
isNonDefaultOverload,
7576
} from '../livekitUtils/classifiers';
7677
import { MarkDocTag } from '../nodes/MarkDocTag';
7778
import { ParameterList } from '../nodes/ParameterList';
@@ -137,6 +138,11 @@ export class MarkdownDocumenter {
137138
const output: DocSection = new DocSection({ configuration });
138139
const category: LkType = getFunctionType(apiItem);
139140

141+
if (isNonDefaultOverload(apiItem)) {
142+
console.log('isNonDefaultOverload', apiItem.displayName);
143+
return;
144+
}
145+
140146
// this._writeBreadcrumb(output, apiItem);
141147

142148
const scopedName: string = apiItem.getScopedNameWithinPackage();

tooling/api-documenter/src/livekitUtils/classifiers.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ function isPrefab(apiItem: ApiItem): boolean {
1919
return false;
2020
}
2121

22+
export function isNonDefaultOverload(apiItem: ApiItem): boolean {
23+
if (apiItem instanceof ApiFunction) {
24+
return apiItem.overloadIndex !== undefined && apiItem.overloadIndex > 1;
25+
}
26+
return false;
27+
}
28+
2229
function isConstDeclarationComponent(apiItem: ApiItem): boolean {
2330
return (
2431
apiItem instanceof ApiVariable &&

0 commit comments

Comments
 (0)