Matteo Scandolo | fc4b37b | 2017-02-02 12:18:47 -0800 | [diff] [blame] | 1 | // Generated by typings |
| 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/61fa2391a46bdd00f5b8c03f0efe8dc164e8e26c/angular-toastr/index.d.ts |
| 3 | declare module 'angular-toastr' { |
| 4 | // Type definitions for Angular Toastr v1.6.0 |
| 5 | // Project: https://github.com/Foxandxss/angular-toastr |
| 6 | // Definitions by: Niko Kovačič <https://github.com/nkovacic> |
| 7 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped |
| 8 | |
| 9 | /// <reference types="angular" /> |
| 10 | |
| 11 | import * as angular from 'angular'; |
| 12 | |
| 13 | module 'angular' { |
| 14 | export namespace toastr { |
| 15 | interface IToastBaseConfig { |
| 16 | allowHtml?: boolean; |
| 17 | closeButton?: boolean; |
| 18 | closeHtml?: string; |
| 19 | extendedTimeOut?: number; |
| 20 | messageClass?: string; |
| 21 | onHidden?: Function; |
| 22 | onShown?: Function; |
| 23 | onTap?: Function; |
| 24 | progressBar?: boolean; |
| 25 | tapToDismiss?: boolean; |
| 26 | templates?: { |
| 27 | toast?: string; |
| 28 | progressbar?: string; |
| 29 | }; |
| 30 | timeOut?: number; |
| 31 | titleClass?: string; |
| 32 | toastClass?: string; |
| 33 | } |
| 34 | |
| 35 | interface IToastContainerConfig { |
| 36 | autoDismiss?: boolean; |
| 37 | containerId?: string; |
| 38 | maxOpened?: number; |
| 39 | newestOnTop?: boolean; |
| 40 | positionClass?: string; |
| 41 | preventDuplicates?: boolean; |
| 42 | preventOpenDuplicates?: boolean; |
| 43 | target?: string; |
| 44 | } |
| 45 | |
| 46 | interface IToastConfig extends IToastBaseConfig { |
| 47 | iconClasses?: { |
| 48 | error?: string; |
| 49 | info?: string; |
| 50 | success?: string; |
| 51 | warning?: string; |
| 52 | }; |
| 53 | } |
| 54 | |
| 55 | interface IToastrConfig extends IToastContainerConfig, IToastConfig { } |
| 56 | |
| 57 | interface IToastScope extends angular.IScope { |
| 58 | message: string; |
| 59 | options: IToastConfig; |
| 60 | title: string; |
| 61 | toastId: number; |
| 62 | toastType: string; |
| 63 | } |
| 64 | |
| 65 | interface IToast { |
| 66 | el: angular.IAugmentedJQuery; |
| 67 | iconClass: string; |
| 68 | isOpened: boolean; |
| 69 | open: angular.IPromise<any>; |
| 70 | scope: IToastScope; |
| 71 | toastId: number; |
| 72 | } |
| 73 | |
| 74 | interface IToastOptions extends IToastBaseConfig { |
| 75 | iconClass?: string; |
| 76 | target?: string; |
| 77 | } |
| 78 | |
| 79 | interface IToastrService { |
| 80 | /** |
| 81 | * Return the number of active toasts in screen. |
| 82 | */ |
| 83 | active(): number; |
| 84 | /** |
| 85 | * Remove toast from screen. If no toast is passed in, all toasts will be closed. |
| 86 | * |
| 87 | * @param {IToast} toast Optional toast object to delete |
| 88 | */ |
| 89 | clear(toast?: IToast): void; |
| 90 | /** |
| 91 | * Create error toast notification message. |
| 92 | * |
| 93 | * @param {String} message Message to show on toast |
| 94 | * @param {String} title Title to show on toast |
| 95 | * @param {IToastOptions} options Override default toast options |
| 96 | */ |
| 97 | error(message: string, title?: string, options?: IToastOptions): IToast; |
| 98 | /** |
| 99 | * Create info toast notification message. |
| 100 | * |
| 101 | * @param {String} message Message to show on toast |
| 102 | * @param {String} title Title to show on toast |
| 103 | * @param {IToastOptions} options Override default toast options |
| 104 | */ |
| 105 | info(message: string, title?: string, options?: IToastOptions): IToast; |
| 106 | /** |
| 107 | * Create success toast notification message. |
| 108 | * |
| 109 | * @param {String} message Message to show on toast |
| 110 | * @param {String} title Title to show on toast |
| 111 | * @param {IToastOptions} options Override default toast options |
| 112 | */ |
| 113 | success(message: string, title?: string, options?: IToastOptions): IToast; |
| 114 | /** |
| 115 | * Create warning toast notification message. |
| 116 | * |
| 117 | * @param {String} message Message to show on toast |
| 118 | * @param {String} title Title to show on toast |
| 119 | * @param {IToastOptions} options Override default toast options |
| 120 | */ |
| 121 | warning(message: string, title?: string, options?: IToastOptions): IToast; |
| 122 | } |
| 123 | } |
| 124 | } |
| 125 | } |