title: How do I limit values to keys of an object?
body: <p>Assume I have the following:</p>
  
  <pre><code>export const ContentType = {
      Json: "application/json",
      Urlencoded: "application/x-www-form-urlencoded",
      Multipart: "multipart/form-data",
  };
  
  export interface RequestOptions {
      contentType: string,
  }
  
  const defaultOptions: Partial&lt;RequestOptions&gt; = {
      contentType: ContentType.Json,
  };
  </code></pre>
  
  <p>How would I go about restricting <code>contentType</code> so that only keys declared in <code>ContentType</code> are used?</p>