API overview
Everything below is exported from the package root:
Exports
Class hierarchy
Conventions
These hold across the whole API:
- Bytes are
Uint8Array | ArrayBuffer(andBufferin Node). Inputs are normalised toUint8Array; outputs are alwaysUint8Array. - Wrappers are stateless.
Stage,Sprite,CostumeandSoundinstances are thin views overproject.json/project.assets. Creating one is cheap, and two wrappers over the same entry always agree. - Lookups return
undefinedwhen nothing matches (e.g.sprite(),getCostume()); removals returnboolean. - Setters coerce their input (
Number,Boolean,String) so loosely-typed values are safe to assign. - Async only where I/O happens —
Project.loadandproject.savearePromise-returning; everything else is synchronous.
TypeScript
The package ships .d.ts declarations generated from the source JSDoc, so all of
the above is fully typed with no extra @types package.