export class BrushPreview extends HTMLElement { constructor(width, height) { super(); this.width = width; this.height = height; } connectedCallback() { // TODO } async #renderBrushInner(haku) { // TODO return { status: "ok" }; } async renderBrush(haku) { this.unsetErrorFlag(); let result = await this.#renderBrushInner(haku); if (result.status == "error") { console.error(result); this.setErrorFlag(); } return result; } unsetErrorFlag() { this.classList.remove("error"); } setErrorFlag() { this.classList.add("error"); } } customElements.define("rkgk-brush-preview", BrushPreview);