tsdoc/ts/tsdoc.classes.typedoc.ts
2019-05-28 12:11:11 +02:00

30 lines
735 B
TypeScript

import * as plugins from './tsdoc.plugins';
import * as paths from './tsdoc.paths';
export class TypeDoc {
public smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash',
pathDirectories: [paths.binDir]
});
// Static
public static async isTypeDocDir(dirPathArg: string): Promise<boolean> {
const result = await plugins.smartfile.fs.fileExists(
plugins.path.join(dirPathArg, 'mkdocs.yml')
);
return !result;
}
// Instance
public typedocDirectory: string;
constructor(dirPathArg) {
this.typedocDirectory = dirPathArg;
}
public async compile() {
await this.smartshellInstance.exec(
`typedoc --tsconfig ${paths.tsconfigFile} --out public/ ts/`
);
}
}