Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types definition for suggestions possibly out of date #785

Open
kahlan88 opened this issue Feb 26, 2020 · 1 comment
Open

Types definition for suggestions possibly out of date #785

kahlan88 opened this issue Feb 26, 2020 · 1 comment

Comments

@kahlan88
Copy link

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.

@tkirda
Copy link
Member

tkirda commented Mar 9, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants