protected getTypeString()

in typescript/src/api-doc-types/ApiDoc.ts [49:63]


  protected getTypeString(decl: ts.Declaration): string | undefined {
    if (!ts.isVariableDeclaration(decl) && !ts.isPropertyDeclaration(decl) && !ts.isParameter(decl)) {
      return undefined;
    }

    if (!decl.type && !decl.initializer) {
      return undefined;
    }

    const type = decl.type ?
      this.typeChecker.getTypeFromTypeNode(decl.type) :
      this.typeChecker.getTypeAtLocation(decl);

    return this.host.typeToString(this.typeChecker, type);
  }