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
This commit is contained in:
Brandon Ayers
2017-02-01 16:20:39 -08:00
committed by GitHub
parent dba28e9608
commit aa0f3acea5
+1 -2
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 {