function isFunction(tsType) {
  const ts = /** @type {TypeScript} */ (getTypeScript())
  if (
    tsType.symbol &&
    (tsType.symbol.flags &
      (ts.SymbolFlags.Function | ts.SymbolFlags.Method)) !==
      0
  ) {
    return true
  }

  const signatures = tsType.getCallSignatures()
  return signatures.length > 0
}
Check if a given type is `function` or not.
@param {Type} tsType The type to check.