2014-07-13 01:04:16 +02:00
|
|
|
//// [interfaceSubtyping.ts]
|
|
|
|
interface iface {
|
|
|
|
foo(): void;
|
|
|
|
}
|
|
|
|
class Camera implements iface{
|
|
|
|
constructor (public str: string) {
|
|
|
|
}
|
|
|
|
foo() { return "s"; }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//// [interfaceSubtyping.js]
|
|
|
|
var Camera = (function () {
|
|
|
|
function Camera(str) {
|
|
|
|
this.str = str;
|
|
|
|
}
|
2015-02-07 05:03:24 +01:00
|
|
|
Camera.prototype.foo = function () { return "s"; };
|
2014-07-13 01:04:16 +02:00
|
|
|
return Camera;
|
|
|
|
})();
|