From ff27231d6a927a3c6e7a13245bc425cf3002e306 Mon Sep 17 00:00:00 2001 From: "John M. Baughman" Date: Mon, 26 Oct 2015 16:12:55 -0600 Subject: [PATCH 1/5] Fix methods in Datetimepicker interface. --- .../bootstrap.v3.datetimepicker.d.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts index 228b7537f7..2b06605b2f 100644 --- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts +++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Bootstrap datetimepicker v3 +// Type definitions for Bootstrap datetimepicker v3 // Project: http://eonasdan.github.io/bootstrap-datetimepicker // Definitions by: Jesica N. Fera // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -55,13 +55,14 @@ declare module BootstrapV3DatetimePicker { } interface Datetimepicker { - setDate(date: any): void; - setMinDate(date: any): void; - setMaxDate(date: any): void; + date(): void; + date(date: any): void; + minDate(date: any): void; + maxDate(date: any): void; show(): void; disable(): void; enable(): void; - getDate(): void; + options(options: any): void; } } From 7f3b49dc344ea77967799f77417578f8bf347e39 Mon Sep 17 00:00:00 2001 From: "John M. Baughman" Date: Mon, 26 Oct 2015 16:17:16 -0600 Subject: [PATCH 2/5] Update version info. --- bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts index 2b06605b2f..ac3ec7a57b 100644 --- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts +++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /** - * bootstrap-datetimepicker.js 3.0.0 Copyright (c) 2014 Jonathan Peterson + * bootstrap-datetimepicker.js 4.15.35 Copyright (c) 2015 Jonathan Peterson * Available via the MIT license. * see: http://eonasdan.github.io/bootstrap-datetimepicker or https://github.com/Eonasdan/bootstrap-datetimepicker for details. */ From 593e5b90814758d529e68eb473f2264f6b708cb9 Mon Sep 17 00:00:00 2001 From: johnmbaughman Date: Mon, 26 Oct 2015 22:54:20 -0600 Subject: [PATCH 3/5] Initial upload Tests pass. --- bootstrap-switch/bootstrap-switch-tests.ts | 25 +++++ bootstrap-switch/bootstrap-switch.d.ts | 102 +++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 bootstrap-switch/bootstrap-switch-tests.ts create mode 100644 bootstrap-switch/bootstrap-switch.d.ts diff --git a/bootstrap-switch/bootstrap-switch-tests.ts b/bootstrap-switch/bootstrap-switch-tests.ts new file mode 100644 index 0000000000..542f71ebd4 --- /dev/null +++ b/bootstrap-switch/bootstrap-switch-tests.ts @@ -0,0 +1,25 @@ +/// +/// + +function test_cases() { + $('#switch').bootstrapSwitch(); + + $('#switch').bootstrapSwitch({ + state: false + }); + + $('#switch').bootstrapSwitch({ + state: false, + disabled: true + }); + + //var mySwitch = $('#switch').get(0); + //mySwitch.toggleAnimate(); + + $('#switch').bootstrapSwitch('state', true, true); + + + $('#switch').on('switchChange.bootstrapSwitch', (event) => { + console.log($(event.target).val()); + }); +} \ No newline at end of file diff --git a/bootstrap-switch/bootstrap-switch.d.ts b/bootstrap-switch/bootstrap-switch.d.ts new file mode 100644 index 0000000000..f562f9ef07 --- /dev/null +++ b/bootstrap-switch/bootstrap-switch.d.ts @@ -0,0 +1,102 @@ +// Type definitions for Bootstrap Switch +// Project: http://www.bootstrap-switch.org/ +// Definitions by: John M. Baughman +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** + * bootstrap-switch - v3.3.2 Copyright (c) 2012-2013 Mattia Larentis + * Available via the Apache license. + * see: http://www.bootstrap-switch.org/ or https://github.com/nostalgiaz/bootstrap-switch for details. + */ + +/// + +declare module BootstrapSwitch { + interface BootstrapSwitchChangeEventObject extends JQueryEventObject { + state: boolean + } + + interface BootstrapSwitchEventObject extends JQueryEventObject { } + + interface BootstrapSwitchOptions { + state?: boolean; + size?: string; + animate?: boolean; + disabled?: boolean; + readonly?: boolean; + indeterminate?: boolean; + invers?: boolean; + radioAllOff?: boolean; + onColor?: string; + offColor?: string; + onText?: string; + offText?: string; + labelText?: string; + handleWidth?: string; + labelWidth?: string; + baseClass?: string; + wrapperClass?: string; + onInit?: any; + onSwitchChange?: any; + } + + interface Switch { + toggleAnimate(): JQuery; + toggleDisabled(): JQuery; + toggleReadonly(): JQuery; + toggleIndeterminate(): JQuery; + toggleInverse(): JQuery; + destroy(): JQuery; + + state(): boolean; + state(value: any): JQuery; + state(value: any, skip: boolean): JQuery; + toggleState(skip?: boolean): JQuery; + radioAllOff(): boolean; + radioAllOff(state: boolean): JQuery; + size(): string; + size(size: string): JQuery; + animate(): boolean; + animate(state: boolean): JQuery; + disabled(): boolean; + disabled(state: boolean): JQuery; + toggleDisabled(): JQuery; + readonly(): boolean; + readonly(state: boolean): JQuery; + toggleReadOnly(): JQuery; + onColor(): string; + onColor(color: string): JQuery; + offColor(): string; + offColor(color: string): JQuery; + onText(): string; + onText(text: string): JQuery; + offText(): string; + offText(text: string): JQuery; + labelText(): string; + labelText(text: string): JQuery; + baseClass(): string; + baseClass(text: string): JQuery; + wrapperClass(): string; + wrapperClass(text: string): JQuery; + } +} + +interface JQuery { + bootstrapSwitch(): JQuery; + bootstrapSwitch(options: BootstrapSwitch.BootstrapSwitchOptions): JQuery; + bootstrapSwitch(method: string): JQuery; + bootstrapSwitch(method: string, param: any): JQuery; + bootstrapSwitch(method: string, param1: any, param2: any): JQuery; + + off(events: "init.bootstrapSwitch", selector?: string, handler?: (eventobject: BootstrapSwitch.BootstrapSwitchEventObject) => any): JQuery; + off(events: "init.bootstrapSwitch", handler?: (eventobject: BootstrapSwitch.BootstrapSwitchEventObject) => any): JQuery; + + off(events: "switchChange.bootstrapSwitch", selector?: string, handler?: (eventobject: BootstrapSwitch.BootstrapSwitchChangeEventObject) => any): JQuery; + off(events: "switchChange.bootstrapSwitch", handler?: (eventobject: BootstrapSwitch.BootstrapSwitchChangeEventObject) => any): JQuery; + + on(events: "init.bootstrapSwitch", selector?: string, handler?: (eventobject: BootstrapSwitch.BootstrapSwitchEventObject) => any): JQuery; + on(events: "init.bootstrapSwitch", handler?: (eventobject: BootstrapSwitch.BootstrapSwitchEventObject) => any): JQuery; + + on(events: "switchChange.bootstrapSwitch", selector?: string, handler?: (eventobject: BootstrapSwitch.BootstrapSwitchChangeEventObject) => any): JQuery; + on(events: "switchChange.bootstrapSwitch", handler?: (eventobject: BootstrapSwitch.BootstrapSwitchChangeEventObject) => any): JQuery; +} \ No newline at end of file From a041f88c20a04217ca6ca4a2a6d474176e6dc22c Mon Sep 17 00:00:00 2001 From: johnmbaughman Date: Mon, 26 Oct 2015 23:10:51 -0600 Subject: [PATCH 4/5] Revert "Fix methods in Datetimepicker interface." This reverts commit ff27231d6a927a3c6e7a13245bc425cf3002e306. --- .../bootstrap.v3.datetimepicker.d.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts index ac3ec7a57b..a279d0b6f2 100644 --- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts +++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Bootstrap datetimepicker v3 +// Type definitions for Bootstrap datetimepicker v3 // Project: http://eonasdan.github.io/bootstrap-datetimepicker // Definitions by: Jesica N. Fera // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -55,14 +55,13 @@ declare module BootstrapV3DatetimePicker { } interface Datetimepicker { - date(): void; - date(date: any): void; - minDate(date: any): void; - maxDate(date: any): void; + setDate(date: any): void; + setMinDate(date: any): void; + setMaxDate(date: any): void; show(): void; disable(): void; enable(): void; - options(options: any): void; + getDate(): void; } } From 921593e9a9e27512c3ffde1d49d80d2af6df8e61 Mon Sep 17 00:00:00 2001 From: johnmbaughman Date: Mon, 26 Oct 2015 23:10:59 -0600 Subject: [PATCH 5/5] Revert "Update version info." This reverts commit 7f3b49dc344ea77967799f77417578f8bf347e39. --- bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts index a279d0b6f2..228b7537f7 100644 --- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts +++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /** - * bootstrap-datetimepicker.js 4.15.35 Copyright (c) 2015 Jonathan Peterson + * bootstrap-datetimepicker.js 3.0.0 Copyright (c) 2014 Jonathan Peterson * Available via the MIT license. * see: http://eonasdan.github.io/bootstrap-datetimepicker or https://github.com/Eonasdan/bootstrap-datetimepicker for details. */