title: How would I define this object in typescript?
body: <p>I have the following object that who's structure I'd like to enforce. </p>
  
  <pre><code>{
      'username': {
        required: 'Please enter your username.'
      },
      'passwordGroup': {
        ocMatchFields: 'Passwords do not match'
      },
      'passwordGroup.password': {
        required: 'Please enter your password'
      },
      'passwordGroup.confirmPassword': {
        required: 'Please confirm your password'
      }
  }
  </code></pre>
  
  <p>It'll never be more deeply nested than shown and the values will always be strings but there can be any number of "fields". fields in this case are first level keys. username, passwordGroup etc.</p>
  
  <p>I had come across something that describes an object as <code>{ [key: string]: boolean }</code> which makes me believe its possible.</p>
  
  <p>I can think of how to represent it as a collection since that would be an array of objects but I'm not sure how I'd be able to describe it as a nested object structure.</p>