import { type TAddress, type TChannelName, type TNetworkId_S, type TSubscription_S } from '@flux/shared/types';
import type { GlobalChannelPubsub } from '../../routing/global-channel/global-channel-pubsub.class';
export declare const MAX_CHANNEL_MEMBERS_BY_SUBSCRIPTION_TYPE: {
    [key in TSubscription_S]: number;
};
export declare const MAX_CHANNEL_MEMBERS: number;
export declare const normalizeSubscriptionType: (subscriptionType?: string) => TSubscription_S | undefined;
export declare const resolveSubscriptionTypeOrDefault: (subscriptionType?: string) => TSubscription_S;
export declare const readMaxChannelMembers: (subscriptionType?: string) => number;
export declare const readSubscriptionTypeFromClaim: (claim?: string) => TSubscription_S | undefined;
export declare const canChannelHaveMoreMembers: (memberCount: number, subscriptionType?: TSubscription_S) => boolean;
export declare class NetworkChannelManager {
    private readonly _globalChannelPubsub;
    private readonly channelUsageCount;
    private readonly redisConnection;
    private readonly networkChannelHash;
    constructor(_globalChannelPubsub: GlobalChannelPubsub);
    /**
     * Checks if a channel can have more members.
     *
     * ! TODO Don't query the database repeatedly, implement local synced cache.
     */
    canHaveMembers(networkId: TNetworkId_S, channelName: TChannelName, subscriptionType?: TSubscription_S): Promise<boolean>;
    /**
     * Joins a network channel.
     */
    joinNetworkChannel(networkId: TNetworkId_S, channelName: TChannelName, clientAddress: TAddress): void;
    /**
     * Leaves a network channel.
     */
    leaveNetworkChannel(networkId: TNetworkId_S, channelName: TChannelName, clientAddress: TAddress): Promise<void>;
    /**
     * Leaves all network channels.
     */
    leaveAllNetworkChannels(networkId: TNetworkId_S, clientAddress: TAddress, channelNames: Set<TChannelName>): Promise<void>;
    /**
     * Creates a network channel if it does not exist.
     */
    private createNetworkChannelIfNotExist;
    /**
     * Increases the usage count of a channel.
     */
    increaseUsageCount(networkId: TNetworkId_S, channelName: TChannelName, usage: number): void;
}
