/**
 * Channel Security - Unified access control
 */
import type { DmPolicy, GroupPolicy } from './plugin-types.js';
export interface AllowlistMatch {
    allowed: boolean;
    matchKey?: string;
    matchSource?: 'wildcard' | 'id' | 'name' | 'username' | 'prefixed-id' | 'prefixed-user';
}
interface CompiledAllowlist {
    set: ReadonlySet<string>;
    wildcard: boolean;
}
export declare function compileAllowlist(entries: ReadonlyArray<string | number>): CompiledAllowlist;
export declare function resolveAllowlistMatch(params: {
    allowFrom: ReadonlyArray<string | number>;
    senderId: string;
    senderUsername?: string | null;
    allowNameMatching?: boolean;
}): AllowlistMatch;
export declare function resolveAllowlistMatchSimple(params: {
    allowFrom: ReadonlyArray<string | number>;
    senderId: string;
    senderName?: string | null;
    allowNameMatching?: boolean;
}): AllowlistMatch;
export interface SecurityContext {
    channel: string;
    accountId: string;
    chatId: string;
    senderId: string;
    senderName?: string;
    isGroup: boolean;
    isDm: boolean;
    threadId?: string;
}
export interface SecurityResult {
    allowed: boolean;
    reason?: string;
    policy: DmPolicy | GroupPolicy;
    match?: AllowlistMatch;
}
export declare function resolveDmPolicy(configValue?: DmPolicy, defaultValue?: DmPolicy): DmPolicy;
export declare function resolveGroupPolicy(configValue?: GroupPolicy, defaultValue?: GroupPolicy): GroupPolicy;
export declare function evaluateAccess(params: {
    context: SecurityContext;
    dmPolicy?: DmPolicy;
    groupPolicy?: GroupPolicy;
    allowFrom?: Array<string | number>;
    groupAllowFrom?: Array<string | number>;
    allowNameMatching?: boolean;
}): SecurityResult;
export declare function hasBotMention(params: {
    text: string;
    botUsername: string;
    entities?: Array<{
        type: string;
        offset: number;
        length: number;
    }>;
}): boolean;
export declare function removeBotMention(params: {
    text: string;
    botUsername: string;
}): string;
export {};
