Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / FormatEventResponse

Interface: FormatEventResponse

Defined in: packages/ts-sdk/src/generated/types/format-event-response.ts:257

HTTP response after applying a format-event command.

Example:

ts
import type { FormatEventResponse } 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',
}) // Format events return an updated snapshot after the server applies them. const
matchSnapshot
= await
simulatorClient
.
matches
.
get
('match_123')
const
formatEventResponse
= {
snapshot
:
matchSnapshot
} satisfies FormatEventResponse
console
.
log
(
formatEventResponse
)

Indexable

[k: string]: unknown

Properties

snapshot

Example:

ts
import type { FormatEventResponse } 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',
}) // Format events return an updated snapshot after the server applies them. const
matchSnapshot
= await
simulatorClient
.
matches
.
get
('match_123')
const
formatEventResponse
= {
snapshot
:
matchSnapshot
} satisfies FormatEventResponse
const {
snapshot
:
updatedMatchSnapshot
} =
formatEventResponse
console
.
log
(
updatedMatchSnapshot
)

snapshot: GameState

Defined in: packages/ts-sdk/src/generated/types/format-event-response.ts:258

Released under the MIT License.