title: What do square brackets mean where a field should be in typescript?
body: <p>I came across this line in three.d.ts:</p>
  
  <pre><code>dispatchEvent(event: { type: string; [attachment: string]: any; }): void;
  </code></pre>
  
  <p>and was wondering what it meant.<br />
  I understand that this would mean a function called dispatchEvent which takes an argument of a type with a member type but I am not sure what:</p>
  
  <pre><code>[attachment: string]: any;
  </code></pre>
  
  <p>means.</p>