export interface SafeAreaInsets { top: number; bottom: number; left: number; right: number; } export interface SafeAreaInsetsOptions { minTop?: number; minBottom?: number; minLeft?: number; minRight?: number; } /** * Custom hook for accessing safe area insets with automatic fallback * * Provides safe area insets for proper UI positioning on devices with notches, * dynamic islands, and status bars. Automatically detects and uses the native * react-native-safe-area-context package when available, falling back to a * pure JavaScript implementation when not available. * * @param options - Configuration options for minimum inset values * @param options.minTop - Minimum top inset value (overrides calculated value if larger) * @param options.minBottom - Minimum bottom inset value (overrides calculated value if larger) * @param options.minLeft - Minimum left inset value (overrides calculated value if larger) * @param options.minRight - Minimum right inset value (overrides calculated value if larger) * * @returns SafeAreaInsets object with top, bottom, left, right pixel values * * @example * ```typescript * // Basic usage * const insets = useSafeAreaInsets(); * const topPadding = insets.top; * * // With minimum values * const insets = useSafeAreaInsets({ * minTop: 20, * minBottom: 10 * }); * ``` * * @performance Uses pure JS fallback with device dimension mapping for iOS * @performance Automatically handles orientation changes with dimension listener * @performance Memoizes native package detection at module level */ export declare const useSafeAreaInsets: (options?: SafeAreaInsetsOptions) => SafeAreaInsets; /** * Utility function to detect if the current device has a notch or dynamic island * * @returns True if the device has a notch/dynamic island, false otherwise * * @example * ```typescript * if (hasNotch()) { * // Apply special styling for notched devices * console.log('Device has notch or dynamic island'); * } * ``` */ export declare const hasNotch: () => boolean; /** * Configuration helper for safe area implementation management * * Provides utilities for checking native package availability, * forcing pure JS implementation, and getting implementation type info */ export declare const SafeAreaConfig: { /** * Check if the native react-native-safe-area-context package is available * This is detected at install time by scripts/detect-safe-area.js * * @returns True if native package is installed and available */ hasNativeSupport: () => boolean; /** * Force pure JS implementation (useful for testing) * Set to true to disable native package usage even when available */ forcePureJS: boolean; /** * Get current implementation type being used * Detected at install time by scripts/detect-safe-area.js * * @returns "native" if using react-native-safe-area-context, "pure-js" if using fallback */ getImplementationType: () => "native" | "pure-js"; }; /** * Compatibility hook that returns the window frame dimensions * * @returns Frame object with x, y, width, height properties * * @deprecated Use Dimensions.get("window") directly instead */ export declare const useSafeAreaFrame: () => { x: number; y: number; width: number; height: number; }; /** * Export the pure JS implementation directly for compatibility * * @returns SafeAreaInsets calculated using pure JavaScript implementation * * @example * ```typescript * const insets = getSafeAreaInsets(); * console.log(`Top inset: ${insets.top}px`); * ``` */ export declare const getSafeAreaInsets: () => SafeAreaInsets; //# sourceMappingURL=useSafeAreaInsets.d.ts.map