title: How to declare type for function with properties in TypeScript?
body: <p>I'm somewhat new to TypeScript and read some docs on the TypeScript website, but I'm not sure if I'm understanding correctly. In this scenario, I'm using a package that does not have TypeScript types available (<code>prismic-reactjs</code>) and so I am trying to declare the types myself so that I can get rid of the errors riddling my project.</p>
  
  <p>So, as a basic example, how would I write the declaration for such a function:</p>
  
  <pre class="lang-js prettyprint-override"><code>const foo = ({ bar }) =&gt;  {
      return bar;
  };
  
  foo.baz = () =&gt; "string";
  </code></pre>
  
  <p>I can get this far:</p>
  
  <pre class="lang-js prettyprint-override"><code>declare module "my-module" {
    interface fooParams {
      bar: string;
    }
  
    export function foo({ bar }: fooParams): string;
  }
  </code></pre>
  
  <p>But I can't figure out how to include the <code>baz</code> property.</p>