2015-02-03 00:30:33 +01:00
|
|
|
//// [interfaceExtendingClass2.ts]
|
|
|
|
class Foo {
|
|
|
|
x: string;
|
|
|
|
y() { }
|
|
|
|
get Z() {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
[x: string]: Object;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface I2 extends Foo { // error
|
|
|
|
a: {
|
|
|
|
toString: () => {
|
|
|
|
return 1;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
//// [interfaceExtendingClass2.js]
|
|
|
|
var Foo = (function () {
|
|
|
|
function Foo() {
|
|
|
|
}
|
2015-02-07 03:45:09 +01:00
|
|
|
Foo.prototype.y = function () { };
|
2015-02-03 00:30:33 +01:00
|
|
|
Object.defineProperty(Foo.prototype, "Z", {
|
|
|
|
get: function () {
|
|
|
|
return 1;
|
|
|
|
},
|
|
|
|
enumerable: true,
|
|
|
|
configurable: true
|
|
|
|
});
|
|
|
|
return Foo;
|
|
|
|
})();
|
|
|
|
return 1;
|
|
|
|
;
|