import { messages } from '../messages/index.js';
const registry = new Map();
export function registrarFormatter(formatter) {
    if (registry.has(formatter.nome)) {
        throw new Error(messages.FormattersMensagens.formatterJaRegistrado(formatter.nome));
    }
    registry.set(formatter.nome, formatter);
}
export function removerFormatter(nome) {
    return registry.delete(nome);
}
export function obterFormatter(nome) {
    return registry.get(nome);
}
export function listarFormatters() {
    return Array.from(registry.values());
}
export function obterFormatterPorFormato(formato) {
    return Array.from(registry.values()).filter(f => f.formato === formato || f.extensoes?.includes(formato));
}
//# sourceMappingURL=registry.js.map