title: Typescript recursive object type
body: <p>I want to define a <code>type</code>/<code>interface</code> that is able to contain properties of the same type as itself.</p>
  <p><strong>For Example:</strong></p>
  <pre><code>    type TMessagesFormat = { [key: string]: string };
      
      interface TMessages {
        messages: TMessagesFormat;
      }
      
      interface TGroupMessages {
        messages?: TMessagesFormat;
        controls: { [key: string]: TMessages | TGroupMessages }
      }
      
      let groupMessages: TGroupMessages = {
        controls: {
          username: { messages: {required: 'Username required'} }
        }
      }
      
      let messages: TGroupMessages = {
        controls: {
          username: { messages: { required: 'Username required' } },
          passwordGroup: {
            messages: { nomatch: 'Passwords doesn\'t match' },
            controls: {
              password: { messages: { required: 'Password required' } }
            }
          }
        }
      };
  </code></pre>
  <p>Type checking works fine for username and passwordGroup, but e.g controls in passwordGroup can be anything and TS compiler doesn't complain. In fact if I put <code>controls: 'whatever'</code> property (string shouldn't be a valid type) inside <code>username</code> object literal, code still compiles without any warning or error. Is this possible and how? Thanks!</p>