27 lines
480 B
TypeScript
27 lines
480 B
TypeScript
//// [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());
|