diff --git a/bootstrap-switch/bootstrap-switch-tests.ts b/bootstrap-switch/bootstrap-switch-tests.ts index 17bc0fd561..539399a78e 100644 --- a/bootstrap-switch/bootstrap-switch-tests.ts +++ b/bootstrap-switch/bootstrap-switch-tests.ts @@ -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()); diff --git a/bootstrap-switch/index.d.ts b/bootstrap-switch/index.d.ts index 302e4f8735..670c50c73c 100644 --- a/bootstrap-switch/index.d.ts +++ b/bootstrap-switch/index.d.ts @@ -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;