diff --git a/ngbootbox.d.ts b/ngbootbox.d.ts new file mode 100644 index 000000000..99d4941d1 --- /dev/null +++ b/ngbootbox.d.ts @@ -0,0 +1,38 @@ +// Type definitions for ngbootbox +// Project: https://github.com/eriktufvesson/ngBootbox +// Definitions by: Sam Saint-Pettersen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +interface IBootboxDialog { + title?: string; + message?: string; + templateUrl?: string; + locale?: string; + callback?: () => any; + onEscape?: () => any | boolean; + show?: boolean; + backdrop?: boolean; + closeButton?: boolean; + animate?: boolean; + className?: string; + size?: string; + buttons?: BootboxButtonMap; +} + +interface IBootboxService { + alert(msg: string): Promise; + confirm(msg: string): Promise; + prompt(msg: string): Promise; + customDialog(options: IBootboxDialog): void; + setDefaults(options: BootboxDefaultOptions): void; + hideAll(): void; + + addLocale(name: string, values: BootboxLocaleValues): void; + removeLocale(name: string): void; + setLocale(name: string): void; +} + +declare var $ngBootbox: IBootboxService;