Skip to main content

API Reference 📖

The full, auto-generated API reference (every exported symbol, type, parameter, and example) lives at:

👉 API Reference — TypeDoc

It is built from the source by TypeDoc on every push to master, so it's always in sync with what's actually on npm.

Top-level exports — at a glance

import {
// 🎮 Game facade — wires everything together
createGame,
type Game,
type GameConfig,

// 🗂️ State + actions
createStore,
defineActions,
type Store,
type Action,
type ActionMap,
type AnyAction,
type Dispatch,

// ⏱️ Loop primitives
createLoop,
browserScheduler,
nodeScheduler,
defaultScheduler,
type Loop,
type LoopConfig,
type Scheduler,

// 🎮 Input
createKeyboard,
createPointer,
createGamepad,
type Keyboard,
type Pointer,
type PointerState,
type Gamepad,
type GamepadOptions,
type GamepadState,
type NativeGamepad,
type StandardAxis,
type StandardButton,

// 🎬 Scenes (typed FSM)
createMachine,
type Machine,
type MachineConfig,
type Transitions,

// 🧠 Selectors
createSelector,
type Selector,

// 🎞️ Record & replay
createRecorder,
replay,
composeTaps,
truncateRecording,
RECORDING_VERSION,
type ActionTap,
type RecordedEvent,
type Recorder,
type RecorderOptions,
type Recording,
type ReplayOptions,

// 🧰 Utility types
type DeepReadonly,
type Listener,
type Unsubscribe,
} from 'gameplate';

Every symbol is documented with:

  • Full TypeScript signature
  • Inline TSDoc summary
  • One-or-more usage examples
  • Cross-links to related symbols
  • Source location (linked back to GitHub)

Bundle and runtime info

Bundle size (gzipped)~3 KB (target: < 4 KB hard cap in CI)
Tree-shakingsideEffects: false — only imported symbols land in your bundle
Runtime dependenciesNone.
ModulesDual ESM + CJS; exports map drives resolution
TypesStrict TS; publint + attw validated on every PR
Min Node20.10

Versioning

gameplate follows semver. Breaking changes only in major releases. Changelogs are auto-generated by changesets and published as GitHub Releases.