export class ValueTableRegistrationData {
    constructor(prototype, category, icon, name, include) {
        this.category = category;
        this.icon = icon;
        this.name = name;
        this.prototype = prototype;
        this.include = include;
    }
    create() {
        return new this.prototype.constructor();
    }
}
export class ValueRuleRegistry {
    static GetRuleForType(type) {
        return Object.values(this.registrations).filter((r) => r.category === type.type);
    }
    static GetRuleByCategory() {
        return Object.entries(this.registrations).reduce((s, [_, current]) => {
            if (!s[current.category]) {
                s[current.category] = [];
            }
            s[current.category].push(current);
            return s;
        }, {});
    }
    static GetRuleByName(name) {
        throw new Error('not implemented');
    }
    static addRegistration(registrationData) {
        this.registrations[registrationData.name] = registrationData;
    }
    static getAll() {
        return Object.values(this.registrations);
    }
}
ValueRuleRegistry.registrations = {};
export function RegisterValueTableRule(rule, category, name, icon, include) {
    let prototype = Object.getPrototypeOf(rule);
    prototype.__type = name;
    ValueRuleRegistry.addRegistration(new ValueTableRegistrationData(prototype, category, icon, name, include));
}
//# sourceMappingURL=ValueTableRegistrationData.js.map