@playcanvas/web-components
Version:
Web Components for the PlayCanvas Engine
113 lines (112 loc) • 3.18 kB
TypeScript
import { AppBase, Entity, Vec3 } from 'playcanvas';
import { AsyncElement } from './async-element';
/**
* The EntityElement interface provides properties and methods for manipulating
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-entity/ | `<pc-entity>`} elements.
* The EntityElement interface also inherits the properties and methods of the
* {@link HTMLElement} interface.
*/
declare class EntityElement extends AsyncElement {
/**
* Whether the entity is enabled.
*/
private _enabled;
/**
* The name of the entity.
*/
private _name;
/**
* The position of the entity.
*/
private _position;
/**
* The rotation of the entity.
*/
private _rotation;
/**
* The scale of the entity.
*/
private _scale;
/**
* The tags of the entity.
*/
private _tags;
/**
* The pointer event listeners for the entity.
*/
private _listeners;
/**
* The PlayCanvas entity instance.
*/
entity: Entity | null;
createEntity(app: AppBase): void;
buildHierarchy(app: AppBase): void;
connectedCallback(): void;
disconnectedCallback(): void;
/**
* Sets the enabled state of the entity.
* @param value - Whether the entity is enabled.
*/
set enabled(value: boolean);
/**
* Gets the enabled state of the entity.
* @returns Whether the entity is enabled.
*/
get enabled(): boolean;
/**
* Sets the name of the entity.
* @param value - The name of the entity.
*/
set name(value: string);
/**
* Gets the name of the entity.
* @returns The name of the entity.
*/
get name(): string;
/**
* Sets the position of the entity.
* @param value - The position of the entity.
*/
set position(value: Vec3);
/**
* Gets the position of the entity.
* @returns The position of the entity.
*/
get position(): Vec3;
/**
* Sets the rotation of the entity.
* @param value - The rotation of the entity.
*/
set rotation(value: Vec3);
/**
* Gets the rotation of the entity.
* @returns The rotation of the entity.
*/
get rotation(): Vec3;
/**
* Sets the scale of the entity.
* @param value - The scale of the entity.
*/
set scale(value: Vec3);
/**
* Gets the scale of the entity.
* @returns The scale of the entity.
*/
get scale(): Vec3;
/**
* Sets the tags of the entity.
* @param value - The tags of the entity.
*/
set tags(value: string[]);
/**
* Gets the tags of the entity.
* @returns The tags of the entity.
*/
get tags(): string[];
static get observedAttributes(): string[];
attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void;
removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void;
hasListeners(type: string): boolean;
}
export { EntityElement };