diff --git a/script/gallery.ts b/script/gallery.ts index fb0ea66..43fe933 100644 --- a/script/gallery.ts +++ b/script/gallery.ts @@ -174,7 +174,7 @@ function sortFiltersUses(e: Event) { function setup() { - function inputs(id: string) { + function inputs(id: string): Boxes { let iter = document.getElementById(id)!.getElementsByTagName('input'); return new Set(Array.from(iter)); } diff --git a/script/single.ts b/script/single.ts index 0623093..87195ae 100644 --- a/script/single.ts +++ b/script/single.ts @@ -4,7 +4,7 @@ let mainlink: HTMLAnchorElement; let altButtons: HTMLInputElement[]; let skipAll: HTMLInputElement; -let opened = new Set; +let opened: Set = new Set; function openCW(id: string | null, caption: HTMLElement | null, focusLink = false) { @@ -51,8 +51,7 @@ function setImage(id: string | null, mainlink.href = href; } -function activateButton(button: HTMLInputElement, - doPush = true) { +function activateButton(button: HTMLInputElement, doPush = true): void { setImage(button.id, button.value, button.dataset.link!, button.dataset.warning!); @@ -60,7 +59,7 @@ function activateButton(button: HTMLInputElement, if (doPush) history.pushState(null, '', '#' + button.id); } -function useFragment(firstLoad = false) { +function useFragment(firstLoad = false): void { let button = altButtons[0]; let frag = decodeURIComponent(location.hash).replace(/^#/, '');