/** * What a project's work copy DECLARES about the platform it is for: `primaryPlatform` at the top * level of `src/work/game.json`, and `worldProfileData.mobileOrientation`. * * One reader, because two commands now act on the same two fields and must never disagree about * them. `bitmagic publish` syncs them to the catalogue (`publish/platform.ts`), and `bitmagic * verify` / `bitmagic judge` use them to decide which platform to BOOT and whether a mobile * parity gap is a warning or a failure. A second copy of this parse would drift the day one of * those files moves. * * This module reports what the files SAY and nothing about what to do with it: a value that is * present but unusable lands in `rejected` rather than in a sentence, because "leaving the stored * platform alone" and "verifying on the desktop viewport instead" are different consequences of * the same bad value and only the caller knows which one applies. * * Best effort throughout: a missing, unreadable or malformed file means "the project declares * nothing", never an error. A declaration must not be able to fail a command whose real work * succeeded. */ export type PrimaryPlatform = 'desktop' | 'mobile'; export type MobileOrientation = 'portrait' | 'landscape'; export interface PlatformDeclaration { /** * `undefined` means the project declares nothing, which is NOT the same as declaring * 'desktop': publish's catalogue columns are sticky, so "says nothing" must leave the stored * value alone while "says desktop" must overwrite it. Verify treats both as desktop, but it * has to be able to tell them apart to explain WHY it picked a platform. */ primaryPlatform?: PrimaryPlatform; mobileOrientation?: MobileOrientation; /** Whether either work-copy file could be read at all. */ workCopyReadable: boolean; /** Values that were present but not one of the accepted ones, verbatim, for the caller's message. */ rejected: { primaryPlatform?: unknown; mobileOrientation?: unknown; }; } /** * Parse the platform declaration out of `src/work/`. * * `mobileOrientation` resolves world.json first, game.json second, matching the web lane's own * resolution (`game-storage-backend.ts`'s `getListingFieldsSync`). Note this is the OPPOSITE * order to `readFaviconOverride` in publish/favicon.ts, which reads game.json first — the * favicon override's home is game.json, the orientation's is world.json, and neither order is a * house style. * * The legacy `mainPlatform` spelling is NOT honoured: it predates the CLI lane entirely, so no * project this reads can carry it. */ export declare function readPlatformDeclaration(root: string): PlatformDeclaration;