title: How to create a type for file type `Record<string, File>` in zod
body: <p>I use input <code>type=&quot;file&quot;</code> and instead of saving data in <code>FileData</code> I use just plain object and created a type for it: <code>Record&lt;string, File&gt;</code>. It works well, but when I try to create a validator with <code>zod</code> – I don't get how to create the same type for it.</p>
  <p>The usage:</p>
  <pre><code>import { object as zodObject, string, number } from 'zod';
  import { useValidators } from '../some';
  
  const useValidation = () =&gt; {
    const { createResolver } = useValidators();
    
    return {
      resolver: createResolver(
        zodObject({
          name: string(),
          price: number(),
          files: ???,  
        })
      ),
    };
  }; 
  </code></pre>
  <p>The doc is quite excessive, but I could not find any example for my case: <a href="https://github.com/colinhacks/zod" rel="nofollow noreferrer">https://github.com/colinhacks/zod</a></p>
  <p>The usage of input:</p>
  <pre><code>
  const App = () =&gt; {
    const [files, setFiles] = useState&lt;Record&lt;string, File&gt;&gt;({}); 
  
    return (
      &lt;input 
        type=&quot;file&quot; 
        onChange={event =&gt; {
          const files = event.target.files;
          const newFiles: Record&lt;string, File&gt; = {};
          const keys = Object.keys(files);
          
          for(let i = 0; i &lt; keys.length; i++) {
            const file = newFiles[key];
            newFiles[file.name] = file;
          }
  
          setFiles(newFiles);
        }}
      /&gt;
  
    )
  
  }
  
  </code></pre>