title: How to use yup's object.shape with typescript?
body: <p>I'm currently converting a piece of code to TypeScript and running into a few type issues with <code>yup</code> types. I've tried multiple ways and referenced <code>yup</code>'s documentation on TypeScript support to tackle this issue to no avail.</p>
  <p><a href="https://github.com/jquense/yup/blob/master/docs/typescript.md" rel="noreferrer">https://github.com/jquense/yup/blob/master/docs/typescript.md</a></p>
  <p>Here is a sample of my code:</p>
  <pre><code>import { object, Asserts, string } from 'yup';
  
  interface BaseBootstrapSchema {  
    APPLICATION_NAME: string;
    LOG_PATH: string;
  }
  
  const bootstrapValidationSchema = object&lt;BaseBootstrapSchema&gt;().shape({ // error 1 here
    LOG_PATH: string().required(&quot;The 'LOG_PATH' ENV variable is required&quot;),
    APPLICATION_NAME: string().required(&quot;The 'APPLICATION_NAME' ENV variable is required&quot;),
  });
  
  interface BootstrapSchema extends Asserts&lt;typeof bootstrapValidationSchema&gt; {}
  
  module.exports = (schema: BootstrapSchema) =&gt;
    new Promise((resolve, reject) =&gt;
      schema
        .validate(process.env, { abortEarly: false }) // error 2 here
        .then(() =&gt; resolve(true))
        .catch((error: any) =&gt; {
          if (error.errors.length &gt; 1) {
            reject(new Error(`${error.message},\n${error.errors.join(',\n')}`));
          } else {
            reject(new Error(error.message));
          }
        })
    );
  </code></pre>
  <p>I get the following errors:</p>
  <p><strong>Error 1:</strong></p>
  <p>Type 'BaseBootstrapSchema' does not satisfy the constraint 'Record&lt;string, AnySchema&lt;any, any, any&gt; | Reference | Lazy&lt;any, any&gt;&gt;'.
  Index signature is missing in type 'BaseBootstrapSchema'.</p>
  <p><strong>Error 2:</strong></p>
  <p>Property 'validate' does not exist on type 'BootstrapSchema'.</p>
  <p>I'm tried a few ways to rectify this issue but none really work.</p>
  <p>Assistance appreciated.</p>