The autocomplete
function returns an object that implements the IAutocomplete
interface, which has two properties:
The function accepts two parameters:
status
: A number representing the status of the response.result
: An array of strings representing the autocomplete results.
In case of an error occurring during the execution of the function, an error message is logged to the console and an object with a status of 400
and undefined
results is returned.
export interface IAutocomplete {
status?: number;
result?: string[];
}