import { ReadinessRegistry, ReadinessScope, ICapabilityHandle } from '@camstack/types';
export declare class CapabilityUnavailableError extends Error {
    readonly capName: string;
    readonly scope: ReadinessScope;
    readonly timeoutMs: number;
    constructor(capName: string, scope: ReadinessScope, timeoutMs: number);
}
/**
 * A stable reference to a capability that tracks its readiness state and
 * gates calls on that state.
 *
 * Obtained via `ctx.useCapability()` (non-blocking) or `ctx.acquireCapability()`
 * (blocks until the cap is ready). The handle is cached per `(capName, scope)` in
 * AddonContextImpl so repeated calls return the same instance.
 *
 * The generic `T` is a phantom type documenting the expected provider interface;
 * the handle itself does not expose a typed proxy surface in v1.
 */
export declare class CapabilityHandle<T = unknown> implements ICapabilityHandle<T> {
    readonly capName: string;
    readonly scope: ReadinessScope;
    private readonly registry;
    readonly defaultTimeoutMs: number;
    private state;
    private readonly unsubscribeReadiness;
    constructor(capName: string, scope: ReadinessScope, registry: ReadinessRegistry, defaultTimeoutMs: number);
    get isReady(): boolean;
    /**
     * Block until the capability is ready, or throw `CapabilityUnavailableError`
     * if it does not become ready within `timeoutMs`.
     */
    awaitReady(timeoutMs?: number): Promise<void>;
    /**
     * Execute `fn` with readiness gating: if the cap is not ready, blocks
     * until it becomes ready (or throws CapabilityUnavailableError on timeout),
     * then calls `fn`.
     *
     * Preferred over calling awaitReady() + fn() separately because it
     * re-gates after a down→ready transition that happens between the
     * await and the call.
     */
    call<R>(fn: () => Promise<R>, timeoutMs?: number): Promise<R>;
    /** Unsubscribe from ReadinessRegistry. Called by AddonContextImpl on shutdown. */
    dispose(): void;
    readonly _provider: T;
}
//# sourceMappingURL=capability-handle.d.ts.map