Tag: newrelic typescript

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

我遇到了一些问题,把我刚刚为第三方软件包“ 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 […]