title: TypeScript - Named arguments?
body: <p>In <strong>C#</strong>, it is possible to invoke a given method with named arguments:</p>
  
  <p><code>myObject.SetSize(width: 100, height: 100);</code></p>
  
  <p>They primarily seem to exist for catering to optional parameters, but... They also drastically improve readability of method call sites. It also protects you from incorrect parameter specification.</p>
  
  <p>From what I have been able to gather, if I wish to benefit from 'declarative call sites' in <strong>TypeScript</strong> I'm best off using 'argument objects' based on a given interface.</p>
  
  <pre><code>interface SizeArguments {
    width: number;
    height: number;
  }
  
  export class MyClass {
  
    setSize(args: SizeArguments) {
      /* Set size... */
    }
  }
  
  new MyClass().setSize({ width: 100, height: 100 });
  </code></pre>
  
  <p>Works for me! But that's still quite a lot of work for something so trivial in C#. Is this approach the best I can do right now? Or am I overseeing something fundamentally?</p>