import { GoBoard } from "./components/Board"; import { CoreApi, initCore } from "./coreApi"; window.customElements.define("go-board", GoBoard, { extends: "canvas" }); declare global { interface HTMLElementTagNameMap { "go-board": GoBoard; } } const main = async () => { let coreApi = await initCore(); let response = await coreApi.playingField(); console.log("playing field response: ", response); const root = document.getElementById("root"); if (!root) { alert("could not retrieve the app root container"); return; } const board = document.createElement("canvas", { is: "go-board" }); console.log("constructed board: ", board); root.appendChild(board); }; main();