Angular Typescript-无法使用';新';其类型缺少调用或构造签名的表达式

Angular Typescript-无法使用';新';其类型缺少调用或构造签名的表达式,angular,typescript,pouchdb,Angular,Typescript,Pouchdb,我正在尝试连接到数据库,但出现了错误 Typescript Cannot use 'new' with an expression whose type lacks a call or construct signature 下面是我的代码:- var PouchDB = require("pouchdb"); @Injectable() export class PouchDBService { private isInstantiated: boolean; private

我正在尝试连接到数据库,但出现了错误

Typescript Cannot use 'new' with an expression whose type lacks a call or construct signature
下面是我的代码:-

var PouchDB = require("pouchdb"); 

@Injectable()
export class PouchDBService {

  private isInstantiated: boolean;
  private database: any;

  public constructor(private http: Http) {
    if(!this.isInstantiated) {

      this.database = new PouchDB("db_name"); <--error at this line
      this.isInstantiated = true;
    }
var-pockdb=require(“pockdb”);
@可注射()
导出类数据库服务{
已安装私有:布尔值;
私有数据库:任何;
公共构造函数(私有http:http){
如果(!this.isinstated){

this.database=new backDB(“db_name”);在这种情况下可能会有所帮助。

在这种情况下可能会有所帮助。

您可能需要按以下方式使用backDB:

import * as PouchDB from "pouchdb";
然后我们可以做:

  this.database = new PouchDB("db_name"); //should work

您可能需要执行以下操作:

import * as PouchDB from "pouchdb";
然后我们可以做:

  this.database = new PouchDB("db_name"); //should work