type signatures

This commit is contained in:
rhiannon morris 2024-07-07 20:19:24 +02:00
parent 97660781a7
commit fe338b2f3f
2 changed files with 4 additions and 5 deletions

View file

@ -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));
}

View file

@ -4,7 +4,7 @@ let mainlink: HTMLAnchorElement;
let altButtons: HTMLInputElement[];
let skipAll: HTMLInputElement;
let opened = new Set;
let opened: Set<string> = 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(/^#/, '');