import { JsonValue } from "type-fest"; export declare abstract class NetplayState> { abstract tick(playerInputs: Map): void; /** * By default, use the auto serializer. */ serialize(): JsonValue; /** * By default, use the auto deserializer. */ deserialize(value: JsonValue): void; } export declare abstract class NetplayInput> { /** * By default, the prediction is to just use the same value. */ predictNext(): TInput; /** * By default, use the auto serializer. */ serialize(): JsonValue; /** * By default, use the auto deserializer. */ deserialize(value: JsonValue): void; } export declare class NetplayPlayer { id: number; isLocal: boolean; isHost: boolean; constructor(id: number, isLocal: boolean, isHost: boolean); isLocalPlayer(): boolean; isRemotePlayer(): boolean; isServer(): boolean; isClient(): boolean; getID(): number; } export interface GameType { /** * Given a list of players, return the initial game state. */ constructInitialState(players: Array): TState; /** * Construct a new input object with a default value. A new object * needs to be constructed, since serialized values will be copied into this. */ constructDefaultInput(): TInput; /** * The game simulation timestep, in milliseconds. */ timestep: number; canvasWidth: number; canvasHeight: number; draw(state: TState, canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D): any; getInputReader(document: HTMLDocument, canvas: HTMLCanvasElement): () => TInput; }