title: Representing UNO out parameters in definitions
body: <p>The UNO API supports <code>inout</code> and <code>out</code> parameters -- a variable is passed into a function, the function modifies the variable, and the modified variable is then available outside the function.</p>
  
  <p>Javascript doesn't support this type of parameter call, so the Automation bridge <a href="https://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Bridge/Return_Values" rel="nofollow noreferrer">enables a workaround</a> -- passing in an array; the element at index <code>0</code> is modified, and can be retrieved outside the function:</p>
  
  <pre><code>// for inout parameters
  let inout = ['input value'];
  obj.func(inout);
  console.log(inout[0]); //could print 'new value'
  </code></pre>
  
  <p>For <code>inout</code> parameters, since an initial value is expected, the function could be declared with a tuple type:</p>
  
  <pre><code>declare interface Obj {
      func(inout: [string]): void;
  }
  </code></pre>
  
  <p>However, an <code>out</code> parameter doesn't need an initial value:</p>
  
  <pre><code>// Javascript
  
  let out = [];
  obj.func1(out);
  console.log(out[0]); // could print 'new value'
  </code></pre>
  
  <p>AFAIK there is no way to represent the empty tuple type, and an empty array is incompatible with the tuple type. If I declare the function argument with a tuple type, I cannot pass in an empty array:</p>
  
  <pre><code>// Typescript
  
  declare interface Obj {
      func1(out: [string]): void;
  }
  let out = [];
  obj.func1(out); 
  // Argument of type 'any[]' is not assignable to parameter of type '[string]'.
  //  Property '0' is missing in type 'any[]'.
  </code></pre>
  
  <p><a href="http://www.typescriptlang.org/play/index.html#src=declare%20interface%20Obj%20%7B%0D%0A%20%20%20%20func1(out%3A%20%5Bstring%5D)%3A%20void%3B%0D%0A%7D%0D%0Alet%20out%20%3D%20%5B%5D%3B%0D%0Alet%20obj%3A%20Obj%3B%0D%0Aobj.func1(out)%3B%0D%0A" rel="nofollow noreferrer">link</a></p>
  
  <p>There are two hacks I could use:</p>
  
  <ol>
  <li><p>either subvert the type system using <code>any</code>:</p>
  
  <pre><code>let out: [string] = [] as any;
  </code></pre></li>
  <li><p>or use an initialized array:</p>
  
  <pre><code>let out: [string] = [''];
  </code></pre></li>
  </ol>
  
  <p><strong>Is there any less "hacky" way to do this?</strong></p>