import { ScriptComponent } from 'playcanvas'; import { ComponentElement } from './component'; interface ScriptAttributesChangeEvent extends CustomEvent { detail: { attributes: any; }; } interface ScriptEnableChangeEvent extends CustomEvent { detail: { enabled: boolean; }; } declare global { interface HTMLElementEventMap { 'scriptattributeschange': ScriptAttributesChangeEvent; 'scriptenablechange': ScriptEnableChangeEvent; } } /** * The ScriptComponentElement interface provides properties and methods for manipulating * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-scripts/ | ``} elements. * The ScriptComponentElement interface also inherits the properties and methods of the * {@link HTMLElement} interface. * * @category Components */ declare class ScriptComponentElement extends ComponentElement { private observer; /** @ignore */ constructor(); initComponent(): void; /** * Recursively converts raw attribute data into proper PlayCanvas types. Supported conversions: * - "asset:assetId" → resolves to an Asset instance * - "entity:entityId" → resolves to an Entity instance * - "vec2:1,2" → new Vec2(1,2) * - "vec3:1,2,3" → new Vec3(1,2,3) * - "vec4:1,2,3,4" → new Vec4(1,2,3,4) * - "color:1,0.5,0.5,1" → new Color(1,0.5,0.5,1) * @param item - The item to convert. * @returns The converted item. */ private convertAttributes; /** * Preprocess the attributes object by converting its values. * @param attrs - The attributes object to preprocess. * @returns The preprocessed attributes object. */ private preprocessAttributes; /** * Recursively merge properties from source into target. * @param target - The target object to merge into. * @param source - The source object to merge from. * @returns The merged object. */ private mergeDeep; /** * Update script attributes by merging preprocessed values into the script. * @param script - The script to update. * @param attributes - The attributes to merge into the script. */ private applyAttributes; private handleScriptAttributesChange; private handleScriptEnableChange; private createScript; private destroyScript; private handleMutations; disconnectedCallback(): void; /** * Gets the underlying PlayCanvas script component. * @returns The script component. */ get component(): ScriptComponent | null; } export { ScriptComponentElement };