39 lines
575 B
Plaintext
39 lines
575 B
Plaintext
=== tests/cases/conformance/types/thisType/fluentInterfaces.ts ===
|
|
interface A {
|
|
>A : A
|
|
|
|
foo(): this;
|
|
>foo : () => this
|
|
}
|
|
interface B extends A {
|
|
>B : B
|
|
>A : A
|
|
|
|
bar(): this;
|
|
>bar : () => this
|
|
}
|
|
interface C extends B {
|
|
>C : C
|
|
>B : B
|
|
|
|
baz(): this;
|
|
>baz : () => this
|
|
}
|
|
var c: C;
|
|
>c : C
|
|
>C : C
|
|
|
|
var z = c.foo().bar().baz(); // Fluent pattern
|
|
>z : C
|
|
>c.foo().bar().baz() : C
|
|
>c.foo().bar().baz : () => C
|
|
>c.foo().bar() : C
|
|
>c.foo().bar : () => C
|
|
>c.foo() : C
|
|
>c.foo : () => C
|
|
>c : C
|
|
>foo : () => C
|
|
>bar : () => C
|
|
>baz : () => C
|
|
|