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 062c6c3af5/src/js/select2/data/ajax.js (L68)
This commit is contained in:
Brandon Ayers
2017-02-01 16:20:39 -08:00
committed by GitHub
parent dba28e9608
commit aa0f3acea5

3
select2/index.d.ts vendored
View File

@@ -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 {