Fix type errors

This commit is contained in:
ReiMerc 2023-02-10 09:16:15 +01:00
parent 5a7553f902
commit cb9f8c30c9
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
export class Throttler { export class Throttler {
private hasBeenCalledWithinTime = false; private hasBeenCalledWithinTime = false;
private lastCallFunc: (() => Promise<any>) | null = null; private lastCallFunc: (() => Promise<any>) | null = null;
private timeout: int | null = null; private timeout: number | null = null;
public constructor(private minimumTimeBetweenCall: number) {} public constructor(private minimumTimeBetweenCall: number) {}

View File

@ -38,7 +38,7 @@ async function fetchZipCode({
.catch(() => null as never); .catch(() => null as never);
} }
let currentBoundary; let currentBoundary: Array<number> | null = null;
async function fetchAndDisplayZipCode(coords: Coordinate) { async function fetchAndDisplayZipCode(coords: Coordinate) {
if (currentBoundary && if (currentBoundary &&
coords.longitude > currentBoundary[0] && coords.longitude > currentBoundary[0] &&
@ -52,7 +52,7 @@ async function fetchAndDisplayZipCode(coords: Coordinate) {
currentBoundary = response.bbox; currentBoundary = response.bbox;
displayZipCode( displayZipCode(
document.getElementById("zip-code")!, document.querySelector<HTMLParagraphElement>("#zip-code")!,
response.nr, response.nr,
response.navn, response.navn,
response.visueltcenter ? { longitude: response.visueltcenter[0], latitude: response.visueltcenter[1] } : null, response.visueltcenter ? { longitude: response.visueltcenter[0], latitude: response.visueltcenter[1] } : null,