/** * Component Systems contain the logic and functionality to update all Components of a particular * type. */ export class ComponentSystem extends EventHandler { /** * Create a new ComponentSystem instance. * * @param {import('../app-base.js').AppBase} app - The application managing this system. */ constructor(app: import("../app-base.js").AppBase); app: import("../app-base.js").AppBase; store: {}; schema: any[]; /** * Create new {@link Component} and component data instances and attach them to the entity. * * @param {import('../entity.js').Entity} entity - The Entity to attach this component to. * @param {object} [data] - The source data with which to create the component. * @returns {import('./component.js').Component} Returns a Component of type defined by the * component system. * @example * const entity = new pc.Entity(app); * app.systems.model.addComponent(entity, { type: 'box' }); * // entity.model is now set to a pc.ModelComponent * @ignore */ addComponent(entity: import("../entity.js").Entity, data?: object): import("./component.js").Component; /** * Remove the {@link Component} from the entity and delete the associated component data. * * @param {import('../entity.js').Entity} entity - The entity to remove the component from. * @example * app.systems.model.removeComponent(entity); * // entity.model === undefined * @ignore */ removeComponent(entity: import("../entity.js").Entity): void; /** * Create a clone of component. This creates a copy of all component data variables. * * @param {import('../entity.js').Entity} entity - The entity to clone the component from. * @param {import('../entity.js').Entity} clone - The entity to clone the component into. * @returns {import('./component.js').Component} The newly cloned component. * @ignore */ cloneComponent(entity: import("../entity.js").Entity, clone: import("../entity.js").Entity): import("./component.js").Component; /** * Called during {@link ComponentSystem#addComponent} to initialize the component data in the * store. This can be overridden by derived Component Systems and either called by the derived * System or replaced entirely. * * @param {import('./component.js').Component} component - The component being initialized. * @param {object} data - The data block used to initialize the component. * @param {Array} properties - The array of property * descriptors for the component. A descriptor can be either a plain property name, or an * object specifying the name and type. * @ignore */ initializeComponentData(component: import("./component.js").Component, data: object, properties: Array): void; /** * Searches the component schema for properties that match the specified type. * * @param {string} type - The type to search for. * @returns {string[]|object[]} An array of property descriptors matching the specified type. * @ignore */ getPropertiesOfType(type: string): string[] | object[]; destroy(): void; } import { EventHandler } from '../../core/event-handler.js';