From 18c72814a9f5a38ae8732321b140898b169ce75c Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 2 Sep 2024 09:32:50 -0400 Subject: [PATCH] Annotate return values --- assets/js/utils/suggestions.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/assets/js/utils/suggestions.ts b/assets/js/utils/suggestions.ts index 416546a7..fb810be3 100644 --- a/assets/js/utils/suggestions.ts +++ b/assets/js/utils/suggestions.ts @@ -107,14 +107,14 @@ export class SuggestionsPopup { } selectNext() { - return this.changeSelection(1); + this.changeSelection(1); } selectPrevious() { - return this.changeSelection(-1); + this.changeSelection(-1); } - showForField(targetElement: HTMLElement): SuggestionsPopup { + showForField(targetElement: HTMLElement) { this.container.style.position = 'absolute'; this.container.style.left = `${targetElement.offsetLeft}px`; @@ -127,8 +127,6 @@ export class SuggestionsPopup { this.container.style.top = `${topPosition}px`; document.body.appendChild(this.container); - - return this; } onItemSelected(callback: (event: CustomEvent) => void) { @@ -138,7 +136,7 @@ export class SuggestionsPopup { const cachedSuggestions = new Map>(); -export async function fetchSuggestions(endpoint: string, targetTerm: string) { +export async function fetchSuggestions(endpoint: string, targetTerm: string): Promise { const normalizedTerm = targetTerm.trim().toLowerCase(); if (cachedSuggestions.has(normalizedTerm)) {