/** * What the launcher reports about adaptation packs (main/services/patch-pack/): which patch set * the builds use, and whether a newer pack is released. */ /** The patch set that ships with the launcher, or a downloaded adaptation pack. */ export type PatchSetSource = 'bundled' | 'downloaded'; export interface ActivePatchSet { readonly source: PatchSetSource; /** Pack version; null for a bundled set without one (a repository checkout). */ readonly version: string | null; /** Game versions with a version record in the set. */ readonly gameVersions: readonly string[]; } export interface PackRelease { readonly version: string; readonly gameVersions: readonly string[]; readonly minAppVersion: string; readonly publishedAt: string | null; } export type PackCheckStatus = /** No release is newer than the active set. */ | 'up_to_date' /** A newer pack this launcher can use. */ | 'available' /** A newer pack needs a newer offline version (launcher) first. */ | 'needs_app_update' /** The check could not be made; see `problem`. */ | 'failed'; export type PackProblem = /** This build of the launcher carries no signing key, so it accepts no pack. */ | 'no_signing_key' /** GitHub could not be reached or answered with an error. */ | 'network' /** The release or the pack is malformed. */ | 'contents' /** The signature does not match. */ | 'signature' /** The pack is larger than allowed. */ | 'size'; export interface PackCheck { readonly status: PackCheckStatus; readonly active: ActivePatchSet; /** The newest released pack; null when none is released or the check failed. */ readonly latest: PackRelease | null; readonly problem: PackProblem | null; } export type PackApplyResult = | { readonly ok: true; readonly active: ActivePatchSet } | { readonly ok: false; readonly problem: PackProblem | 'needs_app_update' | 'up_to_date' };