refactored entry autocomplete into TypeScript