1 2 3 4 5 6 7 8 9 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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
//// [declarationEmitDestructuringParameterProperties.ts]
class C1 {
constructor(public [x, y, z]: string[]) {
}
}
type TupleType1 =[string, number, boolean];
class C2 {
constructor(public [x, y, z]: TupleType1) {
}
}
type ObjType1 = { x: number; y: string; z: boolean }
class C3 {
constructor(public { x, y, z }: ObjType1) {
}
}
//// [declarationEmitDestructuringParameterProperties.js]
var C1 = /** @class */ (function () {
function C1(_a) {
var x = _a[0], y = _a[1], z = _a[2];
}
return C1;
}());
var C2 = /** @class */ (function () {
function C2(_a) {
var x = _a[0], y = _a[1], z = _a[2];
}
return C2;
}());
var C3 = /** @class */ (function () {
function C3(_a) {
var x = _a.x, y = _a.y, z = _a.z;
}
return C3;
}());
//// [declarationEmitDestructuringParameterProperties.d.ts]
declare class C1 {
x: string;
y: string;
z: string;
constructor([x, y, z]: string[]);
}
type TupleType1 = [string, number, boolean];
declare class C2 {
x: string;
y: number;
z: boolean;
constructor([x, y, z]: TupleType1);
}
type ObjType1 = {
x: number;
y: string;
z: boolean;
};
declare class C3 {
x: number;
y: string;
z: boolean;
constructor({ x, y, z }: ObjType1);
}
|