Merge pull request #13521 from Nebual/bootstrap-switch-return-types

[bootstrap-switch]: Update return types for non-JQuery methods
This commit is contained in:
Horiuchi_H
2016-12-27 18:14:24 +09:00
committed by GitHub
2 changed files with 5 additions and 0 deletions
@@ -18,6 +18,9 @@ function test_cases() {
$('#switch').bootstrapSwitch('state', true, true);
$('#switch').bootstrapSwitch('state') === true;
$('#switch').bootstrapSwitch('onText') === 'test';
$('#switch').on('switchChange.bootstrapSwitch', (event) => {
console.log($(event.target).val());
+2
View File
@@ -84,6 +84,8 @@ declare namespace BootstrapSwitch {
interface JQuery {
bootstrapSwitch(): JQuery;
bootstrapSwitch(options: BootstrapSwitch.BootstrapSwitchOptions): JQuery;
bootstrapSwitch(method: 'state' | 'radioAllOff' | 'animate' | 'disabled' | 'readonly'): boolean;
bootstrapSwitch(method: 'size' | 'onColor' | 'offColor' | 'onText' | 'offText' | 'labelText' | 'baseClass' | 'wrapperClass'): string;
bootstrapSwitch(method: string): JQuery;
bootstrapSwitch(method: string, param: any): JQuery;
bootstrapSwitch(method: string, param1: any, param2: any): JQuery;