title: This expression is not callable. Type 'string' has no call signatures
body: <p>I'm trying to create a template file from an object where the key can be either a string or a function that returns a string:</p>
  <pre><code>export const createDynamicTemplate = (
    templateParams: CreateDynamicTemplateParams
  ) =&gt; {
    const { template, projectPath = '', param = '' } = templateParams
    const updatedTemplateArr = Object.keys(template).map((key: string) =&gt; {
        return {
          [key]: {
            filePath: `${projectPath}/${key}`,
            template: typeof template[key] === 'function' ? 
            template[key](param) : template[key],
          },
        }
    })
    const updatedTemplate = Object.assign({}, ...updatedTemplateArr)
    return updatedTemplate
  }
  </code></pre>
  <p>My interfaces are:</p>
  <pre><code>export interface TemplateObject {
    [key: string]: string
  }
  
  export interface FunctionalTemplateObject {
    [key: string]: (param: string) =&gt; void
  }
  
  export interface CreateDynamicTemplateParams {
    template: FunctionalTemplateObject | TemplateObject
    projectPath: string
    param: string
  }
  </code></pre>
  <p>It keeps throwing this error in <code>createDynamicTemplate</code> though:</p>
  <p>This expression is not callable.
  Not all constituents of type 'string | ((param: string) =&gt; void)' are callable.
  Type 'string' has no call signatures.</p>
  <p>What am I doing wrong here?</p>