DefinitelyTyped/types/egg.js/egg.js-tests.ts
2017-03-24 14:27:52 -07:00

27 lines
691 B
TypeScript

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();