title: Simplified way to use ES6's property shorthand to pass an object with typescript and avoid prefacing arguments with interface name?
body: <p>In javascript, I write a lot of functions like the following to take advantage of ES6's <a href="http://es6-features.org/#PropertyShorthand" rel="nofollow noreferrer">property shorthand</a>:</p>
  
  <pre><code>function someFunction({param1, param2}) {
    console.log(param1 + " " + param1);
  }
  
  //I call it like this:
  const param1 = "param1";
  const param2 = "param2";
  someFunction({param1, param2});
  </code></pre>
  
  <p>Here is how I'm writing this function in typescript:</p>
  
  <pre><code>function someFunction(arg: {param1: string, param2: string}) : string {
    return arg.param1 + " " + arg.param2;
  }
  </code></pre>
  
  <p>This works fine, but now I need to preface my arguments with "arg" every time in the function body and I need to give the argument a useless ("arg") name every time. Is there a way to do this in typescript where I can call these arguments directly without prefacing their interface name? And avoid naming an interface every time? Ideally I'd like to be able to do this:</p>
  
  <pre><code>function someFunction({param1: string, param2: string}) : string {
    return param1 + " " + param2;
  }
  </code></pre>
  
  <p>Much cleaner and more simple to write and still gives me all the benefits I want from typescript. Is there any way to achieve this?</p>