"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = parse;
exports.load = load;
const beats_1 = require("./beats");
const parser_1 = require("./parser");
function parse(input) {
    return new parser_1.Parser().parseAndBuild(input);
}
function load(codeText, config = {}) {
    codeText = codeText || "";
    const beatLayout = new beats_1.GlobalBeatLayout();
    const startTime = performance.now();
    const [notation, errors] = parse(codeText);
    const parseTime = performance.now();
    beatLayout.processBlock(notation);
    const buildTime = performance.now();
    if (config.log) {
        console.log(`V4 Document, Parse Time: ${parseTime - startTime}ms, Build Time: ${buildTime - parseTime}ms`);
    }
    return [
        notation,
        beatLayout,
        errors,
        {
            parseTime: parseTime - startTime,
            buildTime: buildTime - parseTime,
        },
    ];
}
//# sourceMappingURL=loader.js.map