tsdoc/ts/tsdoc.classes.typedoc.ts

28 lines
730 B
TypeScript
Raw Normal View History

2019-05-13 17:41:02 +00:00
import * as plugins from './tsdoc.plugins';
2019-05-14 15:39:33 +00:00
import * as paths from './tsdoc.paths';
2019-05-13 17:41:02 +00:00
2019-05-14 15:39:33 +00:00
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 --module "commonjs" --target "ES2016" --out public/ ts/`);
}
}