From c11d0c91e08fcb0f8d1ae1a9ea0047b16e189507 Mon Sep 17 00:00:00 2001 From: Vincent Bortone Date: Fri, 18 Jan 2013 03:28:00 -0500 Subject: [PATCH] Initial implementation of Bootbox.js --- bootbox/bootbox-tests.ts | 1 + bootbox/bootbox.d.ts | 49 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 bootbox/bootbox-tests.ts create mode 100644 bootbox/bootbox.d.ts diff --git a/bootbox/bootbox-tests.ts b/bootbox/bootbox-tests.ts new file mode 100644 index 000000000..ced7b4bb6 --- /dev/null +++ b/bootbox/bootbox-tests.ts @@ -0,0 +1 @@ +// Tests for Bootbox \ No newline at end of file diff --git a/bootbox/bootbox.d.ts b/bootbox/bootbox.d.ts new file mode 100644 index 000000000..b56c60f45 --- /dev/null +++ b/bootbox/bootbox.d.ts @@ -0,0 +1,49 @@ +// Type definitions for Bootbox 3.0.0 +// Project: https://github.com/makeusabrew/bootbox +// Definitions by: Vincent Bortone +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +interface BootboxLocale { + OK: string; + CANCEL: string; + CONFIRM: string; +} + +interface BootboxIcons { + OK: any; + CANCEL: any; + CONFIRM: any; +} + +interface BootboxHandler { + label: string; + class: string; + callback: () => void; + callback: (result: bool) => void; + callback: (result: string) => void; +} + +interface BootboxOption { + header: string; + headerCloseButton: bool; +} + +interface BootboxStatic { + alert(message: string, customButtonText?: string, callback?: () => void): void; + confirm(message: string, cancelButtonText?: string, confirmButtonText?: string, callback?: (result: bool) => void): void; + prompt(message: string, cancelButtonText?: string, confirmButtonText?: string, callback?: (result: string) => void, defaultValue?: string): void; + dialog(message: string, handlers?: BootboxHandler[], options?: any): void; + dialog(message: string, handler?: BootboxHandler): void; + hideAll(): void; + animate(shouldAnimate: bool): void; + backdrop(backdropValue: string): void; + classes(customCssClasses: string): void; + setIcons(icons: BootboxIcons): void; + setLocale(localeName: string): void; + addLocale(localeName: string, translations: BootboxLocale) : void; +} + +declare var bootbox : BootboxStatic; \ No newline at end of file