如何扩充已存在的全局声明

举个例子:

// node_modules/@types/jest/index.d.ts
declare const expect = () => { toBe: Function }

// index.test.ts
expect().toBe()

现在我希望扩充一个方法 expect().toWarnDev(),应该怎么做?

阅读 648
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进