mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
Added val methods
- ref https://github.com/twitter/typeahead.js/blob/master/doc/jquery_typeahead.md#api
This commit is contained in:
@@ -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
typeahead/typeahead.d.ts
vendored
11
typeahead/typeahead.d.ts
vendored
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user