/**
 * Permission Chain Implementation
 *
 * Implements the Chain of Responsibility pattern for handling IAM permission requests.
 * Each handler processes specific resource types and delegates to the next handler
 * if it cannot process the request.
 *
 * @module declarative-api/permission-chain
 */
import type { IResourceEntity, IPermissionHandler, IPermissionChain, PermissionRequest, PermissionResult, AuditLogEntry } from '../../../lib/runtime-web/types/declarative-api';
/**
 * Permission Chain implementation.
 *
 * Manages a chain of permission handlers and processes permission requests
 * by delegating to the appropriate handler based on resource type.
 *
 * Implements: Chain of Responsibility Pattern
 *
 * @example
 * ```typescript
 * const chain = new PermissionChain();
 * chain.addHandler(new TablePermissionHandler());
 * chain.addHandler(new QueuePermissionHandler());
 *
 * const result = chain.handle(resource, role, { permissionLevel: 'read' });
 * ```
 *
 * Validates: Requirements 5.1, 5.2, 5.3, 5.4, 5.5, 5.6
 */
export declare class PermissionChain implements IPermissionChain {
    private head;
    private handlers;
    private auditLogs;
    /**
     * Add a handler to the chain.
     * Handlers are automatically sorted by priority (lower = earlier).
     *
     * @param handler - The handler to add
     * @returns This chain for method chaining
     */
    addHandler(handler: IPermissionHandler): this;
    /**
     * Remove a handler from the chain by ID.
     *
     * @param handlerId - The ID of the handler to remove
     * @returns True if the handler was removed
     */
    removeHandler(handlerId: string): boolean;
    /**
     * Handle a permission request.
     *
     * @param resource - The resource to grant access to
     * @param role - The IAM role to grant permissions to
     * @param request - The permission request
     * @returns The result of the permission operation
     * @throws Error if no handlers are in the chain
     */
    handle(resource: IResourceEntity, role: unknown, request: PermissionRequest): PermissionResult;
    /**
     * Get all handlers in the chain.
     *
     * @returns Array of handlers in priority order
     */
    getHandlers(): readonly IPermissionHandler[];
    /**
     * Get all audit log entries.
     *
     * @returns Array of audit log entries
     */
    getAuditLogs(): readonly AuditLogEntry[];
    /**
     * Clear all audit log entries.
     */
    clearAuditLogs(): void;
    /**
     * Check if the chain has any handlers.
     *
     * @returns True if the chain has at least one handler
     */
    hasHandlers(): boolean;
    /**
     * Rebuild the chain after adding or removing handlers.
     */
    private rebuildChain;
}
