"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createRenderableBase = exports.baseRender = void 0;
const create_metadata_1 = require("./create-metadata");
const setup_stage_1 = require("./setup-stage");
const hooks_1 = require("./hooks");
async function baseRender(data, render, canvas) {
    (0, hooks_1.callHooks)(data, 'beforeRender', canvas);
    const cleanup = await render(canvas);
    (0, hooks_1.callHooks)(data, 'afterRender', canvas);
    return cleanup;
}
exports.baseRender = baseRender;
function createRenderableBase(data) {
    const res = (0, create_metadata_1.createMetadata)(Object.assign(Object.assign({}, data), { setupStage(parentElement = document.body) {
            return (0, setup_stage_1.setupBoardStage)(this, parentElement);
        } }));
    return res;
}
exports.createRenderableBase = createRenderableBase;
//# sourceMappingURL=create-renderable-base.js.map