import type { PlayerPublic } from './messages.js'; /** * Roster deltas (B-113, W-330). The server used to send every player the whole roster, full appearance and all, each time * anyone changed, so bytes out grew with the square of the players in one place. A client that joins with * `rosterDelta: true` instead gets, per viewer: * - `add`: a full PlayerPublic the first time a player is in view range (appearance included, once); * - `patch`: only the fields that changed since that viewer was last told; * - `remove`: a player who left the view range (or the game). * The helpers below are shared by the server (diff) and the client (apply) so both agree on what a patch means. */ /** A player closer than this many tiles (Euclidean) is in a viewer's roster. */ export declare const ROSTER_VIEW_RADIUS = 96; /** A player already in the roster stays until further than this (hysteresis, so a border walker does not flicker). */ export declare const ROSTER_LEAVE_RADIUS = 112; /** Changed fields of one player: `set` carries new values, `unset` names optional fields that are now absent. */ export type PlayerPatch = { id: string; set?: Partial; unset?: string[]; }; /** What changed from `prev` to `next` (same id), or null when nothing did. */ export declare function diffPlayerPublic(prev: PlayerPublic, next: PlayerPublic): PlayerPatch | null; /** The player after the patch; `prev` is not changed. */ export declare function applyPlayerPatch(prev: PlayerPublic, patch: PlayerPatch): PlayerPublic; /** * Client side: fold a `players_delta` into the roster the client holds. Returns the players to redraw and whether a patch * named someone the client was never given (a lost message): the client then sends `roster_resync`. */ export declare function applyRosterDelta(known: Map, delta: { add?: PlayerPublic[]; patch?: PlayerPatch[]; remove?: string[]; }): { changed: PlayerPublic[]; removed: string[]; needResync: boolean; }; //# sourceMappingURL=rosterDelta.d.ts.map