Important
This project is not yet finished and is still in development. Expect major breaking changes if you decide to use it.
TypeScript type definitions for the Steam client window objects including SteamClient, UI components, and global objects.
bun add -d steam-types
# or
pnpm add -D steam-typesTo override the global SteamClient type that may be provided by other packages like @steambrew/client, create a patch file and remove the global SteamClient type
This project consists of:
- Generated TypeScript definitions in the
src/typesfolder - Automation scripts in the
scriptsfolder for generating and validating types see Development
The type definitions cover the Steam client's global SharedJSContext window objects, including:
SteamClientobject and all its submodules (Apps, UI, System, etc.)- All the other global objects (appDetailsStore, collectionStore, etc.)
The project includes scripts for:
- Converting runtime JS objects to TypeScript interfaces
- Comparing and validating the generated types against the actual Steam client
- Automating the type generation process
Fill a lot of data:
fillAppData();map an app details value:
[...appDetailsStore.m_mapAppData.values()].map(data => {return {value: data.details?.eCloudSync, name: data.details?.strDisplayName}}).filter(d => d.value !== undefined)Profile a script:
tsx --cpu-prof --cpu-prof-dir .profiler --no-warnings scripts/convert-to-typescript/test.ts
Run the type validation script to ensure definitions match the runtime objects:
bun validate-typesContributions are welcome! Please follow the existing naming conventions and ensure all generated interfaces are properly exported.
- This decky pr for the initial SteamClient type definitions and the inspiration for this project.