From a2bea849fc25a3ced75595461ea96b3b29c96e62 Mon Sep 17 00:00:00 2001 From: Tomas Kirda Date: Fri, 7 Jun 2013 18:38:50 -0500 Subject: [PATCH] Create TypeScript definition file. --- src/jquery.autocomplete.d.ts | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/jquery.autocomplete.d.ts diff --git a/src/jquery.autocomplete.d.ts b/src/jquery.autocomplete.d.ts new file mode 100644 index 0000000..83b0947 --- /dev/null +++ b/src/jquery.autocomplete.d.ts @@ -0,0 +1,40 @@ + +interface JQueryAutocompleteOptions { + serviceUrl?: string; + lookup?: AutocompleteSuggestion[]; + lookupFilter? (suggestion: AutocompleteSuggestion, query: string, queryLowercase: string): any; + onSelect? (suggestion: AutocompleteSuggestion): void; + minChars: number; + maxHeight: number; + deferRequestBy?: number; + width?: number; + params?: Object; + formatResult? (suggestion: AutocompleteSuggestion, currentValue: string): string; + delimiter?: any; + zIndex?: number; + type?: string; + noCache?: bool; + onSearchStart? (query: string): void; + onSearchComplete? (query: string): void; + tabDisabled?: bool; + paramName?: string; + transformResult? (response: any, originalQuery: string): AutocompleteSuggestion[]; + autoSelectFirst?: bool; + appendTo: any; + dataType: string; +} + +interface AutocompleteSuggestion { + value: string; + data: any; +} + +interface AutocompleteInstance { + setOptions(options: JQueryAutocompleteOptions): void; + clear(): void; + clearCache(): void; + disable(): void; + enable(): void; + hide(): void; + dispose(): void; +}