@playcanvas/web-components
Version:
Web Components for the PlayCanvas Engine
32 lines (31 loc) • 1.07 kB
TypeScript
import { Asset } from 'playcanvas';
/**
* The AssetElement interface provides properties and methods for manipulating
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-asset/ | `<pc-asset>`} elements.
* The AssetElement interface also inherits the properties and methods of the
* {@link HTMLElement} interface.
*/
declare class AssetElement extends HTMLElement {
private _lazy;
/**
* The asset that is loaded.
*/
asset: Asset | null;
disconnectedCallback(): void;
createAsset(): void;
destroyAsset(): void;
/**
* Sets whether the asset should be loaded lazily.
* @param value - The lazy loading flag.
*/
set lazy(value: boolean);
/**
* Gets whether the asset should be loaded lazily.
* @returns The lazy loading flag.
*/
get lazy(): boolean;
static get(id: string): Asset | null | undefined;
static get observedAttributes(): string[];
attributeChangedCallback(name: string, _oldValue: string, _newValue: string): void;
}
export { AssetElement };