// Channel registry
const channelRegistry = new Map();
export function registerChannel(plugin) {
    channelRegistry.set(plugin.name, plugin);
}
export function getChannel(name) {
    return channelRegistry.get(name);
}
export function getAllChannels() {
    return Array.from(channelRegistry.values());
}
export async function sendMessageToChannel(channelName, to, content, options) {
    const channel = getChannel(channelName);
    if (!channel) {
        return {
            success: false,
            error: `Channel not found: ${channelName}`,
        };
    }
    if (!channel.enabled) {
        return {
            success: false,
            error: `Channel not enabled: ${channelName}`,
        };
    }
    return channel.sendMessage(to, content, options);
}
//# sourceMappingURL=types.js.map