"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.blockRegistry = exports.builtInBlocks = exports.clearSoftAssertionErrors = exports.getSoftAssertionErrors = exports.flushSoftAssertionErrors = exports.handleAssertion = exports.clearProcedures = exports.getProcedure = exports.registerProcedure = exports.procedureBlocks = exports.dataDrivenBlocks = exports.lifecycleBlocks = exports.logicBlocks = exports.playwrightBlocks = exports.apiBlocks = void 0;
exports.registerBlock = registerBlock;
exports.registerBlocks = registerBlocks;
exports.getBlock = getBlock;
exports.getAllBlocks = getAllBlocks;
exports.getBlocksByCategory = getBlocksByCategory;
exports.getCategories = getCategories;
var api_1 = require("./api");
Object.defineProperty(exports, "apiBlocks", { enumerable: true, get: function () { return api_1.apiBlocks; } });
var playwright_1 = require("./playwright");
Object.defineProperty(exports, "playwrightBlocks", { enumerable: true, get: function () { return playwright_1.playwrightBlocks; } });
var logic_1 = require("./logic");
Object.defineProperty(exports, "logicBlocks", { enumerable: true, get: function () { return logic_1.logicBlocks; } });
var lifecycle_1 = require("./lifecycle");
Object.defineProperty(exports, "lifecycleBlocks", { enumerable: true, get: function () { return lifecycle_1.lifecycleBlocks; } });
var data_driven_1 = require("./data-driven");
Object.defineProperty(exports, "dataDrivenBlocks", { enumerable: true, get: function () { return data_driven_1.dataDrivenBlocks; } });
var procedures_1 = require("./procedures");
Object.defineProperty(exports, "procedureBlocks", { enumerable: true, get: function () { return procedures_1.procedureBlocks; } });
Object.defineProperty(exports, "registerProcedure", { enumerable: true, get: function () { return procedures_1.registerProcedure; } });
Object.defineProperty(exports, "getProcedure", { enumerable: true, get: function () { return procedures_1.getProcedure; } });
Object.defineProperty(exports, "clearProcedures", { enumerable: true, get: function () { return procedures_1.clearProcedures; } });
var assertions_1 = require("./assertions");
Object.defineProperty(exports, "handleAssertion", { enumerable: true, get: function () { return assertions_1.handleAssertion; } });
Object.defineProperty(exports, "flushSoftAssertionErrors", { enumerable: true, get: function () { return assertions_1.flushSoftAssertionErrors; } });
Object.defineProperty(exports, "getSoftAssertionErrors", { enumerable: true, get: function () { return assertions_1.getSoftAssertionErrors; } });
Object.defineProperty(exports, "clearSoftAssertionErrors", { enumerable: true, get: function () { return assertions_1.clearSoftAssertionErrors; } });
const api_2 = require("./api");
const playwright_2 = require("./playwright");
const logic_2 = require("./logic");
const lifecycle_2 = require("./lifecycle");
const data_driven_2 = require("./data-driven");
const procedures_2 = require("./procedures");
// All built-in blocks
exports.builtInBlocks = [
    ...api_2.apiBlocks,
    ...playwright_2.playwrightBlocks,
    ...logic_2.logicBlocks,
    ...lifecycle_2.lifecycleBlocks,
    ...data_driven_2.dataDrivenBlocks,
    ...procedures_2.procedureBlocks,
];
// Block registry for runtime lookup
exports.blockRegistry = new Map();
// Initialize registry with built-in blocks
exports.builtInBlocks.forEach(block => {
    exports.blockRegistry.set(block.type, block);
});
// Function to register custom blocks (for plugins)
function registerBlock(block) {
    exports.blockRegistry.set(block.type, block);
}
// Function to register multiple blocks
function registerBlocks(blocks) {
    blocks.forEach(block => registerBlock(block));
}
// Get a block definition by type
function getBlock(type) {
    return exports.blockRegistry.get(type);
}
// Get all registered blocks
function getAllBlocks() {
    return Array.from(exports.blockRegistry.values());
}
// Get blocks by category
function getBlocksByCategory(category) {
    return getAllBlocks().filter(block => block.category === category);
}
// Get all categories
function getCategories() {
    const categories = new Set();
    getAllBlocks().forEach(block => categories.add(block.category));
    return Array.from(categories);
}
