UNPKG

react-matter-js

Version:

React adapter for the Matter.js physics engine

19 lines (18 loc) 602 B
import Matter from 'matter-js'; import DefaultMap from './DefaultMap'; import TrackSet from './TrackSet'; declare const trackCats: (engine: Matter.Engine) => () => void; export default trackCats; export declare const catsKey: unique symbol; export declare type Cat = TrackSet<Matter.Body>; export declare type CatKey = string | symbol; export declare type CatMap = DefaultMap<CatKey, Cat>; export declare const useCat: (key: CatKey) => Cat; declare module 'matter-js' { interface Engine { [catsKey]: CatMap; } interface Body { [catsKey]: CatKey[]; } }