1
+ // Type definitions for Egg.js 0.0.1
2
+ // Project: https://github.com/mikeflynn/egg.js/
3
+ // Definitions by: Markus Peloso <https://github.com/ToastHawaii/>
4
+ // Definitions: https://github.com/borisyankov/DefinitelyTyped
5
+
6
+ declare var egg : Egg ;
7
+
8
+ declare module "egg" {
9
+ export = egg ;
10
+ }
11
+
12
+ /**
13
+ * Egg.js is a simple JS library that has no prerequisites and allows you to easily add web easter
14
+ * eggs by watching the user's key strokes.
15
+ */
16
+ declare class Egg {
17
+ /**
18
+ * Egg.js is a simple JS library that has no prerequisites and allows you to easily add web easter
19
+ * eggs by watching the user's key strokes.
20
+ */
21
+ constructor ( ) ;
22
+ /**
23
+ * Egg.js is a simple JS library that has no prerequisites and allows you to easily add web easter
24
+ * eggs by watching the user's key strokes.
25
+ * @param keySequence You need to pass it the character sequence to trigger the easter egg
26
+ * callback (which can either be in plain English or JavaScript key codes).
27
+ * @param fn A function to trigger when it happens.
28
+ */
29
+ constructor ( keySequence : string , fn : ( ) => any ) ;
30
+ /**
31
+ * Egg.js is a simple JS library that has no prerequisites and allows you to easily add web easter
32
+ * eggs by watching the user's key strokes.
33
+ * @param keySequence You need to pass it the character sequence to trigger the easter egg
34
+ * callback (which can either be in plain English or JavaScript key codes).
35
+ * @param fn A function to trigger when it happens.
36
+ * @param metadata An optional set of metadata.
37
+ */
38
+ constructor ( keySequence : string , fn : ( ) => any , metadata : any ) ;
39
+ /**
40
+ * Use to add in your easter eggs.
41
+ * @param keySequence You need to pass it the character sequence to trigger the easter egg
42
+ * callback (which can either be in plain English or JavaScript key codes).
43
+ * @param fn A function to trigger when it happens.
44
+ */
45
+ AddCode ( keySequence : string , fn : ( ) => any ) : Egg ;
46
+ /**
47
+ * Use to add in your easter eggs.
48
+ * @param keySequence You need to pass it the character sequence to trigger the easter egg
49
+ * callback (which can either be in plain English or JavaScript key codes).
50
+ * @param fn A function to trigger when it happens.
51
+ * @param metadata An optional set of metadata.
52
+ */
53
+ AddCode ( keySequence : string , fn : ( ) => any , metadata : any ) : Egg ;
54
+ /**
55
+ * Add a hook, that will run after any egg code is triggered. You could use it to fire a Google
56
+ * Analytics event or send out a tweet that someone finally found your easter egg. Hooks get
57
+ * access to the whole Egg.js object so you can pull information about the easter egg that
58
+ * fired via this.activeEgg.
59
+ * @param fn A function to trigger when it happens.
60
+ */
61
+ AddHook ( fn : ( ) => any ) : Egg ;
62
+ /**
63
+ * Start listening to key codes.
64
+ */
65
+ Listen ( ) : Egg ;
66
+ /**
67
+ * Use to add in your easter eggs.
68
+ * @param keySequence You need to pass it the character sequence to trigger the easter egg
69
+ * callback (which can either be in plain English or JavaScript key codes).
70
+ * @param fn A function to trigger when it happens.
71
+ */
72
+ addCode ( keySequence : string , fn : ( ) => any ) : Egg ;
73
+ /**
74
+ * Use to add in your easter eggs.
75
+ * @param keySequence You need to pass it the character sequence to trigger the easter egg
76
+ * callback (which can either be in plain English or JavaScript key codes).
77
+ * @param fn A function to trigger when it happens.
78
+ * @param metadata An optional set of metadata.
79
+ */
80
+ addCode ( keySequence : string , fn : ( ) => any , metadata : any ) : Egg ;
81
+ /**
82
+ * Add a hook, that will run after any egg code is triggered. You could use it to fire a Google
83
+ * Analytics event or send out a tweet that someone finally found your easter egg. Hooks get
84
+ * access to the whole Egg.js object so you can pull information about the easter egg that
85
+ * fired via this.activeEgg.
86
+ * @param fn A function to trigger when it happens.
87
+ */
88
+ addHook ( fn : ( ) => any ) : Egg ;
89
+ /**
90
+ * Start listening to key codes.
91
+ */
92
+ listen ( ) : Egg ;
93
+ }
0 commit comments