title: Typescript nested type mapping
body: <p>I'm trying to handle model validation in typescript.
  I'd like to be able to capture the nested types of the validation definition.</p>
  
  <p>For example, I want to be able to create the validator like this.</p>
  
  <pre><code>const validateUser = createValidator({
    name: {
      first: {
        value: "First"
      },
      last: {
        value: "Last"
      }
    },
    age: {
      value: 32
    },
    hasOnboarded: {
      value: false
    }
  });
  </code></pre>
  
  <p>This would create a validateUser function that takes a model of the specified
  type and validates its types.</p>
  
  <p>I'd like to be able to capture the type so that validateUser knows to accept,
  objects that conform to the interface.</p>
  
  <pre><code>type ValidateUser = typeof validateUser;
  </code></pre>
  
  <p>Should be type</p>
  
  <pre><code>(
    model: {
      name: {
        first: string,
        last: string
      },
      age: number,
      hasOnboarded: boolean
    }
  ) =&gt; boolean
  </code></pre>
  
  <p>Is this possible in TypeScript?</p>