/** * Mobile fullscreen sizing — industry pattern (Zulip, NeoKai, classic `--vh`). * * Root cause on iOS Safari: the layout viewport does not shrink for the * keyboard; the visual viewport does (and may pan via offsetTop). A shell * sized with plain 100vh / bottom:0 therefore sits under the keyboard or * becomes a taller scrollable surface that iOS pans, dragging the composer. * * Fix (write CSS vars from visualViewport on every resize *and* scroll; let * CSS size the shell): * 1. `--vh` = vv.height / 100 * 2. `--keyboard-height` = clientHeight − vv.height − vv.offsetTop * 3. `--vt-vv-top/left/width` for the visible rectangle origin * 4. Shell: `top: var(--vt-vv-top); bottom: var(--keyboard-height)` * (fills exactly the visual viewport — Zulip/NeoKai bottom-pin pattern) * * Always re-apply on visualViewport `scroll`. Freezing `--vt-vv-top` after * keyboard-up left a white gap when iOS focus-pans `offsetTop` (composer * stranded above the keyboard). Unwanted finger pans are blocked separately * via overflow / touch-action / body scroll lock — not by desyncing the shell. */ export interface VisualViewportSnapshot { width: number; height: number; offsetTop: number; offsetLeft: number; } export interface VisualViewportCssVars { /** `top` — visualViewport.offsetTop */ top: string; left: string; width: string; /** Classic `--vh`: 1% of visualViewport.height */ vh: string; /** Zulip/NeoKai: space below the visual viewport (keyboard + chrome) */ keyboardHeight: string; } /** * Pure math: visual-viewport snapshot + layout baseline → CSS custom props. */ export declare function visualViewportCssVars(vv: VisualViewportSnapshot, layoutHeight: number): VisualViewportCssVars; /** @deprecated Use visualViewportCssVars — kept as alias for existing imports. */ export declare function visualViewportMobileFrame(vv: VisualViewportSnapshot, layoutHeight?: number): VisualViewportCssVars & { height: string; }; /** Layout baseline — Zulip prefers clientHeight over innerHeight on iOS. */ export declare function layoutViewportHeight(): number; export declare const KEYBOARD_HEIGHT_GAP_PX = 100; export declare function isVisualViewportKeyboardUp(visualHeight: number, layoutHeight: number, gapPx?: number): boolean;