type HTMLContentType = "html" | "bbcode" | "text";
type HTMLSetClassMode = "add" | "toggle" | "remove";
type HTMLSetAttributeMode = "set" | "remove";
type HTMLInsertAtType = "start" | "end" | "replace";
type HTMLScrollDirectionType = "left" | "top";
interface HTMLInstanceElementEvent extends InstanceEvent {
targetId: string;
targetClass: string;
}
interface HTMLInstanceAnimationEvent extends HTMLInstanceElementEvent {
animationName: string;
}
interface HTMLInstanceEventMap extends WorldInstanceEventMap {
"click": HTMLInstanceElementEvent;
"animationend": HTMLInstanceAnimationEvent;
}
/** Represents the HTML Element object.
* @see {@link https://www.construct.net/make-games/manuals/construct-3/scripting/scripting-reference/plugin-interfaces/html-element | IHTMLElementInstance documentation } */
declare class IHTMLElementInstance extends IDOMInstance
{
addEventListener>(type: K, listener: (ev: HTMLInstanceEventMap[K]) => any): void;
removeEventListener>(type: K, listener: (ev: HTMLInstanceEventMap[K]) => any): void;
setContent(str: string, type?: HTMLContentType, selector?: string, isAll?: boolean): Promise;
insertContent(str: string, type?: HTMLContentType, atEnd?: boolean, selector?: string, isAll?: boolean): Promise;
setContentClass(mode: HTMLSetClassMode, classArr: string | string[], selector: string, isAll?: boolean): Promise;
setContentAttribute(mode: HTMLSetAttributeMode, attrib: string, value: string, selector: string, isAll?: boolean): Promise;
setContentCssStyle(propName: string, value: string, selector: string, isAll?: boolean) : Promise;
positionInstanceAtElement(inst: IWorldInstance, selector: string): Promise;
createSpriteImgElement(spriteInst: ISpriteInstance, selector: string, insertAt: HTMLInsertAtType, id?: string, class_?: string): Promise;
setScrollPosition(selector: string, direction: HTMLScrollDirectionType, position: number): Promise;
htmlContent: string;
textContent: string;
}