/**
 * DelegationPort — delegation via → operator (Claim Algebra, S7 spec).
 *
 * Implements capability narrowing (R-1 invariant: child ⊆ parent),
 * chain verification, revocation cascade, and depth limits.
 * Ed25519 signatures, max_depth=5 V0 (configurable 1..10 Enterprise).
 *
 * Spec: docs/plans/PreCarre/canonical/specs/S7.md
 */
export interface Constraint {
    readonly type: string;
    readonly value: string | number | boolean;
}
export interface CapabilityScope {
    readonly capabilities: ReadonlyArray<string>;
    readonly constraints: ReadonlyArray<Constraint>;
    readonly jurisdictions: ReadonlyArray<string>;
    readonly expires_at: string;
}
export interface DelegationClaim {
    readonly id: string;
    readonly parent_id?: string;
    readonly scope: CapabilityScope;
    readonly ed25519_sig: string;
    readonly ttl: number;
    readonly issuer: string;
    readonly holder: string;
    readonly created_at: string;
    readonly revoked_at?: string | null;
}
export interface RootCapability {
    readonly capabilities: ReadonlyArray<string>;
    readonly constraints: ReadonlyArray<Constraint>;
    readonly jurisdictions: ReadonlyArray<string>;
    readonly expires_at: string;
}
export interface VerifyChainResult {
    readonly valid: boolean;
    readonly chain_depth: number;
    readonly errors: string[];
    readonly chain: ReadonlyArray<DelegationClaim>;
}
export interface RevocationOpts {
    readonly reason: string;
    readonly cascade?: boolean;
}
export interface DelegationPort {
    /**
     * Mint a new delegation from a parent capability or root claim.
     * Enforces R-1 narrowing: delegated scope must be ⊆ parent scope.
     * Returns signed DelegationClaim or throws DelegationNotNarrowingError.
     */
    mintDelegation(parent: DelegationClaim | RootCapability, narrowed: CapabilityScope, opts?: {
        ttl?: number;
        issuerId?: string;
        holderId?: string;
    }): Promise<DelegationClaim>;
    /**
     * Verify a delegation claim chain from leaf to root.
     * Checks: Ed25519 signatures, R-1 narrowing at each step,
     * temporal frame nesting, revocation status, cycle detection, max_depth.
     * Returns VerifyChainResult with full chain or error list.
     */
    verifyChain(claim: DelegationClaim): Promise<VerifyChainResult>;
    /**
     * Revoke a delegation claim.
     * Propagates to all descendants (transitive revocation, ¬Revocation semantics).
     * Returns count of claims revoked (including transitive descendants).
     */
    revoke(claimId: string, opts?: RevocationOpts): Promise<number>;
    /**
     * Get a claim by id (from persistent storage).
     * Returns null if not found.
     */
    getClaim(claimId: string): Promise<DelegationClaim | null>;
    /**
     * Get all claims in a delegation chain from leaf to root.
     * Follows parent_id pointers to build full chain.
     */
    getChain(claimId: string): Promise<DelegationClaim[]>;
    /**
     * Check if a claim is revoked (checks cache + on-chain, TTL 60s).
     * Returns true if revoked, false if valid.
     */
    isRevoked(claimId: string): Promise<boolean>;
    /**
     * Get all descendant claims (transitive children).
     * Used for revocation cascade validation.
     */
    getDescendants(claimId: string): Promise<DelegationClaim[]>;
}
export declare class DelegationNotNarrowingError extends Error {
    readonly parentId: string;
    readonly childId: string;
    readonly violationType: string;
    constructor(parentId: string, childId: string, violationType: string);
}
export declare class DelegationExpiredError extends Error {
    readonly claimId: string;
    readonly expiresAt: string;
    constructor(claimId: string, expiresAt: string);
}
export declare class DelegationRevokedError extends Error {
    readonly claimId: string;
    readonly revokedAt: string;
    readonly reason?: string | undefined;
    constructor(claimId: string, revokedAt: string, reason?: string | undefined);
}
export declare class DelegationChainTooDeepError extends Error {
    readonly claimId: string;
    readonly depth: number;
    readonly maxDepth: number;
    constructor(claimId: string, depth: number, maxDepth: number);
}
export declare class DelegationSignatureInvalidError extends Error {
    readonly claimId: string;
    readonly reason: string;
    constructor(claimId: string, reason: string);
}
export declare class DelegationCycleDetectedError extends Error {
    readonly claimId: string;
    readonly cycleSubject: string;
    constructor(claimId: string, cycleSubject: string);
}
export declare class DelegationNotFoundError extends Error {
    readonly claimId: string;
    constructor(claimId: string);
}
export declare class DelegationTemporalFrameError extends Error {
    readonly claimId: string;
    readonly reason: string;
    constructor(claimId: string, reason: string);
}
//# sourceMappingURL=delegation.d.ts.map