Tag: typings

TypeScript中的types问题

我有使用LoopBack和TypeScript的节点JS上的项目。 昨天,我发现这个问题: 控制台警告 我如何解决这个问题?

在我的项目中不能导入PouchDB

我正在从事一个项目,最近PouchDB决定停止工作。 我不能在我的ts项目中编译它。 我试过了: import * as PouchDB from 'pouchdb'; export default PouchDB.defaults({ prefix: `http://admin:password@localhost:5984/` }) 但是我明白了 server/src/database.ts(3,24): error TS2339: Property 'defaults' does not exist on type 'typeof 'pouchdb''. 如果我尝试: import {PouchDB} from 'pouchdb'; export default PouchDB.defaults({ prefix: `http://admin:password@localhost:5984/` } as any) 我明白了 server/src/database.ts(1,9): error TS2305: Module ''pouchdb'' has no exported member 'PouchDB'. 如果我尝试: import PouchDB […]

打字稿中的第三方模块的声明文件

我遇到了一些问题,把我刚刚为第三方软件包“ newrelic ”所做的声明文件整合起来。 总是当我运行tsc我得到了下一个错误信息: src/Server.ts(17,7): error TS2322: Type '{ express: typeof e; newrelic: typeof 'newrelic'; }' is not assignable to type 'BootServicesInterface'. 财产types“newrelic”是不相容的。 键入'typeof'newrelic''不能分配键入'newrelic'。 属性'setTransactionName'在'typeof'newrelic''types中缺less。 有没有人如何解决这个错误? 我已经工作了几个小时,我看不出我做错了什么。 源文件: ./src/Server.ts 'use strict' import * as debugDep from 'debug' const debug = debugDep('server') debug('Booting Server') debug('Loading .env file') import * as dotenv from 'dotenv' dotenv.config({silent: true}) debug('Loading […]

节点adal库的types?

我正在尝试使用adal-node库,并为库寻找打字稿。 typessearch产生类似于adal-angular的types,不知道是否可以使用。 有没有其他人想到这个问题,或者是adal开发团队正在考虑释放types?