33 lines
873 B
TypeScript
33 lines
873 B
TypeScript
//// [declarationEmitDestructuringOptionalBindingParametersInOverloads.ts]
|
|
|
|
function foo([x, y, z] ?: [string, number, boolean]);
|
|
function foo(...rest: any[]) {
|
|
}
|
|
|
|
function foo2( { x, y, z }?: { x: string; y: number; z: boolean });
|
|
function foo2(...rest: any[]) {
|
|
|
|
}
|
|
|
|
//// [declarationEmitDestructuringOptionalBindingParametersInOverloads.js]
|
|
function foo() {
|
|
var rest = [];
|
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
rest[_i - 0] = arguments[_i];
|
|
}
|
|
}
|
|
function foo2() {
|
|
var rest = [];
|
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
rest[_i - 0] = arguments[_i];
|
|
}
|
|
}
|
|
|
|
|
|
//// [declarationEmitDestructuringOptionalBindingParametersInOverloads.d.ts]
|
|
declare function foo([x, y, z]?: [string, number, boolean]): any;
|
|
declare function foo2({x, y, z}?: {
|
|
x: string;
|
|
y: number;
|
|
z: boolean;
|
|
}): any;
|