/** * Pure browser / device detection helpers used by the system check. * * Side-effect free: every function reads only from `navigator`, `window`, * and `screen`. Safe to import from anywhere — including environments * that don't paint a UI. * * Detection is best-effort. We only care about gating exam delivery, * so we'd rather be slightly conservative (block iOS + low-memory * Android) than chase every browser flavour. The full matrix of UA * weirdness is a problem for the customer's support team, not ours. */ export interface BrowserInfo { name: string; version: string; versionNumber: number; supported: boolean; failReason?: string; } export type DeviceCategory = "Desktop" | "Mobile" | "Tablet"; export interface DeviceInfo { isIOS: boolean; isSamsungBrowser: boolean; isAndroidOrSamsung: boolean; isLowMemory: boolean; isMobileOrTablet: boolean; deviceType: DeviceCategory; os: string; } /** * Minimum Chromium version (Chrome/Edge/Brave) accepted as supported. * 111 is May 2023 — old enough that ~99% of real candidates have it. */ export declare const CHROME_MIN_VERSION = 111; /** * Minimum Safari version accepted as supported. 16.4 is the first * version with reliable `getDisplayMedia` + `MediaRecorder` end-to-end * on desktop macOS. Below this Safari either lacks the APIs entirely * or stutters chunk pacing badly enough that the chunk uploader * drops frames. * * Note: a Safari-recorded session passes preflight + records, but the * post-session Python face analyzer assumes WebM and will skip MP4 * recordings cleanly. Live face-detect during preflight works on * Safari unchanged (it hits the Python sidecar's /detect-face * endpoint with a JPEG, not a video container). */ export declare const SAFARI_MIN_VERSION = 16.4; /** iPhone/iPad/iPod or a "MacIntel" laptop reporting touch (iPad pretending to be desktop). */ export declare const isIOS: () => boolean; /** Samsung Internet — its own renderer, behaves differently from stock Chrome. */ export declare const isSamsungBrowser: () => boolean; /** Any Android UA, plus Samsung Internet (which doesn't always include "android"). */ export declare const isAndroidOrSamsung: () => boolean; /** * Reported-memory floor (GB). A device at or below this fails the * low-memory check. Exported so candidate-facing copy can state the * requirement without hard-coding the number in two places. */ export declare const MIN_DEVICE_MEMORY_GB = 4; /** * Android device with <=4GB of reported memory. The exam UI plus * MediaRecorder plus our IndexedDB queue chews through RAM — under 4GB * we routinely see OOM kills mid-exam. `navigator.deviceMemory` is a * coarse bucketed signal (0.25/0.5/1/2/4/8) — coarse is what we want * here. Browsers may suppress or deliberately alter the signal for * privacy. An unavailable value, or Brave's farbled value, is unknown * and must not be treated as a low-memory report. * * Returns false for non-Android devices; desktop "low memory" is real * but Chrome on a 4GB laptop still copes, where Chrome on a 4GB phone * struggles to keep one camera stream alive. */ export declare const isLowMemoryDevice: () => boolean; /** Best-effort mobile/tablet detection. Used to fail the screen-layout check, not the device check. */ export declare const isMobileOrTablet: () => boolean; /** "Tablet" / "Mobile" / "Desktop" classification for display purposes only — not used to gate. */ export declare const getDeviceType: () => DeviceCategory; /** Operating system name for display ("Windows"/"macOS"/"Android"/"iOS"/"Linux"/"Unknown"). */ export declare const getOS: () => string; /** UA-based Safari detection that excludes Chromium-on-iOS. */ export declare const isSafari: () => boolean; /** * Detects the browser and decides whether it's supported. Pure: takes * the safari predicate as a callback so tests can pin behaviour without * stubbing navigator. */ export declare const detectBrowser: (isSafariFn?: () => boolean) => BrowserInfo; /** One-shot bundle of device facts. Convenient for telemetry. */ export declare const getDeviceInfo: () => DeviceInfo; //# sourceMappingURL=browser-detect.d.ts.map