From e30c8706759c7a187ebdaa02498acc7e774c7a36 Mon Sep 17 00:00:00 2001 From: Blake Doss Date: Sat, 3 Oct 2015 10:46:58 -0400 Subject: [PATCH 1/2] Added ambient external module for bloodhound. --- typeahead/typeahead.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/typeahead/typeahead.d.ts b/typeahead/typeahead.d.ts index 7317aa4c7..901bd8192 100644 --- a/typeahead/typeahead.d.ts +++ b/typeahead/typeahead.d.ts @@ -411,3 +411,7 @@ declare class Bloodhound { */ public static tokenizers: Bloodhound.Tokenizers; } + +declare module "bloodhound" { + export = Bloodhound; +} From bc5a757e7111e7dfab1f96d8cbd6377c3c55a985 Mon Sep 17 00:00:00 2001 From: Blake Doss Date: Sat, 3 Oct 2015 11:00:11 -0400 Subject: [PATCH 2/2] Added prepare function to RemoteOptions interface. This method appears to have been added to Bloodhound in the 0.11.1 release that rolled out at the end of April. --- typeahead/typeahead.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/typeahead/typeahead.d.ts b/typeahead/typeahead.d.ts index 901bd8192..a8b139937 100644 --- a/typeahead/typeahead.d.ts +++ b/typeahead/typeahead.d.ts @@ -316,6 +316,19 @@ declare module Bloodhound * The ajax settings object passed to jQuery.ajax. */ ajax?: JQueryAjaxSettings; + + /** + * A function that provides a hook to allow you to prepare the settings object passed to transport + * when a request is about to be made. The function signature should be prepare(query, settings), + * where query is the query #search was called with and settings is the default settings object + * created internally by the Bloodhound instance. The prepare function should return a settings object. + * [Note: Added in 0.11.1] + * + * @param query The query #search was called with. + * @param settings The default settings object created internally by Bloodhound. + * @returns A JqueryAjaxSettings object. + */ + prepare?: (query: string, settings: JQueryAjaxSettings) => JQueryAjaxSettings; } /**