Skip to content

Commit ab336ec

Browse files
authored
Revert "feat(method): change to be able to add extends object" (#39)
1 parent 304078b commit ab336ec

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

src/parse.ts

+1-19
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,7 @@ export function parse(opts: DocsParseOptions) {
3838
});
3939

4040
return (api: string) => {
41-
let apiInterface = interfaces.find((i) => i.name === api) || null;
42-
43-
/**
44-
* Add methods of import(many is used in `extends`)
45-
*/
46-
const allImportObject = interfaces
47-
.filter((i) => apiInterface?.importObject.includes(i.name) && i.name !== api)
48-
.map((i) => i.importObject);
49-
50-
const otherMethod =
51-
interfaces.filter((i) => [...new Set(allImportObject.flat())].includes(i.name)).map((d) => d.methods) || null;
52-
53-
if (apiInterface !== null && otherMethod && otherMethod.length > 0) {
54-
apiInterface.methods = [...new Set(apiInterface?.methods.concat(otherMethod.flat(1)))];
55-
}
41+
const apiInterface = interfaces.find((i) => i.name === api) || null;
5642

5743
const data: DocsData = {
5844
api: apiInterface,
@@ -170,17 +156,13 @@ function getInterface(typeChecker: ts.TypeChecker, node: ts.InterfaceDeclaration
170156
const symbol = typeChecker.getSymbolAtLocation(node.name);
171157
const docs = symbol ? serializeSymbol(typeChecker, symbol) : null;
172158

173-
// @ts-ignore
174-
const importObject = node.parent?.locals?.keys() || [];
175-
176159
const i: DocsInterface = {
177160
name: interfaceName,
178161
slug: slugify(interfaceName),
179162
docs: docs?.docs || '',
180163
tags: docs?.tags || [],
181164
methods,
182165
properties,
183-
importObject: [...importObject].filter((d: string) => d !== interfaceName),
184166
};
185167

186168
return i;

src/types.ts

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export interface DocsInterface {
2020
tags: DocsTagInfo[];
2121
methods: DocsInterfaceMethod[];
2222
properties: DocsInterfaceProperty[];
23-
importObject: string[];
2423
}
2524

2625
export interface DocsEnum {

0 commit comments

Comments
 (0)