blob: 62dd17af90b3c275c6ab8d33f5ca17a7f4b8b37b [file] [log] [blame]
Matteo Scandolo5461a7c2017-08-08 13:05:24 -07001
2/*
3 * Copyright 2017-present Open Networking Foundation
4
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8
9 * http://www.apache.org/licenses/LICENSE-2.0
10
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18
Matteo Scandolofc4b37b2017-02-02 12:18:47 -080019// Generated by typings
20// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/61fa2391a46bdd00f5b8c03f0efe8dc164e8e26c/angular-toastr/index.d.ts
21declare module 'angular-toastr' {
22// Type definitions for Angular Toastr v1.6.0
23// Project: https://github.com/Foxandxss/angular-toastr
24// Definitions by: Niko Kovačič <https://github.com/nkovacic>
25// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
26
27/// <reference types="angular" />
28
29import * as angular from 'angular';
30
31module 'angular' {
32 export namespace toastr {
33 interface IToastBaseConfig {
34 allowHtml?: boolean;
35 closeButton?: boolean;
36 closeHtml?: string;
37 extendedTimeOut?: number;
38 messageClass?: string;
39 onHidden?: Function;
40 onShown?: Function;
41 onTap?: Function;
42 progressBar?: boolean;
43 tapToDismiss?: boolean;
44 templates?: {
45 toast?: string;
46 progressbar?: string;
47 };
48 timeOut?: number;
49 titleClass?: string;
50 toastClass?: string;
51 }
52
53 interface IToastContainerConfig {
54 autoDismiss?: boolean;
55 containerId?: string;
56 maxOpened?: number;
57 newestOnTop?: boolean;
58 positionClass?: string;
59 preventDuplicates?: boolean;
60 preventOpenDuplicates?: boolean;
61 target?: string;
62 }
63
64 interface IToastConfig extends IToastBaseConfig {
65 iconClasses?: {
66 error?: string;
67 info?: string;
68 success?: string;
69 warning?: string;
70 };
71 }
72
73 interface IToastrConfig extends IToastContainerConfig, IToastConfig { }
74
75 interface IToastScope extends angular.IScope {
76 message: string;
77 options: IToastConfig;
78 title: string;
79 toastId: number;
80 toastType: string;
81 }
82
83 interface IToast {
84 el: angular.IAugmentedJQuery;
85 iconClass: string;
86 isOpened: boolean;
87 open: angular.IPromise<any>;
88 scope: IToastScope;
89 toastId: number;
90 }
91
92 interface IToastOptions extends IToastBaseConfig {
93 iconClass?: string;
94 target?: string;
95 }
96
97 interface IToastrService {
98 /**
99 * Return the number of active toasts in screen.
100 */
101 active(): number;
102 /**
103 * Remove toast from screen. If no toast is passed in, all toasts will be closed.
104 *
105 * @param {IToast} toast Optional toast object to delete
106 */
107 clear(toast?: IToast): void;
108 /**
109 * Create error toast notification message.
110 *
111 * @param {String} message Message to show on toast
112 * @param {String} title Title to show on toast
113 * @param {IToastOptions} options Override default toast options
114 */
115 error(message: string, title?: string, options?: IToastOptions): IToast;
116 /**
117 * Create info toast notification message.
118 *
119 * @param {String} message Message to show on toast
120 * @param {String} title Title to show on toast
121 * @param {IToastOptions} options Override default toast options
122 */
123 info(message: string, title?: string, options?: IToastOptions): IToast;
124 /**
125 * Create success toast notification message.
126 *
127 * @param {String} message Message to show on toast
128 * @param {String} title Title to show on toast
129 * @param {IToastOptions} options Override default toast options
130 */
131 success(message: string, title?: string, options?: IToastOptions): IToast;
132 /**
133 * Create warning toast notification message.
134 *
135 * @param {String} message Message to show on toast
136 * @param {String} title Title to show on toast
137 * @param {IToastOptions} options Override default toast options
138 */
139 warning(message: string, title?: string, options?: IToastOptions): IToast;
140 }
141 }
142}
143}