import React from 'react'; import { KeyboardEvent } from 'react-native'; export interface KeyboardManagerProviderProps { children: React.ReactNode; /** * Optional flag to disable native listeners (primarily for tests). */ disabled?: boolean; } export interface KeyboardManagerContextValue { /** Indicates if the on-screen keyboard is currently visible */ isKeyboardVisible: boolean; /** Height of the keyboard in pixels when visible */ keyboardHeight: number; /** Native end coordinates from the last keyboard event */ keyboardEndCoordinates?: KeyboardEvent['endCoordinates']; /** Reported animation duration (ms) from the native keyboard event */ keyboardAnimationDuration: number; /** Reported animation easing from the native keyboard event */ keyboardAnimationEasing?: KeyboardEvent['easing']; /** Latest focus target requested via `setFocusTarget`; null when none pending */ pendingFocusTarget: string | null; /** Imperative helper for dismissing the keyboard */ dismissKeyboard: () => void; /** * Sets an optional focus target that can be consumed by an input after the keyboard closes. * Passing null clears the stored target. */ setFocusTarget: (componentId: string | null) => void; /** * Returns true when the provided component id matches the stored focus target. * The focus target is cleared after a successful match. */ consumeFocusTarget: (componentId: string) => boolean; /** * Helper that records a focus target so the next mounted input can restore focus. * Consumers can call `dismissKeyboard` separately when they need to drop the keyboard. */ refocus: (componentId: string, options?: { dismiss?: boolean; }) => void; } export declare const KeyboardManagerProvider: React.FC; export declare function useKeyboardManager(): KeyboardManagerContextValue; export declare function useKeyboardManagerOptional(): KeyboardManagerContextValue | null;