jQuery-Autocomplete
jQuery-Autocomplete copied to clipboard
Types definition for suggestions possibly out of date
I can see that suggestions allow AutocompleteSuggestion[] only
interface AutocompleteResponse {
suggestions: AutocompleteSuggestion[];
}
The docs state that suggestions can also be an array of strings like so:
{
"query": "Unit",
"suggestions": ["United Arab Emirates", "United Kingdom", "United States"]
}
I think it should therefore be:
interface AutocompleteResponse {
suggestions: AutocompleteSuggestion[] | string[];
}
Am I correct? Is this something that could be added? If so, I would be happy to, if someone could point me to the right place to add them (would it be in this project or somewhere in DefinitelyTyped)? It seems like types have been written for jQuery-Autocomplete 1.2.25 and I'm looking at 1.4.10.
You are correct. Typings can be updated. In terms of versioning, I think it is safe to use typings with 1.4, contract has not changed.
Feel free to update: https://github.com/devbridge/jQuery-Autocomplete/blob/master/typings/jquery-autocomplete/jquery.autocomplete.d.ts and issue PR.