/**
 * Channel-to-user identity mapping.
 *
 * Maps channel sender IDs (e.g. telegram:123456, discord:user:789) to hub user IDs.
 * Used by the multi-tenant gateway to resolve which hub user is interacting
 * through a given messaging channel.
 *
 * Three-layer refresh strategy (per research pitfall #7):
 * 1. Startup: full fetch via bulkLoad()
 * 2. Push events: real-time updates via updateMapping() / removeMapping()
 * 3. Periodic safety net: startPeriodicRefresh() catches missed push events
 *
 * This module does NOT make HTTP calls itself — the fetchFn is injected by the
 * caller (gateway startup passes a function that fetches from hub).
 */
/** A single channel-to-user identity mapping entry. */
export type ChannelIdentityEntry = {
    channel: string;
    channelUserId: string;
    userId: string;
    displayName?: string;
};
/** Statistics about the identity map state. */
export type ChannelIdentityMapStats = {
    count: number;
    lastRefreshAt: number | null;
};
/** Channel identity map interface. */
export type ChannelIdentityMap = {
    /** Resolve a channel sender to a hub user ID. Returns null if unmapped. */
    resolveUserId(channel: string, channelUserId: string): string | null;
    /** Add or update a single channel identity mapping. */
    updateMapping(entry: ChannelIdentityEntry): void;
    /** Remove a channel identity mapping. No-op if it does not exist. */
    removeMapping(channel: string, channelUserId: string): void;
    /** Replace all mappings with the given entries (startup fetch). */
    bulkLoad(entries: ChannelIdentityEntry[]): void;
    /** Return count of mappings and timestamp of last refresh. */
    getStats(): ChannelIdentityMapStats;
    /** Start periodic refresh using the provided fetch function. Default interval: 5 minutes. */
    startPeriodicRefresh(fetchFn: () => Promise<ChannelIdentityEntry[]>, intervalMs?: number): void;
    /** Stop periodic refresh. */
    stopPeriodicRefresh(): void;
};
/**
 * Create a new in-memory channel identity map.
 *
 * Keyed by `${channel}:${channelUserId}` for O(1) lookups.
 */
export declare function createChannelIdentityMap(): ChannelIdentityMap;
