import { Layout } from '../interfaces/Layout';
import { LinkingConfig, RouteMatch } from './types';
/** A function that shows a layout as a modal. Mirrors `Commands.showModal`. */
export type ShowModal = (layout: Layout) => Promise<string>;
/**
 * Minimal abstraction over React Native's `Linking` module so the handler
 * can be tested without touching native bindings.
 */
export interface LinkingAPI {
    addEventListener(type: 'url', handler: (event: {
        url: string;
    }) => void): {
        remove: () => void;
    };
    getInitialURL(): Promise<string | null>;
}
/**
 * Orchestrates deep linking:
 *
 *   1. Subscribes to URL events from `Linking` and the initial URL.
 *   2. Parses + matches each URL against the configured `screens` tree.
 *   3. Defers processing until both:
 *        - the first `setRoot` has resolved (so a modal can be presented), and
 *        - the user-supplied `isReady` predicate (if any) returns `true`.
 *   4. Resolves matches in this order:
 *        - `onLink(match)` if provided (full escape hatch), else
 *        - `getModal(match)` if provided, else
 *        - the default `ModalLayoutBuilder` output.
 *      Result is presented via `showModal`.
 *   5. Calls `fallback(url)` when a URL has no matching prefix or route.
 */
export declare class LinkingHandler {
    private readonly urlParser;
    private readonly routeMatcher;
    private readonly deferredQueue;
    private readonly modalLayoutBuilder;
    private readonly showModal;
    private readonly linkingAPI;
    private config;
    private linkingSubscription;
    private rootReady;
    private userReadyOverride;
    constructor(showModal: ShowModal, linkingAPI?: LinkingAPI);
    configure(config: LinkingConfig): void;
    /**
     * Manually feed a URL into the pipeline as if it came from the OS.
     * Useful for URLs received from push notifications or other sources.
     */
    handleURL(url: string): void;
    /**
     * Called by `NavigationRoot` after the first `setRoot` resolves. Subsequent
     * calls are no-ops.
     */
    setRootReady(): void;
    /**
     * Public toggle for the app-supplied readiness gate. Overrides the
     * `config.isReady` predicate from the moment it's first called.
     */
    setLinkingReady(ready: boolean): void;
    /**
     * Resolve a URL to a `RouteMatch` without side effects. Returns `null`
     * when the URL doesn't match any configured prefix or route.
     */
    resolve(url: string): RouteMatch | null;
    teardown(): void;
    private subscribe;
    private processURL;
    private isReady;
    private refreshReady;
}
//# sourceMappingURL=LinkingHandler.d.ts.map