class SchemaRegistry {
    constructor() {
        this.registry = new Map();
    }
    addWidget(groupName, widgetName, widget) {
        if (!this.registry.has(groupName)) {
            this.registry.set(groupName, new Map());
        }
        const group = this.registry.get(groupName);
        group === null || group === void 0 ? void 0 : group.set(widgetName, widget);
    }
    getWidget(groupName, widgetName) {
        var _a;
        return (_a = this.registry.get(groupName)) === null || _a === void 0 ? void 0 : _a.get(widgetName);
    }
    getGroup(groupName) {
        return this.registry.has(groupName)
            ? Object.fromEntries(this.registry.get(groupName))
            : undefined;
    }
    clear() {
        this.registry.clear();
    }
}
export const schemaRegistry = new SchemaRegistry();
