forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-notify.d.ts
126 lines (103 loc) · 3.81 KB
/
angular-notify.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// Type definitions for angular-notify 2.5.0
// Project: https://github.com/cgross/angular-notify
// Definitions by: Suwato <https://github.com/Suwato/DefinitelyTyped>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../angularjs/angular.d.ts" />
declare namespace angular.cgNotify {
interface INotifyService {
/**
* The notify function can either be passed a string or an object.
* This function will return an object with a close() method and a message property.
* @param message
*/
(message:string):INotify;
/**
* When passing an object, the object parameters can be:
* @param option
*/
(option:{
/**
* Required. The message to show.
*/
message : string;
/**
* Optional. A custom template for the UI of the message.
*/
templateUrl? : string;
/**
* Optional. A list of custom CSS classes to apply to the message element.
*/
classes? : string;
/**
* Optional. A string containing any valid Angular HTML which will be shown instead of the regular message text.
* The string must contain one root element like all valid Angular HTML templates (so wrap everything in a <span>).
*/
messageTemplate? : string;
/**
* Optional. A valid Angular scope object. The scope of the template will be created by calling $new() on this scope.
*/
$scope? : ng.IScope;
/**
* Optional. Currently center and right are the only acceptable values.
*/
position? : string;
/**
* Optional. The duration (in milliseconds) of the message. A duration of 0 will prevent the message from closing automatically.
*/
duration? : number;
/**
* Optional. Element that contains each notification. Defaults to document.body.
*/
container? : any;
}):INotify;
/**
* Call config to set the default configuration options for angular-notify.
* The following options may be specified in the given object:
* @param option
*/
config(option:{
/**
* The default duration (in milliseconds) of each message. A duration of 0 will prevent messages from closing automatically.
*/
duration? : number;
/**
* The Y pixel value where messages will be shown.
*/
startTop? : number;
/**
* The number of pixels that should be reserved between messages vertically.
*/
verticalSpacing? : number;
/**
* The default message template.
*/
templateUrl? : string;
/**
* The default position of each message. Currently only center and right are the supported values.
*/
position? : string;
/**
* The default element that contains each notification. Defaults to document.body.
*/
container? : any;
/**
* The maximum number of total notifications that can be visible at one time. Older notifications will be closed when the maximum is reached.
*/
maximumOpen? : number;
}):void;
/**
* Closes all currently open notifications.
*/
closeAll():void;
}
interface INotify{
/**
* The message to show.
*/
message:string;
/**
* Close this open notifications.
*/
close():void;
}
}