web: Add definitions to let things compile

This commit is contained in:
Daniel Jacobs 2024-07-17 16:50:57 -04:00 committed by Nathan Adams
parent e19e088c28
commit 78d2a85237
3 changed files with 16 additions and 4 deletions

View File

@ -1,6 +1,17 @@
interface Error {
avmStack?: string;
}
module "tsx-dom-types" {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface HTMLAttributes {
autocapitalize?: string;
autocorrect?: string;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface SVGAttributes {
d?: string;
}
}
interface SVGSVGElement {
xmlns?: string;
scale?: string | number;

View File

@ -225,7 +225,8 @@ export class RufflePlayer extends HTMLElement {
super();
this.shadow = this.attachShadow({ mode: "open" });
this.shadow.appendChild(ruffleShadowTemplate.content.cloneNode(true));
console.log(ruffleShadowTemplate);
this.shadow.appendChild(ruffleShadowTemplate.cloneNode(true));
this.dynamicStyles = this.shadow.getElementById(
"dynamic-styles",

View File

@ -493,7 +493,7 @@ const shortcutModifier = navigator.userAgent.includes("Mac OS X")
? "Command"
: "Ctrl";
export const ruffleShadowTemplate = (
<template>
<>
<style>
{ css }
</style>
@ -605,5 +605,5 @@ export const ruffleShadowTemplate = (
<div id="context-menu-overlay" class="hidden">
<ul id="context-menu"></ul>
</div>
</template>
) as HTMLTemplateElement;
</>
);