/**
 * Interface for global dependencies that can be injected for testing
 */
interface GlobalDependencies {
    readonly document: Document;
    readonly window: Window & typeof globalThis;
    readonly visualViewport: VisualViewport | null;
}
declare class KeyboardVisibilityChangedEvent extends CustomEvent<{
    isKeyboardVisible: boolean;
    keyboardHeight: number;
    keyboardTop: number;
}> {
    constructor(isKeyboardVisible: boolean, keyboardHeight?: number, keyboardTop?: number);
}
interface KeyboardVisibilityControllerEventMap {
    "keyboard-visibility-changed": KeyboardVisibilityChangedEvent;
}
/**
 * Global controller for keyboard visibility detection.
 * Uses focusin/focusout events to detect keyboard on both iOS and Android.
 * Waits for keyboard animation to complete before dispatching event.
 * Ensures listeners are added only once globally.
 * Extends EventTarget to dispatch keyboard visibility events.
 */
declare class KeyboardVisibilityController extends EventTarget {
    private static _instance;
    private _isKeyboardVisible;
    private _keyboardHeight;
    private _keyboardTop;
    private _isConnected;
    private _refCount;
    private _initialViewportHeight;
    private _handleFocusIn;
    private _handleFocusOut;
    private _handleVisualViewportResize;
    private readonly _globals;
    private static readonly KEYBOARD_HEIGHT_THRESHOLD;
    private static readonly VIEWPORT_RESIZE_DEBOUNCE;
    private constructor();
    static getInstance(): KeyboardVisibilityController;
    /**
     * Create a new instance with custom global dependencies (mainly for testing).
     * This does NOT affect the singleton instance returned by getInstance().
     */
    static create(globals: GlobalDependencies): KeyboardVisibilityController;
    /**
     * Connect to keyboard visibility monitoring.
     * Listeners are added on first connect, removed on last disconnect.
     */
    connect(): void;
    /**
     * Disconnect from keyboard visibility monitoring.
     * Listeners are removed when all consumers disconnect.
     */
    disconnect(): void;
    private _setupListeners;
    private _removeListeners;
    /**
     * Calculate keyboard height using Visual Viewport API
     * On iOS, window.innerHeight shrinks when keyboard appears, so we must use
     * the initial viewport height as reference instead.
     */
    private _calculateKeyboardHeight;
    /**
     * Calculate the Y position where keyboard starts (top edge of keyboard)
     * Accounts for both viewport shrinkage and scroll offset
     */
    private _calculateKeyboardTop;
    /**
     * Handle visual viewport resize events
     * Called by debounced handler after viewport has stopped resizing
     */
    private _onVisualViewportResize;
    private _onFocusIn;
    private _onFocusOut;
    isKeyboardVisible(): boolean;
    getKeyboardHeight(): number;
    getKeyboardTop(): number;
    /**
     * Add a listener for keyboard visibility changes.
     * @param type - Must be "keyboard-visibility-changed"
     * @param listener - Event listener callback
     */
    addEventListener<K extends keyof KeyboardVisibilityControllerEventMap>(type: K, listener: (event: KeyboardVisibilityControllerEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
    /**
     * Remove a listener for keyboard visibility changes.
     * @param type - Must be "keyboard-visibility-changed"
     * @param listener - Event listener callback
     */
    removeEventListener<K extends keyof KeyboardVisibilityControllerEventMap>(type: K, listener: (event: KeyboardVisibilityControllerEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
    /**
     * Reset the controller (rarely needed, mainly for testing).
     * Disconnects all references and cleans up.
     * If resetInstance is true, also resets the singleton instance.
     */
    reset(resetInstance?: boolean): void;
}

export { type GlobalDependencies, KeyboardVisibilityChangedEvent, KeyboardVisibilityController, type KeyboardVisibilityControllerEventMap };
