mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
The egg.js-tests are based on the docs from Egg.js. The name is the same as the Egg.js bower project: http://bower.io/search/?q=egg.js (an npm project does not exists). And I run the tsc and npm tests.
27 lines
727 B
TypeScript
27 lines
727 B
TypeScript
/// <reference path="egg.js.d.ts" />
|
|
|
|
var egg = new Egg();
|
|
egg
|
|
.addCode("up,up,down,down,left,right,left,right,b,a", function () {
|
|
alert("Konami!");
|
|
}, "konami-code")
|
|
.addHook(function () {
|
|
console.log("Hook called for: " + this.activeEgg.keys);
|
|
console.log(this.activeEgg.metadata);
|
|
})
|
|
.listen();
|
|
|
|
var egg = new Egg("up,up,down,down,left,right,left,right,b,a", function () {
|
|
alert("Konami!");
|
|
}).listen();
|
|
|
|
// EGGSAMPLE
|
|
var egg = new Egg();
|
|
egg
|
|
.AddCode("up,up,down,down,left,right,left,right,b,a", function () {
|
|
alert("Konami!");
|
|
}, "konami-code")
|
|
.AddHook(function () {
|
|
console.log("Hook called for: " + this.activeEgg.keys);
|
|
console.log(this.activeEgg.metadata);
|
|
}).Listen(); |