Basarat Syed
2014-07-21 11:48:03 +10:00
parent 14c95efd6d
commit 735c0f1d5d
2 changed files with 16 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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 {