Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / ServerMessage

Type Alias: ServerMessage ​

ServerMessage = { payload: WelcomePayload; type: "welcome"; } | { payload: GameState; type: "snapshot"; } | { payload: { revision: number; snapshot: GameState; }; type: "snapshotUpdate"; } | { payload: MatchHistorySnapshot; type: "historySnapshot"; } | { payload: MatchHistoryFeedEntry; type: "historyEntry"; } | { payload: GameEvent; type: "event"; } | { payload: CardInteractionCue; type: "interactionCue"; } | { payload: AiStatusPayload; type: "aiStatus"; } | { payload: ErrorPayload; type: "error"; } | { payload: { nonce?: string | null; }; type: "pong"; }

Defined in: packages/ts-sdk/src/generated/types/common.ts:5576

Example:

ts
import type { ServerMessage } from '@my-swu/simulator-client'

const pongMessage = { type: 'pong', payload: { nonce: 'host-latency-1' } } satisfies ServerMessage

console.log(pongMessage)

Released under the MIT License.