import { Observer } from '@babylonjs/core/Misc/observable.js'; import { Nullable } from '@babylonjs/core/types.js'; import { AnyCustomProps, CustomProps } from './CustomProps'; import { LifecycleListener } from './LifecycleListener'; import { HasPropsHandlers } from './PropsHandler'; export interface InstanceMetadataParameter { delayCreation?: boolean; shadowGenerator?: boolean; acceptsMaterials?: boolean; isScene?: boolean; isShadowLight?: boolean; isEnvironment?: boolean; isTargetable?: boolean; isNode?: boolean; isMesh?: boolean; isMaterial?: boolean; isGUI3DControl?: boolean; isGUI2DControl?: boolean; isGUI2DGrid?: boolean; isTexture?: boolean; customType?: boolean; isCamera?: boolean; isEffectLayer?: boolean; isGlowLayer?: boolean; isBehavior?: boolean; isShadowGenerator?: boolean; isUtilityLayerRenderer?: boolean; isGizmo?: boolean; isLayer?: boolean; } export interface CreatedInstanceMetadata extends InstanceMetadataParameter { className: string; } /** * CreatedInstance simply contains a Babylon object and a fiber object able to detect and process updates via props to the BabylonObject. * * The parent/child is part of the Fiber Reconciler and helps attach materials/parenting/cameras/shadows/etc. */ export interface CreatedInstance { /** * During lifecycle init process for types delaying creation this may be unset (PhysicsImpostor/ShadowGenerator) * The 'hostInstance' may depend on another object (ie: mesh/light source) */ hostInstance?: T; metadata: CreatedInstanceMetadata; parent: CreatedInstance | null; children: CreatedInstance[]; state?: any; customProps: AnyCustomProps; propsHandlers?: HasPropsHandlers; lifecycleListener?: LifecycleListener; deferredCreationProps?: any; observers: Record>>; } export declare class CreatedInstanceImpl implements CreatedInstance { readonly hostInstance: T; readonly metadata: CreatedInstanceMetadata; parent: CreatedInstance | null; children: CreatedInstance[]; propsHandlers: HasPropsHandlers; customProps: CustomProps; observers: Record>>; constructor(hostInstance: T, metadata: CreatedInstanceMetadata, fiberObject: HasPropsHandlers, customProps: CustomProps); }