export class TypeRegistry {
    types;
    map = {};
    constructor(types) {
        this.types = types;
        //sort types
        types.sort((a, b) => a.name.localeCompare(b.name));
        for (const type of types) {
            this.map[type.id] = type;
        }
    }
    getType(id) {
        return this.map[id];
    }
    getTypeLayout(id) {
        const type = this.map[id];
        return type ? type.table_layout : undefined;
    }
    getTypeName(id) {
        const type = this.map[id];
        return type ? type.name : undefined;
    }
}
//# sourceMappingURL=TypeRegistry.js.map