title: Can I define a Typescript function parameter to have a type of boolean or string?
body: <p>I have this function:</p>
  
  <pre><code>network = (action: boolean): void =&gt; {
      if (action) {
          this.action = action;
          this.net = true;
          this.netd = true;
      } else {
          this.action = null;
          this.net = false;
          this.netd = false;
      }
  }
  </code></pre>
  
  <p>Is there a way that I can define in typescript that the action can have a value of boolean OR string?</p>