import { Scene } from '@babylonjs/core/scene.js'; import { CreatedInstance } from './CreatedInstance'; export interface LifecycleListener { onCreated?: (instance: CreatedInstance, scene: Scene) => void; onParented: (parent: CreatedInstance, child: CreatedInstance) => any; onChildAdded: (child: CreatedInstance, parent: CreatedInstance) => any; /** * It is not set on when delay creation is enabled for this type (PhysicsImpostor/ShadowGenerator) * Some objects cannot be properly instantiated until their dependant objects (mesh/light source) are instantiated. */ onMount: (instance: CreatedInstance) => any; /** * Called on GUI controls, once they have been added as a control. */ onAddedAsControl?: (instance: CreatedInstance) => void; /** * When hosted instance is unmounted */ onUnmount: () => void; }