Merge pull request #28876 from AlexStacker/patch-1

[@types/select2] Update missing methods parameter types
This commit is contained in:
Jesse Trinity
2018-09-19 15:28:52 -07:00
committed by GitHub
2 changed files with 20 additions and 0 deletions
+16
View File
@@ -112,6 +112,14 @@ interface Select2Plugin {
* @params triggerChange Should a change event be triggered
*/
(method: 'data', value: any, triggerChange?: boolean): any;
/**
* Whether it is open
*/
(method: 'opened'): boolean;
/**
* Whether it is in focus
*/
(method: 'isFocused'): boolean;
/**
* Reverts changes to DOM done by Select2. Any selection done via Select2 will be preserved.
*/
@@ -124,11 +132,19 @@ interface Select2Plugin {
* Closes the dropdown
*/
(method: 'close'): JQuery;
/**
* Disables Select2
*/
(method: 'disable'): JQuery;
/**
* Enables or disables Select2 and its underlying form component
* @param value True if it should be enabled false if it should be disabled
*/
(method: 'enable', value?: boolean): JQuery;
/**
* Enable its focus
*/
(method: 'focus'): JQuery;
/**
* Toggles readonly mode on Select2 and its underlying form component
* @param value True if it should be readonly false if it should be read write
+4
View File
@@ -220,6 +220,10 @@ $("#e8").select2("data");
$("#e8").select2("data", { id: "CA", text: "Califoria" });
$("#e8").select2("destroy");
$("#e8").select2("open");
$("#e8").select2("opened");
$("#e8").select2("focus");
$("#e8").select2("isFocused");
$("#e8").select2("disable");
$("#e8").select2("enable", false);
$("#e8").select2("readonly", false);
$("#e8").select2('container');