UNPKG

@playcanvas/web-components

Version:

Web Components for the PlayCanvas Engine

25 lines (24 loc) 767 B
import { AppElement } from './app'; import { EntityElement } from './entity'; /** * Base class for all PlayCanvas Web Components that initialize asynchronously. */ declare class AsyncElement extends HTMLElement { private _readyPromise; private _readyResolve; /** @ignore */ constructor(); get closestApp(): AppElement; get closestEntity(): EntityElement; /** * Called when the element is fully initialized and ready. * Subclasses should call this when they're ready. */ protected _onReady(): void; /** * Returns a promise that resolves with this element when it's ready. * @returns A promise that resolves with this element when it's ready. */ ready(): Promise<this>; } export { AsyncElement };