title: Typescript: calling setTimeout using react-timeout fails
body: <p>I am attempting to use <a href="https://www.npmjs.com/package/react-timeout" rel="nofollow noreferrer">react-timeout</a> in my application, which I am writing in TypeScript. I am following <a href="https://www.npmjs.com/package/react-timeout#es6-classes---the-light-switch" rel="nofollow noreferrer">the "Light Switch" example</a> in the documentation, in which the <code>setTimeout</code> function seems to be defined as a prop upon importing <code>ReactTimeout</code>. I gather this from this line of the example in the documentation:</p>
  
  <pre><code>handleClick = (e) =&gt; {
      this.props.setTimeout(this.toggle, 5000) // call the `toggle` function after 5000ms 
  }
  </code></pre>
  
  <p>However, when I implement it similarly, TypeScript is complaining that the property does not exist. Here (essentially) is my code. The error is noted in the comments:</p>
  
  <pre><code>import * as React from 'react';
  import Axios from 'axios';
  import ReactTimeout from 'react-timeout';
  
  export interface ExampleProps {
      // none at this point
  }
  
  export interface ExampleState {
      isSearching: boolean;
      searchString: string;
  }
  
  export default class Example extends React.Component&lt;ExampleProps, ExampleState&gt; {
          constructor (props: ExampleProps) {
          super(props);
  
          this.state = {
              isSearching: false,
              searchString: undefined
          }
  
          this.onSearchChange = this.onSearchChange.bind(this);
      }
  
      onSearchChange(e){
          this.setState({searchString: e.target.value});
  
          console.log('searchString: "%s"', this.state.searchString);
  
          // I want to wait 3 seconds before submitting the search, to allow for typing
          // ...but I get an error here: 
          //        [ts] Property 'setTimeout' does not exist on type 'Readonly&lt;{ children?: ReactNode; }&gt; &amp; Readonly&lt;ExampleProps&gt;'
          this.props.setTimeout(this.doSearch(this.state.searchString), 3000);
  
          //ReactTimeout.setTimeout(this.doSearch(this.state.searchString), 3000); 
          // calling it directly like this doesn't work either: "Uncaught TypeError: Cannot read property 'setTimeout' of undefined"
  
       }
  
       doSearch(searchTerm) {
          this.setState({isSearching: true});
          console.log('Now I will go search for "%s"...', searchTerm);
       }
  
      render() {
          const {
              isSearching
          } = this.state;
  
          return (
              &lt;div&gt;
                  &lt;h2&gt;Search&lt;/h2&gt;
  
                  &lt;input type="text" name="searchString" onChange={this.onSearchChange} /&gt;
  
                  {
                      isSearching ? &lt;span&gt;Searching...&lt;/span&gt; : &lt;span&gt;&amp;nbsp;&lt;/span&gt;
                  }
  
              &lt;/div&gt;
          )
      }
  }
  </code></pre>
  
  <p>The error message is clear to me: <code>setTimeout</code> simply isn't in the props; but I don't know how to define it. If I create my class with <code>React.Component&lt;any, ExampleState&gt;</code>, TypeScript no longer complains, but I get a runtime error, <em>"Uncaught TypeError: this.props.setTimeout is not a function"</em>, which isn't surprising, really, given the previous message.</p>
  
  <p>How do I explicitly set a reference to <code>setTimeout</code> from this library? Do I need to do this in my <code>ExampleProps</code>? If so, how?</p>