TypeScript/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js

30 lines
486 B
JavaScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [assignmentCompatInterfaceWithStringIndexSignature.ts]
interface IHandler {
(e): boolean;
}
interface IHandlerMap {
[type: string]: IHandler;
}
class Foo {
public Boz(): void { }
}
function Biz(map: IHandlerMap) { }
Biz(new Foo());
//// [assignmentCompatInterfaceWithStringIndexSignature.js]
var Foo = (function () {
function Foo() {
}
Foo.prototype.Boz = function () {
};
return Foo;
})();
function Biz(map) {
}
Biz(new Foo());