interface VirtualKeyboardLike extends EventTarget {
  readonly boundingRect: DOMRectReadOnly;
}

export function getVirtualKeyboard(): VirtualKeyboardLike | null {
  if (typeof navigator === "undefined") return null;
  const nav = navigator as Navigator & {
    virtualKeyboard?: VirtualKeyboardLike;
  };
  return nav.virtualKeyboard ?? null;
}
