35 lines
552 B
TypeScript
35 lines
552 B
TypeScript
interface Foo {
|
|
interfaceFooMethod(): this;
|
|
interfaceFooProperty: this;
|
|
}
|
|
|
|
class Foo {
|
|
classFooProperty: this;
|
|
|
|
classFooMethod(): this {
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
interface Bar {
|
|
interfaceBarMethod(): this;
|
|
interfaceBarProperty: this;
|
|
}
|
|
|
|
class Bar extends Foo {
|
|
classBarProperty: this;
|
|
|
|
classBarMethod(): this {
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
var bar = new Bar();
|
|
bar.interfaceBarMethod().interfaceFooMethod().classBarMethod().classFooMethod();
|
|
|
|
|
|
var foo = new Foo();
|
|
|
|
foo = bar;
|