Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / GetMatchResponse

Interface: GetMatchResponse ​

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

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Reuse a real snapshot shape when building response fixtures.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const getMatchResponse = { snapshot: matchSnapshot } satisfies GetMatchResponse

console.log(getMatchResponse)

Properties ​

snapshot ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Reuse a real snapshot shape when building response fixtures.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const getMatchResponse = { snapshot: matchSnapshot } satisfies GetMatchResponse

const { snapshot: fetchedMatchSnapshot } = getMatchResponse

console.log(fetchedMatchSnapshot)

snapshot: GameState

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

Released under the MIT License.