fix(@types/select2): Add missing $.fn.select2 typing

As per bottom of docs at http://select2.github.io/select2/
This commit is contained in:
Sagie Maoz
2019-02-27 17:05:29 -05:00
parent 09e840110a
commit 825dfd2e08
2 changed files with 13 additions and 0 deletions

View File

@@ -168,6 +168,14 @@ interface Select2Plugin {
(method: 'search'): JQuery;
(options: Select2Options): JQuery;
/**
* Select2 exposes its default options via the $.fn.select2.defaults
* object. Properties changed in this object (same properties configurable
* through the constructor) will take effect for every instance created
* after the change.
*/
defaults: Partial<Select2Options>;
}
interface JQuery {

View File

@@ -1,3 +1,8 @@
$.extend($.fn.select2.defaults, {
width: 'copy',
minimumInputLength: 12
});
$("#e9").select2();
$("#e2").select2({
placeholder: "Select a State",