title: Typescript. Can I define conditional types?
body: <p>Imagine I have the following type</p>
  <pre><code>type BannerConditions = {
      publication_id?: number;
      product_id?: number;
      resource?: string;
      type: string;
    };
  </code></pre>
  <p>But publication_id and product_id can only exist if resource exists. Can I define it somehow?</p>