@necord/schematics
Version:
A collection of schematics for Necord projects with NestJS
27 lines (26 loc) • 947 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.contextMenu = contextMenu;
const common_1 = require("../common");
const context_menu_type_enum_1 = require("./context-menu-type.enum");
class ContextMenuSchematicFactory extends common_1.CommonSchematicFactory {
constructor() {
super(...arguments);
this.type = 'context-menu';
}
generate(options) {
switch (options.strategy) {
case context_menu_type_enum_1.ContextMenuType.Message:
this.templatePath = './files/message-menu';
break;
case context_menu_type_enum_1.ContextMenuType.User:
this.templatePath = './files/user-menu';
break;
}
return super.generate(options);
}
}
function contextMenu(options) {
const contextMenuFactory = new ContextMenuSchematicFactory();
return contextMenuFactory.create(options);
}