1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
import type { SignatureReflection, TypeDocOptions } from 'typedoc';
import {
loadProject,
selectApiMethodSignatures,
selectApiModules,
} from '../../../scripts/apidoc/typedoc';
import { mapByName } from '../../../scripts/apidoc/utils';
/**
* Returns a record with the (Module-Name -> (Method-Name -> Method-Signature)) for the project.
*/
export function loadProjectModules(
options?: Partial<TypeDocOptions>,
includeTestModules = false
): Record<string, Record<string, SignatureReflection>> {
const [, project] = loadProject(options);
const modules = selectApiModules(project, includeTestModules);
return mapByName(modules, selectApiMethodSignatures);
}
/**
* Loads the example methods using TypeDoc.
*/
export function loadExampleMethods(): Record<string, SignatureReflection> {
return loadProjectModules(
{
entryPoints: ['test/scripts/apidoc/signature.example.ts'],
tsconfig: 'test/scripts/apidoc/tsconfig.json',
},
true
)['SignatureTest'];
}
|