Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/webroot/rsrc/externals/javelin/docs/Base.js
12242 views
1
/**
2
* @requires javelin-install
3
* @javelin
4
*/
5
6
/**
7
* This is not a real class, but @{function:JX.install} provides several methods
8
* which exist on all Javelin classes. This class documents those methods.
9
*
10
* @task events Builtin Events
11
*/
12
JX.install('Base', {
13
members : {
14
15
/**
16
* Invoke a class event, notifying all listeners. You must declare the
17
* events your class invokes when you install it; see @{function:JX.install}
18
* for documentation. Any arguments you provide will be passed to listener
19
* callbacks.
20
*
21
* @param string Event type, must be declared when class is
22
* installed.
23
* @param ... Zero or more arguments.
24
*
25
* @return @{JX.Event} Event object which was dispatched.
26
* @task events
27
*/
28
invoke : function(type, more) {
29
// <docstub only, see JX.install()> //
30
},
31
32
/**
33
* Listen for events emitted by this object instance. You can also use
34
* the static flavor of this method to listen to events emitted by any
35
* instance of this object.
36
*
37
* See also @{method:JX.Stratcom.listen}.
38
*
39
* @param string Type of event to listen for.
40
* @param function Function to call when this event occurs.
41
* @return object A reference to the installed listener. You can later
42
* remove the listener by calling this object's remove()
43
* method.
44
* @task events
45
*/
46
listen : function(type, callback) {
47
// <docstub only, see JX.install()> //
48
}
49
50
},
51
statics : {
52
53
/**
54
* Static listen interface for listening to events produced by any instance
55
* of this class. See @{method:listen} for documentation.
56
*
57
* @param string Type of event to listen for.
58
* @param function Function to call when this event occurs.
59
* @return object A reference to the installed listener. You can later
60
* remove the listener by calling this object's remove()
61
* method.
62
* @task events
63
*/
64
listen : function(type, callback) {
65
// <docstub only, see JX.install()> //
66
}
67
68
}
69
});
70
71