From aa0f3acea5765170b6f50a33fb1effcbb5268bee Mon Sep 17 00:00:00 2001 From: Brandon Ayers Date: Wed, 1 Feb 2017 16:20:39 -0800 Subject: [PATCH] Update AjaxFunction interface The interface was incorrectly defined making it impossible in typescript to use the transport function defined inside the ajax option. Select2 calls the transport function with 3 parameters: 1. The JQueryAjaxSettings object 2. A success callback to notify select2 of a successful response 3. A failure callback to notify select2 of a failed response See https://github.com/select2/select2/blob/062c6c3af5f0f39794c34c0a343a3857e587cc97/src/js/select2/data/ajax.js#L68 --- select2/index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/select2/index.d.ts b/select2/index.d.ts index 2f6fea9063..82b8dfbcf5 100644 --- a/select2/index.d.ts +++ b/select2/index.d.ts @@ -14,8 +14,7 @@ interface Select2QueryOptions { } interface AjaxFunction { - (settings: JQueryAjaxSettings): JQueryXHR; - (url: string, settings?: JQueryAjaxSettings): JQueryXHR; + (settings: JQueryAjaxSettings, success?: (data: any) => null, failure?: () => null): JQueryXHR; } interface Select2AjaxOptions {