跨工作区无法识别类型合并

问题描述

所以我有这个index.ts

/// <reference types="jest"/>

export { SecurityLoggingPlugin } from './plugin/SecurityLoggingPlugin';
export { ErrorLoggingPlugin } from './plugin/ErrorLoggingPlugin';
export { GraphQLResolversFactory,ApolloConfig,Context } from './interfaces';
export { ApolloRegistrations } from './registration';
export { TestClient,TestClientRegistrations } from './test/TestClient';

export declare namespace jest {
  export interface Matchers<R> {
    toBeSuccess(): R;
  }
}

正在生成您对index.d.ts的期望

export { SecurityLoggingPlugin } from './plugin/SecurityLoggingPlugin';
export { ErrorLoggingPlugin } from './plugin/ErrorLoggingPlugin';
export { GraphQLResolversFactory,TestClientRegistrations } from './test/TestClient';
export declare namespace jest {
    interface Matchers<R> {
        toBeSuccess(): R;
    }
}

然后导出

{
  "name": "@bb/graph-apollo","version": "1.0.0","main": "build/index.js","types": "build/index.d.ts",

当我将模块导入package.json

  "name": "@bb/graph-main","dependencies": {
    "@bb/graph-apollo": "workspace:ts/lib/graph/packages/apollo",

即使我直接import '@bb/graph-apollo'进入使用中的打字稿文件,它也无法识别对Matchers的更改。

我尝试通过类型,路径和tslib将其添加到tsconfig中,tat均不起作用。我要做的唯一一件事就是在每个项目中添加一个jest.d.ts。是什么赋予了?我该如何解决

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)