@types/typeahead.js
Advanced tools
Comparing version 0.11.2 to 0.11.3
@@ -19,9 +19,13 @@ // Type definitions for typeahead.js 0.11.1 | ||
/** | ||
* For a given input[type="text"], enables typeahead functionality. | ||
* | ||
* @param options Options hash that's used for configuration | ||
* @param dataset At least one dataset is required | ||
* @param datasets Rest of the datasets. | ||
*/ | ||
typeahead<T>(options: Twitter.Typeahead.Options, dataset: Twitter.Typeahead.Dataset<T>, ...datasets: Twitter.Typeahead.Dataset<T>[]): JQuery; | ||
* For a given input[type="text"], enables typeahead functionality. | ||
* | ||
* @param options Options hash that's used for configuration | ||
* @param dataset At least one dataset is required | ||
* @param datasets Rest of the datasets. | ||
*/ | ||
typeahead<T>( | ||
options: Twitter.Typeahead.Options, | ||
dataset: Twitter.Typeahead.Dataset<T>, | ||
...datasets: Twitter.Typeahead.Dataset<T>[] | ||
): JQuery; | ||
@@ -34,3 +38,3 @@ /** | ||
*/ | ||
typeahead(methodName: 'val'): string; | ||
typeahead(methodName: "val"): string; | ||
@@ -50,3 +54,3 @@ /** | ||
*/ | ||
typeahead(methodName: 'val', val: string): JQuery; | ||
typeahead(methodName: "val", val: string): JQuery; | ||
@@ -66,3 +70,3 @@ /** | ||
*/ | ||
typeahead(methodName: 'open'): JQuery; | ||
typeahead(methodName: "open"): JQuery; | ||
@@ -74,3 +78,3 @@ /** | ||
*/ | ||
typeahead(methodName: 'close'): JQuery; | ||
typeahead(methodName: "close"): JQuery; | ||
@@ -82,3 +86,3 @@ /** | ||
*/ | ||
typeahead(methodName: 'destroy'): JQuery; | ||
typeahead(methodName: "destroy"): JQuery; | ||
@@ -99,3 +103,3 @@ /** | ||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. | ||
*/ | ||
*/ | ||
on(events: "typeahead:active", data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; | ||
@@ -110,3 +114,7 @@ | ||
*/ | ||
on(events: "typeahead:active", selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:active", | ||
selector: string, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -121,3 +129,8 @@ /** | ||
*/ | ||
on(events: "typeahead:active", selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:active", | ||
selector: string, | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -138,3 +151,3 @@ /** | ||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. | ||
*/ | ||
*/ | ||
on(events: "typeahead:idle", data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; | ||
@@ -149,3 +162,7 @@ | ||
*/ | ||
on(events: "typeahead:idle", selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:idle", | ||
selector: string, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -160,3 +177,8 @@ /** | ||
*/ | ||
on(events: "typeahead:idle", selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:idle", | ||
selector: string, | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -177,3 +199,3 @@ /** | ||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. | ||
*/ | ||
*/ | ||
on(events: "typeahead:open", data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; | ||
@@ -188,3 +210,7 @@ | ||
*/ | ||
on(events: "typeahead:open", selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:open", | ||
selector: string, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -199,3 +225,8 @@ /** | ||
*/ | ||
on(events: "typeahead:open", selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:open", | ||
selector: string, | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -216,3 +247,3 @@ /** | ||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. | ||
*/ | ||
*/ | ||
on(events: "typeahead:close", data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; | ||
@@ -227,3 +258,7 @@ | ||
*/ | ||
on(events: "typeahead:close", selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:close", | ||
selector: string, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -238,3 +273,8 @@ /** | ||
*/ | ||
on(events: "typeahead:close", selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:close", | ||
selector: string, | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -255,3 +295,3 @@ /** | ||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. | ||
*/ | ||
*/ | ||
on(events: "typeahead:change", data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; | ||
@@ -266,3 +306,7 @@ | ||
*/ | ||
on(events: "typeahead:change", selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:change", | ||
selector: string, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -277,3 +321,8 @@ /** | ||
*/ | ||
on(events: "typeahead:change", selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:change", | ||
selector: string, | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -294,3 +343,3 @@ /** | ||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. | ||
*/ | ||
*/ | ||
on(events: "typeahead:render", data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; | ||
@@ -305,3 +354,7 @@ | ||
*/ | ||
on(events: "typeahead:render", selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:render", | ||
selector: string, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -316,3 +369,8 @@ /** | ||
*/ | ||
on(events: "typeahead:render", selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:render", | ||
selector: string, | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -333,3 +391,3 @@ /** | ||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. | ||
*/ | ||
*/ | ||
on(events: "typeahead:select", data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; | ||
@@ -344,3 +402,7 @@ | ||
*/ | ||
on(events: "typeahead:select", selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:select", | ||
selector: string, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -355,3 +417,8 @@ /** | ||
*/ | ||
on(events: "typeahead:select", selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:select", | ||
selector: string, | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -372,4 +439,8 @@ /** | ||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. | ||
*/ | ||
on(events: "typeahead:autocomplete", data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; | ||
*/ | ||
on( | ||
events: "typeahead:autocomplete", | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...args: any[]) => any, | ||
): JQuery; | ||
@@ -383,3 +454,7 @@ /** | ||
*/ | ||
on(events: "typeahead:autocomplete", selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:autocomplete", | ||
selector: string, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -394,3 +469,8 @@ /** | ||
*/ | ||
on(events: "typeahead:autocomplete", selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:autocomplete", | ||
selector: string, | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -411,4 +491,8 @@ /** | ||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. | ||
*/ | ||
on(events: "typeahead:cursorchange", data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; | ||
*/ | ||
on( | ||
events: "typeahead:cursorchange", | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...args: any[]) => any, | ||
): JQuery; | ||
@@ -422,3 +506,7 @@ /** | ||
*/ | ||
on(events: "typeahead:cursorchange", selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:cursorchange", | ||
selector: string, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -433,3 +521,8 @@ /** | ||
*/ | ||
on(events: "typeahead:cursorchange", selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:cursorchange", | ||
selector: string, | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -450,4 +543,8 @@ /** | ||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. | ||
*/ | ||
on(events: "typeahead:asyncrequest", data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; | ||
*/ | ||
on( | ||
events: "typeahead:asyncrequest", | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...args: any[]) => any, | ||
): JQuery; | ||
@@ -461,3 +558,7 @@ /** | ||
*/ | ||
on(events: "typeahead:asyncrequest", selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:asyncrequest", | ||
selector: string, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -472,3 +573,8 @@ /** | ||
*/ | ||
on(events: "typeahead:asyncrequest", selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:asyncrequest", | ||
selector: string, | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -489,4 +595,8 @@ /** | ||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. | ||
*/ | ||
on(events: "typeahead:asynccancel", data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; | ||
*/ | ||
on( | ||
events: "typeahead:asynccancel", | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...args: any[]) => any, | ||
): JQuery; | ||
@@ -500,3 +610,7 @@ /** | ||
*/ | ||
on(events: "typeahead:asynccancel", selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:asynccancel", | ||
selector: string, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -511,3 +625,8 @@ /** | ||
*/ | ||
on(events: "typeahead:asynccancel", selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:asynccancel", | ||
selector: string, | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -528,4 +647,8 @@ /** | ||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. | ||
*/ | ||
on(events: "typeahead:asyncreceive", data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; | ||
*/ | ||
on( | ||
events: "typeahead:asyncreceive", | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...args: any[]) => any, | ||
): JQuery; | ||
@@ -539,3 +662,7 @@ /** | ||
*/ | ||
on(events: "typeahead:asyncreceive", selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:asyncreceive", | ||
selector: string, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -550,3 +677,8 @@ /** | ||
*/ | ||
on(events: "typeahead:asyncreceive", selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; | ||
on( | ||
events: "typeahead:asyncreceive", | ||
selector: string, | ||
data: any, | ||
handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any, | ||
): JQuery; | ||
@@ -749,17 +881,17 @@ /** | ||
/** | ||
* If true, when suggestions are rendered, pattern matches for the current query in text nodes will be wrapped in a strong element with its class set to {{classNames.highlight}}. | ||
* Defaults to false. | ||
*/ | ||
* If true, when suggestions are rendered, pattern matches for the current query in text nodes will be wrapped in a strong element with its class set to {{classNames.highlight}}. | ||
* Defaults to false. | ||
*/ | ||
highlight?: boolean | undefined; | ||
/** | ||
* If false, the typeahead will not show a hint. | ||
* Defaults to true. | ||
*/ | ||
* If false, the typeahead will not show a hint. | ||
* Defaults to true. | ||
*/ | ||
hint?: boolean | undefined; | ||
/** | ||
* The minimum character length needed before suggestions start getting rendered. | ||
* Defaults to 1. | ||
*/ | ||
* The minimum character length needed before suggestions start getting rendered. | ||
* Defaults to 1. | ||
*/ | ||
minLength?: number | undefined; | ||
@@ -774,12 +906,12 @@ | ||
/** | ||
* A typeahead is composed of one or more datasets. When an end-user | ||
* modifies the value of a typeahead, each dataset will attempt to render | ||
* suggestions for the new value. | ||
* For most use cases, one dataset should suffice. It's only in the scenario | ||
* where you want rendered suggestions to be grouped based on some sort of | ||
* categorical relationship that you'd need to use multiple datasets. For | ||
* example, on twitter.com, the search typeahead groups results into recent | ||
* searches, trends, and accounts that would be a great use case for using | ||
* multiple datasets. | ||
*/ | ||
* A typeahead is composed of one or more datasets. When an end-user | ||
* modifies the value of a typeahead, each dataset will attempt to render | ||
* suggestions for the new value. | ||
* For most use cases, one dataset should suffice. It's only in the scenario | ||
* where you want rendered suggestions to be grouped based on some sort of | ||
* categorical relationship that you'd need to use multiple datasets. For | ||
* example, on twitter.com, the search typeahead groups results into recent | ||
* searches, trends, and accounts that would be a great use case for using | ||
* multiple datasets. | ||
*/ | ||
interface Dataset<T> { | ||
@@ -794,3 +926,5 @@ /** | ||
*/ | ||
source: Bloodhound<T> | ((query: string, syncResults: (result: T[]) => void, asyncResults?: (result: T[]) => void) => void); | ||
source: | ||
| Bloodhound<T> | ||
| ((query: string, syncResults: (result: T[]) => void, asyncResults?: (result: T[]) => void) => void); | ||
@@ -806,12 +940,12 @@ /** | ||
/** | ||
* The name of the dataset. | ||
* This will be appended to {{classNames.dataset}} - to form the class name of the containing DOM element. | ||
* Must only consist of underscores, dashes, letters (a-z), and numbers. | ||
* Defaults to a random number. | ||
*/ | ||
* The name of the dataset. | ||
* This will be appended to {{classNames.dataset}} - to form the class name of the containing DOM element. | ||
* Must only consist of underscores, dashes, letters (a-z), and numbers. | ||
* Defaults to a random number. | ||
*/ | ||
name?: string | undefined; | ||
/** | ||
* The max number of suggestions to be displayed. Defaults to 5. | ||
*/ | ||
* The max number of suggestions to be displayed. Defaults to 5. | ||
*/ | ||
limit?: number | undefined; | ||
@@ -874,3 +1008,3 @@ | ||
* Defaults to the value of display wrapped in a div tag i.e. <div>{{value}}</div>. | ||
*/ | ||
*/ | ||
suggestion?: ((suggestion: T) => string) | undefined; | ||
@@ -1115,10 +1249,9 @@ } | ||
* DEPRECATED: transform the remote response before the Bloodhound instance operates on it. | ||
* */ | ||
*/ | ||
filter?: ((response: T) => T) | undefined; | ||
} | ||
/** | ||
* Build-in tokenization methods. | ||
*/ | ||
* Build-in tokenization methods. | ||
*/ | ||
interface Tokenizers { | ||
@@ -1234,3 +1367,3 @@ /** | ||
/**@Types/typeahead | ||
/** | ||
* Clears the internal search index that's powered by local, prefetch, and #add. | ||
@@ -1237,0 +1370,0 @@ */ |
{ | ||
"name": "@types/typeahead.js", | ||
"version": "0.11.2", | ||
"version": "0.11.3", | ||
"description": "TypeScript definitions for typeahead.js", | ||
@@ -30,4 +30,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/typeahead.js", | ||
}, | ||
"typesPublisherContentHash": "1c531dc9125c511692013f860dc258d8539ec35829f9ef8dd78e3b9bd42bd2eb", | ||
"typesPublisherContentHash": "a340ff38bf6ff569d02f11cd64874a0c1f3e13dc22530fd64fdb70c4b13646b1", | ||
"typeScriptVersion": "4.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Sat, 29 Apr 2023 04:03:47 GMT | ||
* Last updated: Tue, 12 Sep 2023 12:34:57 GMT | ||
* Dependencies: [@types/jquery](https://npmjs.com/package/@types/jquery) | ||
@@ -14,0 +14,0 @@ * Global values: `Bloodhound` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66616
1210