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 | 4× 1× 1× | /** * Class represents TemplateAbstract */ class TemplateAbstract { /** * create TemplateAbstract instance * @param {function} engine - template engine * */ constructor(engine) { this.engine = engine; } /** * create view */ createView() { throw new Error('Template engine must provide a .createView() method'); } /** * actual render function of the template and the data */ render() { throw new Error('Template engine must provide a .render() method'); } } export { TemplateAbstract, }; |