forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-notifications.d.ts
82 lines (66 loc) · 2.57 KB
/
angular-notifications.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Type definitions for angular-notifications
// Project: https://github.com/DerekRies/angular-notifications
// Definitions by: Tomasz Ducin <https://github.com/ducin/DefinitelyTyped>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.notifications {
interface IAnimation {
duration: number;
enabled: boolean;
}
interface ISettings {
info: IAnimation;
warning: IAnimation;
error: IAnimation;
success: IAnimation;
progress: IAnimation;
custom: IAnimation;
details: boolean;
localStorage: boolean;
html5Mode: boolean;
html5DefaultIcon: string;
}
interface INotification {
type: string;
image: string;
icon: string;
title: string;
content: string;
timestamp: string;
userData: string;
}
interface INotificationFactory extends angular.IModule {
/* ========== SETTINGS RELATED METHODS =============*/
disableHtml5Mode(): void;
disableType(notificationType: string): void;
enableHtml5Mode(): void;
enableType(notificationType: string): void;
getSettings(): ISettings;
toggleType(notificationType: string): void;
toggleHtml5Mode(): void;
requestHtml5ModePermissions(): boolean;
/* ============ QUERYING RELATED METHODS ============*/
getAll(): Array<INotification>;
getQueue(): Array<INotification>;
/* ============== NOTIFICATION METHODS ==============*/
info(title: string): INotification;
info(title: string, content: string): INotification;
info(title: string, content: string, userData: any): INotification;
error(title: string): INotification;
error(title: string, content: string): INotification;
error(title: string, content: string, userData: any): INotification;
success(title: string): INotification;
success(title: string, content: string): INotification;
success(title: string, content: string, userData: any): INotification;
warning(title: string): INotification;
warning(title: string, content: string): INotification;
warning(title: string, content: string, userData: any): INotification;
awesomeNotify(type: string, icon: string, title: string, content: string, userData: any): INotification;
notify(image: string, title: string, content: string, userData: any): INotification;
makeNotification(type: string, image: string, icon: string, title: string, content: string, userData: any): INotification;
/* ============ PERSISTENCE METHODS ============ */
save(): void;
restore(): void;
clear(): void;
}
}