|
| 1 | +// Type definitions for ng-notify 0.7.1 |
| 2 | +// Project: https://github.com/matowens/ng-notify |
| 3 | +// Definitions by: Nick Zamosenchuk <https://github.com/nzamosenchuk> |
| 4 | +// Definitions: https://github.com/borisyankov/DefinitelyTyped |
| 5 | +/// <reference path='../angularjs/angular.d.ts'/> |
| 6 | + |
| 7 | +declare module ngNotify { |
| 8 | + |
| 9 | + /** |
| 10 | + * Contains the options used to configure notification. |
| 11 | + */ |
| 12 | + interface IUserOptions{ |
| 13 | + type?: string; |
| 14 | + theme?: string; |
| 15 | + position?: string; |
| 16 | + duration?: number; |
| 17 | + sticky?: boolean; |
| 18 | + button?: boolean; |
| 19 | + html?: boolean; |
| 20 | + } |
| 21 | + |
| 22 | + /** |
| 23 | + * Simply and lightweight notification service for AngularJS |
| 24 | + */ |
| 25 | + interface INotifyService { |
| 26 | + |
| 27 | + /** |
| 28 | + * Allows to create a whole new set of styles for each notification type. |
| 29 | + * @param themeName The name used when setting the theme in the config object. |
| 30 | + * @param className The class used to target this theme in the stylesheet. |
| 31 | + */ |
| 32 | + addTheme(themeName:string, className:string):void; |
| 33 | + |
| 34 | + /** |
| 35 | + * Allows to create a new type of notification to use in their app. |
| 36 | + * @param typeName The name used to trigger this notification type in the set method. |
| 37 | + * @param className The class used to target this type in the stylesheet. |
| 38 | + */ |
| 39 | + addType(typeName:string, className:string):void; |
| 40 | + |
| 41 | + /** |
| 42 | + * Sets default settings for all notifications to take into account when displaying. |
| 43 | + * @param userOptions Notification configuration object |
| 44 | + */ |
| 45 | + config(userOptions: IUserOptions):void; |
| 46 | + |
| 47 | + /** |
| 48 | + * Manually dismisses any sticky notifications that may still be set. |
| 49 | + */ |
| 50 | + dismiss():void; |
| 51 | + |
| 52 | + /** |
| 53 | + * Displays a notification message. |
| 54 | + * @param message A message text to display. |
| 55 | + */ |
| 56 | + set(message: string):void; |
| 57 | + |
| 58 | + /** |
| 59 | + * Displays a notification message and sets the type for this one notification. |
| 60 | + * @param message A message text to display. |
| 61 | + * @param type The type of the notification. |
| 62 | + */ |
| 63 | + set(message: string, type: string):void; |
| 64 | + |
| 65 | + /** |
| 66 | + * displays a notification message and sets the formatting/behavioral options for this one notification. |
| 67 | + * @param message A message text to display. |
| 68 | + * @param userOptions Notification configuration object. |
| 69 | + */ |
| 70 | + set(message: string, userOptions: IUserOptions):void; |
| 71 | + } |
| 72 | +} |
0 commit comments