import { VorionError } from '../common/errors.js';
import { type RevocationSLA, type RevocationPropagation, type RevocationResult, type RevocationStatus, type RevocationEvent, type TrustTier } from './types.js';
/**
 * Revocation-specific error
 */
export declare class RevocationError extends VorionError {
    code: string;
    statusCode: number;
    constructor(message: string, details?: Record<string, unknown>);
}
/**
 * Agent is revoked error
 */
export declare class AgentRevokedError extends VorionError {
    code: string;
    statusCode: number;
    constructor(did: string, reason?: string);
}
/**
 * Revocation event callback
 */
export type RevocationEventCallback = (event: RevocationEvent) => void | Promise<void>;
/**
 * Delegation registry interface for querying delegation chains
 */
export interface DelegationRegistry {
    /** Get all delegations from a DID */
    getDelegationsFrom(did: string): Promise<Array<{
        delegateDid: string;
        delegationId: string;
    }>>;
    /** Revoke a delegation */
    revokeDelegation(delegationId: string, reason: string): Promise<void>;
}
/**
 * Token service interface for invalidating tokens
 */
export interface TokenService {
    /** Invalidate all tokens for an agent */
    invalidateForAgent(did: string): Promise<number>;
}
/**
 * Webhook service interface
 */
export interface WebhookService {
    /** Notify webhooks of an event */
    notify(eventType: string, payload: unknown): Promise<void>;
}
/**
 * Revocation Service for managing agent revocation with SLA enforcement
 *
 * @example
 * ```typescript
 * const revocation = new RevocationService(
 *   DEFAULT_REVOCATION_SLAS,
 *   delegationRegistry,
 *   tokenService,
 *   webhookService
 * );
 *
 * // Revoke an agent with recursive propagation
 * const result = await revocation.revokeAgent({
 *   revokedDid: 'did:car:a3i:vorion:agent-123',
 *   reason: 'Security incident',
 *   propagationPolicy: {
 *     terminateDescendants: true,
 *     gracePeriodMs: 0,
 *     notifyWebhooks: true,
 *   },
 * });
 *
 * // Check revocation status
 * const status = await revocation.checkRevocationStatus('did:car:a3i:vorion:agent-123');
 * ```
 */
export declare class RevocationService {
    private delegationRegistry?;
    private tokenService?;
    private webhookService?;
    private slaConfig;
    private cache;
    private revocations;
    private eventCallbacks;
    /**
     * Create a new revocation service
     *
     * @param slaConfig - Revocation SLAs per tier
     * @param delegationRegistry - Optional delegation registry for recursive revocation
     * @param tokenService - Optional token service for invalidation
     * @param webhookService - Optional webhook service for notifications
     */
    constructor(slaConfig?: RevocationSLA[], delegationRegistry?: DelegationRegistry, tokenService?: TokenService, webhookService?: WebhookService);
    /**
     * Revoke an agent with recursive propagation
     *
     * @param revocation - Revocation request
     * @returns Revocation result
     */
    revokeAgent(revocation: RevocationPropagation): Promise<RevocationResult>;
    /**
     * Check revocation status of a DID
     *
     * @param did - DID to check
     * @param tier - Trust tier for SLA-based caching
     * @returns Revocation status
     */
    checkRevocationStatus(did: string, tier?: TrustTier): Promise<RevocationStatus>;
    /**
     * Get SLA for a trust tier
     *
     * @param tier - Trust tier
     * @returns Revocation SLA
     */
    getSLA(tier: TrustTier): RevocationSLA;
    /**
     * Synchronous revocation check for high-value operations
     *
     * Always performs a fresh check, bypassing cache.
     *
     * @param did - DID to check
     * @returns Whether DID is revoked (true = revoked)
     */
    syncRevocationCheck(did: string): Promise<boolean>;
    /**
     * Subscribe to revocation events
     *
     * @param callback - Callback to invoke on revocation events
     * @returns Unsubscribe function
     */
    onRevocation(callback: RevocationEventCallback): () => void;
    /**
     * Check if synchronous revocation check is required
     *
     * @param tier - Trust tier
     * @param isHighValueOperation - Whether this is a high-value operation
     * @returns Whether sync check is required
     */
    requiresSyncCheck(tier: TrustTier, isHighValueOperation?: boolean): boolean;
    /**
     * Propagate revocation to descendants in delegation chain
     */
    private propagateToDescendants;
    /**
     * Invalidate active tokens for an agent
     */
    private invalidateTokens;
    /**
     * Emit a revocation event to subscribers
     */
    private emitEvent;
    /**
     * Clear a revocation (for testing or admin operations)
     */
    clearRevocation(did: string): void;
    /**
     * Get all active revocations
     */
    getActiveRevocations(): RevocationResult[];
    /**
     * Destroy the service (cleanup)
     */
    destroy(): void;
}
/**
 * Create a revocation service with default configuration for CAR ID
 */
export declare function createRevocationService(slaConfig?: RevocationSLA[], delegationRegistry?: DelegationRegistry, tokenService?: TokenService, webhookService?: WebhookService): RevocationService;
//# sourceMappingURL=revocation.d.ts.map