title: Require optional field in certain case
body: <p>please advise.
  I have an interface:</p>
  <pre><code>export interface PermissionScope {
    type: string;
    companyId?: number | null;
  }
  </code></pre>
  <p>Later, in certain case i want to require <code>companyId</code> field be present. What is the most effective typescriptish way to do it?</p>
  <p>Appreciate.</p>