import { System, ComponentChanged, Component } from '@combos-fun/engine'; import Matter$1 from 'matter-js'; type DeepPartial = { [P in keyof T]?: T[P] extends Object ? DeepPartial : T[P]; }; interface PhysicsSystemParams { resolution?: number; fps?: number; isTest?: boolean; element?: HTMLElement; canvas?: HTMLCanvasElement; deltaSampleSize?: number; mouse?: { open: boolean; constraint?: Matter.Constraint; }; world: DeepPartial; } declare class PhysicsSystem extends System { static systemName: string; private engine; /** * System init: configure params before the game starts. * @param param init params */ init(param?: PhysicsSystemParams): void; /** * Called when the System is installed; if the game has not started, it runs when the * game starts. Use it for setup work such as initializing data. */ awake(): void; /** * Called after the System is installed and all systems' `awake` have run. */ start(): void; /** * Called on every game loop; can perform operations and change component properties. */ update(e: any): void; componentChanged(changed: ComponentChanged): void; /** * Like `update`, but called after every System's and component's `update` has run. */ lateUpdate(): void; /** * Called when the game starts or resumes playing after a pause. */ onResume(): void; /** * Called when the game is paused. */ onPause(): void; /** * Called when the system is destroyed. */ onDestroy(): void; } declare enum PhysicsType { RECTANGLE = "rectangle", CIRCLE = "circle", POLYGON = "polygon" } interface PhysicsParams { type?: PhysicsType; bodyOptions?: { isStatic?: boolean; restitution?: number; density?: number; [propName: string]: any; }; position?: { x?: number; y?: number; }; sides?: number; radius?: number; stopRotation?: boolean; } declare class Physics extends Component { static componentName: string; bodyParams: PhysicsParams; body: Matter$1.Body; private PhysicsEngine; init(params: PhysicsParams): void; update(): void; onDestroy(): void; } export { Physics, PhysicsSystem, PhysicsType }; export type { PhysicsSystemParams };