|
| 1 | +//// [interfaceExtendsObjectIntersection.ts] |
| 2 | + |
| 3 | +type T1 = { a: number }; |
| 4 | +type T2 = T1 & { b: number }; |
| 5 | +type T3 = () => void; |
| 6 | +type T4 = new () => { a: number }; |
| 7 | +type T5 = number[]; |
| 8 | +type T6 = [string, number]; |
| 9 | +type T7 = { [P in 'a' | 'b' | 'c']: string }; |
| 10 | + |
| 11 | +interface I1 extends T1 { x: string } |
| 12 | +interface I2 extends T2 { x: string } |
| 13 | +interface I3 extends T3 { x: string } |
| 14 | +interface I4 extends T4 { x: string } |
| 15 | +interface I5 extends T5 { x: string } |
| 16 | +interface I6 extends T6 { x: string } |
| 17 | +interface I7 extends T7 { x: string } |
| 18 | + |
| 19 | +type Constructor<T> = new () => T; |
| 20 | +declare function Constructor<T>(): Constructor<T>; |
| 21 | + |
| 22 | +class C1 extends Constructor<I1>() { x: string } |
| 23 | +class C2 extends Constructor<I2>() { x: string } |
| 24 | +class C3 extends Constructor<I3>() { x: string } |
| 25 | +class C4 extends Constructor<I4>() { x: string } |
| 26 | +class C5 extends Constructor<I5>() { x: string } |
| 27 | +class C6 extends Constructor<I6>() { x: string } |
| 28 | +class C7 extends Constructor<I7>() { x: string } |
| 29 | + |
| 30 | +declare function fx(x: string): string; |
| 31 | +declare class CX { a: number } |
| 32 | +declare enum EX { A, B, C } |
| 33 | +declare namespace NX { export const a = 1 } |
| 34 | + |
| 35 | +type T10 = typeof fx; |
| 36 | +type T11 = typeof CX; |
| 37 | +type T12 = typeof EX; |
| 38 | +type T13 = typeof NX; |
| 39 | + |
| 40 | +interface I10 extends T10 { x: string } |
| 41 | +interface I11 extends T11 { x: string } |
| 42 | +interface I12 extends T12 { x: string } |
| 43 | +interface I13 extends T13 { x: string } |
| 44 | + |
| 45 | +type Identifiable<T> = { _id: string } & T; |
| 46 | + |
| 47 | +interface I20 extends Partial<T1> { x: string } |
| 48 | +interface I21 extends Readonly<T1> { x: string } |
| 49 | +interface I22 extends Identifiable<T1> { x: string } |
| 50 | +interface I23 extends Identifiable<T1 & { b: number}> { x: string } |
| 51 | + |
| 52 | +class C20 extends Constructor<Partial<T1>>() { x: string } |
| 53 | +class C21 extends Constructor<Readonly<T1>>() { x: string } |
| 54 | +class C22 extends Constructor<Identifiable<T1>>() { x: string } |
| 55 | +class C23 extends Constructor<Identifiable<T1 & { b: number}>>() { x: string } |
| 56 | + |
| 57 | + |
| 58 | +//// [interfaceExtendsObjectIntersection.js] |
| 59 | +var __extends = (this && this.__extends) || (function () { |
| 60 | + var extendStatics = Object.setPrototypeOf || |
| 61 | + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 62 | + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 63 | + return function (d, b) { |
| 64 | + extendStatics(d, b); |
| 65 | + function __() { this.constructor = d; } |
| 66 | + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 67 | + }; |
| 68 | +})(); |
| 69 | +var C1 = (function (_super) { |
| 70 | + __extends(C1, _super); |
| 71 | + function C1() { |
| 72 | + return _super !== null && _super.apply(this, arguments) || this; |
| 73 | + } |
| 74 | + return C1; |
| 75 | +}(Constructor())); |
| 76 | +var C2 = (function (_super) { |
| 77 | + __extends(C2, _super); |
| 78 | + function C2() { |
| 79 | + return _super !== null && _super.apply(this, arguments) || this; |
| 80 | + } |
| 81 | + return C2; |
| 82 | +}(Constructor())); |
| 83 | +var C3 = (function (_super) { |
| 84 | + __extends(C3, _super); |
| 85 | + function C3() { |
| 86 | + return _super !== null && _super.apply(this, arguments) || this; |
| 87 | + } |
| 88 | + return C3; |
| 89 | +}(Constructor())); |
| 90 | +var C4 = (function (_super) { |
| 91 | + __extends(C4, _super); |
| 92 | + function C4() { |
| 93 | + return _super !== null && _super.apply(this, arguments) || this; |
| 94 | + } |
| 95 | + return C4; |
| 96 | +}(Constructor())); |
| 97 | +var C5 = (function (_super) { |
| 98 | + __extends(C5, _super); |
| 99 | + function C5() { |
| 100 | + return _super !== null && _super.apply(this, arguments) || this; |
| 101 | + } |
| 102 | + return C5; |
| 103 | +}(Constructor())); |
| 104 | +var C6 = (function (_super) { |
| 105 | + __extends(C6, _super); |
| 106 | + function C6() { |
| 107 | + return _super !== null && _super.apply(this, arguments) || this; |
| 108 | + } |
| 109 | + return C6; |
| 110 | +}(Constructor())); |
| 111 | +var C7 = (function (_super) { |
| 112 | + __extends(C7, _super); |
| 113 | + function C7() { |
| 114 | + return _super !== null && _super.apply(this, arguments) || this; |
| 115 | + } |
| 116 | + return C7; |
| 117 | +}(Constructor())); |
| 118 | +var C20 = (function (_super) { |
| 119 | + __extends(C20, _super); |
| 120 | + function C20() { |
| 121 | + return _super !== null && _super.apply(this, arguments) || this; |
| 122 | + } |
| 123 | + return C20; |
| 124 | +}(Constructor())); |
| 125 | +var C21 = (function (_super) { |
| 126 | + __extends(C21, _super); |
| 127 | + function C21() { |
| 128 | + return _super !== null && _super.apply(this, arguments) || this; |
| 129 | + } |
| 130 | + return C21; |
| 131 | +}(Constructor())); |
| 132 | +var C22 = (function (_super) { |
| 133 | + __extends(C22, _super); |
| 134 | + function C22() { |
| 135 | + return _super !== null && _super.apply(this, arguments) || this; |
| 136 | + } |
| 137 | + return C22; |
| 138 | +}(Constructor())); |
| 139 | +var C23 = (function (_super) { |
| 140 | + __extends(C23, _super); |
| 141 | + function C23() { |
| 142 | + return _super !== null && _super.apply(this, arguments) || this; |
| 143 | + } |
| 144 | + return C23; |
| 145 | +}(Constructor())); |
0 commit comments