2024-12-22 10:23:37 -08:00
|
|
|
import { ElemWrapper } from "./elemwrapper";
|
|
|
|
|
|
2024-12-23 14:09:06 -08:00
|
|
|
interface SLBaseElem extends HTMLElement {
|
|
|
|
|
updateComplete: Promise<void>;
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-22 10:23:37 -08:00
|
|
|
export class SLElem extends ElemWrapper {
|
|
|
|
|
constructor(tagName: string) {
|
|
|
|
|
super(document.createElement(tagName));
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-23 14:09:06 -08:00
|
|
|
public async awaitUpdate() {
|
|
|
|
|
await (this.elem as SLBaseElem).updateComplete;
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-22 10:23:37 -08:00
|
|
|
public setSlot(slot: string) {
|
|
|
|
|
this.setAttribute("slot", slot);
|
|
|
|
|
}
|
|
|
|
|
}
|