import Kvl from 'kvl';
declare namespace kvl {
interface test1{
}
}
//error
declare class kvl {}
declare namespace kvl{
interface Request {}
interface Response {
}
}
export as namespace kvl;
export default kvl;
import Kvl from 'kvl';
declare module "kvl" {
namespace kvl {
interface test1{
}
}
}
import kvl from 'kvl';
const name: kvl.test1;
kvl.test1 [错误]
我想在.d.ts内的命名空间中添加一个方法,但是添加失败。
答案 0 :(得分:0)
找到了解决方案
declare class kvl {
}
declare global{
namespace kvl{
interface Request {}
interface Response {}
}
}
export as namespace kvl;
export default kvl;