import { GlobalBeatLayout } from "./beats";
import { Parser } from "./parser";
export function parse(input) {
    return new Parser().parseAndBuild(input);
}
export function load(codeText, config = {}) {
    codeText = codeText || "";
    const beatLayout = new 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