DefinitelyTyped/egg.js/egg.js-tests.ts
Markus Peloso 6524d47793 Add type definitions for Egg.js
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.
2015-04-30 19:53:48 +02:00

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