|
| 1 | +//// [destructuringInFunctionType.ts] |
| 2 | + |
| 3 | +interface a { a } |
| 4 | +interface b { b } |
| 5 | +interface c { c } |
| 6 | + |
| 7 | +type T1 = ([a, b, c]); |
| 8 | +type F1 = ([a, b, c]) => void; |
| 9 | + |
| 10 | +type T2 = ({ a }); |
| 11 | +type F2 = ({ a }) => void; |
| 12 | + |
| 13 | +type T3 = ([{ a: b }, { b: a }]); |
| 14 | +type F3 = ([{ a: b }, { b: a }]) => void; |
| 15 | + |
| 16 | +type T4 = ([{ a: [b, c] }]); |
| 17 | +type F4 = ([{ a: [b, c] }]) => void; |
| 18 | + |
| 19 | +type C1 = new ([{ a: [b, c] }]) => void; |
| 20 | + |
| 21 | +var v1 = ([a, b, c]) => "hello"; |
| 22 | +var v2: ([a, b, c]) => string; |
| 23 | + |
| 24 | + |
| 25 | +//// [destructuringInFunctionType.js] |
| 26 | +var v1 = function (_a) { |
| 27 | + var a = _a[0], b = _a[1], c = _a[2]; |
| 28 | + return "hello"; |
| 29 | +}; |
| 30 | +var v2; |
| 31 | + |
| 32 | + |
| 33 | +//// [destructuringInFunctionType.d.ts] |
| 34 | +interface a { |
| 35 | + a: any; |
| 36 | +} |
| 37 | +interface b { |
| 38 | + b: any; |
| 39 | +} |
| 40 | +interface c { |
| 41 | + c: any; |
| 42 | +} |
| 43 | +declare type T1 = ([a, b, c]); |
| 44 | +declare type F1 = ([a, b, c]) => void; |
| 45 | +declare type T2 = ({ |
| 46 | + a; |
| 47 | +}); |
| 48 | +declare type F2 = ({a}) => void; |
| 49 | +declare type T3 = ([{ |
| 50 | + a: b; |
| 51 | +}, { |
| 52 | + b: a; |
| 53 | +}]); |
| 54 | +declare type F3 = ([{a: b}, {b: a}]) => void; |
| 55 | +declare type T4 = ([{ |
| 56 | + a: [b, c]; |
| 57 | +}]); |
| 58 | +declare type F4 = ([{a: [b, c]}]) => void; |
| 59 | +declare type C1 = new ([{a: [b, c]}]) => void; |
| 60 | +declare var v1: ([a, b, c]: [any, any, any]) => string; |
| 61 | +declare var v2: ([a, b, c]) => string; |
0 commit comments