import type { ITopicClaim, IClaimResult, IClaimOptions, IClaimQuery } from './ITopicClaim';
import type { ITopicClaimRegistry, ITopicClaimRegistryConfig } from './ITopicClaimRegistry';
/**
 * TopicClaimRegistry - Implementation of topic prefix claiming.
 *
 * Vision 27 §1.5 (Separator Semantics):
 * - DOT (.) separates supervision hierarchy levels
 * - 'flowpad.tree' is a child of 'flowpad'
 * - Prefix matching uses startsWith for efficiency
 *
 * Joe Armstrong (Erlang, "Programming Erlang"):
 *   "The registry is the phone book. Without it, you can't call anyone."
 *
 * Implementation notes:
 * - Uses Map<prefix, claim> for O(1) exact lookups
 * - Prefix ancestor search is O(n) where n = depth of hierarchy
 * - Suitable for thousands of components; for millions, use a trie
 *
 * Thread safety: NOT THREAD-SAFE.
 * In JavaScript's single-threaded event loop, this is fine.
 * If used in Web Workers, each worker needs its own registry.
 */
export declare class TopicClaimRegistry implements ITopicClaimRegistry {
    /**
     * Map of prefix -> claim for efficient exact lookups.
     */
    private readonly claims;
    /**
     * Index of owner -> prefixes for efficient getClaimsByOwner.
     */
    private readonly ownerIndex;
    /**
     * Index of delegatedBy -> prefixes for efficient cascade revocation.
     */
    private readonly delegationIndex;
    /**
     * Configuration options for this registry.
     */
    private readonly config;
    /**
     * Create a new TopicClaimRegistry.
     *
     * @param config - Optional configuration
     */
    constructor(config?: ITopicClaimRegistryConfig);
    /**
     * Check if strict mode is enabled.
     *
     * Butler Lampson (Turing Award, Capability Systems):
     *   "Explicit authority is safer than implicit. Strict mode enforces this."
     *
     * @returns true if strict mode is enabled
     */
    isStrictMode(): boolean;
    /**
     * Claim authority over a topic prefix.
     *
     * Rules:
     * 1. Cannot claim if exact prefix already claimed (unless same owner extending)
     * 2. Cannot claim if would conflict with existing exclusive claim
     * 3. Delegated claims require parent to own an ancestor prefix
     */
    claim(prefix: string, owner: string, options?: IClaimOptions & {
        delegatedBy?: string;
    }): IClaimResult;
    /**
     * Release a topic claim.
     */
    release(prefix: string, owner: string, reason?: string): boolean;
    /**
     * Check if a component can create/operate at a given topic.
     *
     * Butler Lampson (Turing Award, Capability Systems):
     *   "In strict mode, all operations require explicit authority.
     *    In open mode, unclaimed territory is accessible to all."
     */
    canCreate(topic: string, owner: string): boolean;
    /**
     * Check if a component can operate on a topic with specific capability.
     *
     * Mark Miller (Capability Security, E Language):
     *   "Capability checks must be explicit. In strict mode, no implicit authority."
     */
    canOperate(topic: string, owner: string, capability: string): boolean;
    /**
     * Get the claim for a specific prefix (exact match).
     */
    getClaim(prefix: string): ITopicClaim | undefined;
    /**
     * Get the authoritative claim for a topic (finds covering prefix).
     */
    getAuthority(topic: string): ITopicClaim | undefined;
    /**
     * Get all claims owned by a component.
     */
    getClaimsByOwner(owner: string): ITopicClaim[];
    /**
     * Get all claims matching a query.
     */
    query(q: IClaimQuery): ITopicClaim[];
    /**
     * Get all active (non-revoked) claims.
     */
    getAllClaims(): ITopicClaim[];
    /**
     * Revoke all claims owned by a component.
     *
     * Joe Armstrong (Erlang, "Programming Erlang"):
     *   "When a supervisor dies, all its children must be notified.
     *    The cascade must be complete - no orphaned authority."
     */
    revokeAll(owner: string, reason?: string): number;
    /**
     * Recursively revoke all claims delegated by an owner.
     *
     * When A delegates to B and B delegates to C:
     * - Revoking A should cascade to B (parent_revoked)
     * - Which should cascade to C (parent_revoked)
     *
     * This ensures the full delegation chain is invalidated.
     */
    private cascadeRevokeDelegations;
    /**
     * Check if a topic falls under any claimed prefix.
     */
    isUnderAuthority(topic: string): boolean;
    /**
     * Clear all claims (for testing purposes).
     */
    clear(): void;
    /**
     * Normalize a prefix by removing trailing dots.
     */
    private normalizePrefix;
    /**
     * Check if a prefix covers a topic.
     *
     * 'flowpad' covers 'flowpad', 'flowpad.tree', 'flowpad.tree.node'
     * 'flowpad.tree' does NOT cover 'flowpad' or 'flowpadExtra'
     */
    private prefixCovers;
    /**
     * Find the authoritative prefix that a specific owner has for a topic.
     */
    private findAuthoritativePrefix;
    /**
     * Find a conflicting claim for a new prefix.
     *
     * Conflicts:
     * 1. New prefix is ancestor of existing exclusive claim by different owner
     * 2. New prefix is descendant of existing exclusive claim by different owner
     *
     * Note: If delegatedBy is set, we skip conflict checking with:
     * - The delegator's own claims
     * - Claims that are ancestors of the delegator's authority (delegation chain)
     *
     * This allows nested delegation: if A delegates to B, and B delegates to C,
     * C's claim should not conflict with A's claim because B's intermediate
     * authority has already "carved out" that subtree.
     */
    private findConflictingClaim;
    /**
     * Merge two capability arrays (union).
     */
    private mergeCapabilities;
}
//# sourceMappingURL=TopicClaimRegistry.d.ts.map