Typescript 如何从NPM包中的声明合并导出类型
我正在使用TypeScript在NPM包中构建一个自定义Jest匹配器,它需要通过声明合并来定义匹配器类型定义,如下所示:Typescript 如何从NPM包中的声明合并导出类型,typescript,Typescript,我正在使用TypeScript在NPM包中构建一个自定义Jest匹配器,它需要通过声明合并来定义匹配器类型定义,如下所示: src/@types/jest.d.ts namespace jest { interface Matchers<R> { toHaveQueryParam( expectedQueryParam: { name: string; value: any; type: import('seri
src/@types/jest.d.ts
namespace jest {
interface Matchers<R> {
toHaveQueryParam(
expectedQueryParam: {
name: string;
value: any;
type: import('serialize-query-params').QueryParamConfig<any, any>
}
): CustomMatcherResult;
}
}
名称空间笑话{
接口匹配器{
toHaveQueryParam(
expectedQueryParam:{
名称:字符串;
价值:任何;
类型:导入('serialize-query-params')。QueryParamConfig