frontend/control: Manually assert type

This commit is contained in:
Tom Wiesing 2022-10-06 17:43:51 +02:00
parent a070ced312
commit aeceae11d5
No known key found for this signature in database
2 changed files with 1 additions and 4 deletions

View file

@ -1,3 +0,0 @@
declare interface Window {
readonly pathbuilders: {[name: string]: string}
}

View file

@ -11,7 +11,7 @@ const types: Record<string, (element: HTMLElement) => HTMLElement | string> = {
return text[text.length - 1];
},
"pathbuilders": () => {
const pathbuilders = window.pathbuilders; // read from context!
const pathbuilders: {[name: string]: string} = (window as any).pathbuilders; // must be declared globally on page!
const wrapper = document.createElement("span");
let found_one = false