@playcanvas/web-components
Version:
Web Components for the PlayCanvas Engine
73 lines (72 loc) • 2.55 kB
TypeScript
import { RenderComponent, StandardMaterial } from 'playcanvas';
import { ComponentElement } from './component';
/**
* The RenderComponentElement interface provides properties and methods for manipulating
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-render/ | `<pc-render>`} elements.
* The RenderComponentElement interface also inherits the properties and methods of the
* {@link HTMLElement} interface.
*
* @category Components
*/
declare class RenderComponentElement extends ComponentElement {
private _castShadows;
private _material;
private _receiveShadows;
private _type;
/** @ignore */
constructor();
getInitialComponentData(): {
type: "box" | "asset" | "capsule" | "cone" | "cylinder" | "plane" | "sphere";
castShadows: boolean;
material: StandardMaterial | null | undefined;
receiveShadows: boolean;
};
/**
* Gets the underlying PlayCanvas render component.
* @returns The render component.
*/
get component(): RenderComponent | null;
/**
* Sets the type of the render component.
* @param value - The type.
*/
set type(value: 'asset' | 'box' | 'capsule' | 'cone' | 'cylinder' | 'plane' | 'sphere');
/**
* Gets the type of the render component.
* @returns The type.
*/
get type(): 'asset' | 'box' | 'capsule' | 'cone' | 'cylinder' | 'plane' | 'sphere';
/**
* Sets the cast shadows flag of the render component.
* @param value - The cast shadows flag.
*/
set castShadows(value: boolean);
/**
* Gets the cast shadows flag of the render component.
* @returns The cast shadows flag.
*/
get castShadows(): boolean;
/**
* Sets the material of the render component.
* @param value - The id of the material asset to use.
*/
set material(value: string);
/**
* Gets the id of the material asset used by the render component.
* @returns The id of the material asset.
*/
get material(): string;
/**
* Sets the receive shadows flag of the render component.
* @param value - The receive shadows flag.
*/
set receiveShadows(value: boolean);
/**
* Gets the receive shadows flag of the render component.
* @returns The receive shadows flag.
*/
get receiveShadows(): boolean;
static get observedAttributes(): string[];
attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
}
export { RenderComponentElement };