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

Added val methods #2538

Merged
merged 1 commit into from Jul 21, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions typeahead/typeahead-tests.ts
Expand Up @@ -85,3 +85,8 @@ $('.example-countries .typeahead').typeahead({
prefetch: '../data/countries.json',
limit: 10
});

module valueTest {
var value: string = $('foo').typeahead('val');
$('foo').typeahead('val', value);
}
11 changes: 11 additions & 0 deletions typeahead/typeahead.d.ts
Expand Up @@ -60,6 +60,17 @@ interface JQuery {
* @param dataset Array of datasets
*/
typeahead(options: Twitter.Typeahead.Options, dataset: Twitter.Typeahead.Dataset): JQuery;

/**
* Returns the current value of the typeahead. The value is the text the user has entered into the input element.
*/
typeahead(methodName: 'val'): string;
typeahead(methodName: string): string;

/**
* Sets the value of the typeahead. This should be used in place of jQuery#val.
*/
typeahead(methodName: 'val', value: string): JQuery;
}

declare module Twitter.Typeahead {
Expand Down