Added explicit types for several functions

This commit is contained in:
KoloMl 2024-08-28 03:11:27 +04:00
parent 583856d6e8
commit 76213ed169

View file

@ -30,7 +30,7 @@ function removeSelected() {
if (selected) selected.classList.remove('autocomplete__item--selected');
}
function isSearchField(targetInput: HTMLElement) {
function isSearchField(targetInput: HTMLElement): boolean {
return targetInput && targetInput.dataset.acMode === 'search';
}
@ -81,7 +81,7 @@ function changeSelected(firstOrLast: Element | null, current: Element | null, si
}
}
function isSelectionOutsideCurrentTerm() {
function isSelectionOutsideCurrentTerm(): boolean {
if (!inputField || !selectedTerm) return true;
if (inputField.selectionStart === null || inputField.selectionEnd === null) return true;