- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
interface F1 {
a: number;
a2: boolean;
}
interface F2 {
b: string;
b2: number;
}
type t = F1 & F2 & { c: number };
interface t2 extends F1, F2 {
c: number;
}
type tt = { a: boolean };
type tt2 = { b: number };
type tt3 = { c: string };
type r = tt & tt2 & tt3;
function main() {
const f1: F1 = { a: 10.0, a2: true };
print(f1.a, f1.a2);
const f2: F2 = { b: "Hello1", b2: 20.0 };
print(f2.b, f2.b2);
const a: t = { a: 10.0, a2: true, b: "Hello", b2: 20.0, c: 30.0 };
print(a.a, a.a2, a.b, a.b2);
const b: t2 = { a: 10.0, a2: true, b: "Hello", b2: 20.0, c: 30.0 };
print(b.a, b.a2, b.b, b.b2, b.c);
const c: r = { a: true, b: 10.0, c: "Hello" };
print(c.a, c.b, c.c);
print("done.");
}
я вам тут conjunctions наговнокодил.... а нужен дампик?