/** * The phone `bitmagic verify --platform mobile` emulates. * * Zero new dependencies: `playwright-core` — already the CLI's only browser dependency — ships * the device registry, and the whole descriptor goes into `newContext` as Playwright documents. * What it buys, in order of how much it matters: `isMobile`, which makes Chromium honour the * page's `meta viewport` tag so the engine lays out at phone width instead of a desktop * fallback; `hasTouch`, without which the start interaction cannot tap; the viewport and * `screen` sizes game code reads directly; and `deviceScaleFactor` 3, which is what actually * exercises the engine's mobile pixel-ratio clamp (`RenderPixelRatio.ts` caps mobile at 2) — an * emulation at DPR 1 would never reach it. * * The descriptor's iOS `userAgent` rides along deliberately rather than being stripped. The * engine decides mobile-ness from `?platform=mobile` (`isMobileRuntime.ts`), so the UA is not * what makes the run mobile — but plenty of game and engine code sniffs the UA directly rather * than asking the engine, which is the same reason `installForcedMobileTouchShim` exists at all. * A run whose UA says desktop while everything else says phone would make those sniffs disagree * with the mode under test. Consistency is what is wanted here, not literal truth about which * binary is running. (`defaultBrowserType: 'webkit'` is inert — only Playwright's test runner * reads it; `newContext` does not.) */ import { devices } from 'playwright-core'; import type { MobileOrientation } from '../project/platform-declaration.js'; /** Context options for a phone run — a `playwright-core` device descriptor, verbatim. */ export type VerifyDeviceOptions = (typeof devices)[keyof typeof devices]; /** * Which registry entries. A mid-size modern phone: narrow enough that a HUD laid out for a * desktop viewport visibly breaks, and common enough that its dimensions are what most players * actually hold. * * The registry's own `landscape` variant rather than swapping the portrait one's axes: those are * Playwright's measured numbers for a rotated phone (750x340 viewport, screen still reported * portrait), and a hand-rotated 664x390 would only be a guess at the same thing. */ export declare const MOBILE_DEVICE_NAMES: Record; /** * The device a mobile check runs on, oriented the way the game asks to be played — * `worldProfileData.mobileOrientation` in world.json, portrait when it says nothing. A * landscape-locked game verified in a portrait window is not being verified. */ export declare function mobileContextOptions(orientation: MobileOrientation): VerifyDeviceOptions; /** `iPhone 14 (390x664, DPR 3)` — what the run tells the creator it emulated. */ export declare function describeMobileDevice(orientation: MobileOrientation): string;