title: TypeScript how to define tuple type for an empty array?
body: <p>What I'm trying to do is convert a <code>const</code> object into a <code>class</code> so that I can create <code>readonly</code> properties for example. This to ensure that the values never changes. </p>
  
  <p>In my class I'm trying to create a <code>module</code> property which should be defined, but always empty. </p>
  
  <p>I tried a number of different things:</p>
  
  <pre><code>public modules: Readonly&lt;[]&gt; = []; // Error: A tuple type element list cannot be empty.
  public readonly modules: IModule[] = []; // Disallows re-assignment, but still allows things such as push, pop etc.
  
  interface EmptyTuple {
    length: 0;
  }
  
  // Types of property 'length' are incompatible. Type 'number' is not assignable to type '0'.
  public modules: Readonly&lt;EmptyTuple&gt; = [];
  </code></pre>
  
  <p>The latest one doesn't make any sense since <code>0</code> is a number... I really have no idea what I'm doing here really so some guidance would be perfect.</p>
  
  <p>I tried looking at <a href="https://github.com/Microsoft/TypeScript/issues/13126" rel="nofollow noreferrer">https://github.com/Microsoft/TypeScript/issues/13126</a> to see if I could find some sort of answer but to no avail.</p>
  
  <p>Does anyone know how to achieve having an empty array that cannot be modified?</p>