无法导入外部 NPM 包来制作 angular 库

Can't import external NPM package to make angular library

{
  "name": "crypto-local-storage",
  "version": "0.0.1",
  "peerDependencies": {
    "@angular/common": "^12.2.0",
    "@angular/core": "^12.2.0",
    "crypto-js": "^3.1.8",
    "secure-web-storage": "^1.0.2"
  },
  "dependencies": {
    "tslib": "^2.3.0"
  },
  "devDependencies": {
    "@types/crypto-js": "^4.0.2"
  }
}

其次,我这样做了


{
  "name": "crypto-local-storage",
  "version": "0.0.1",
  "peerDependencies": {
    "@angular/common": "^12.2.0",
    "@angular/core": "^12.2.0"
    
  },
  "dependencies": {
    "tslib": "^2.3.0",
    "crypto-js": "^3.1.8",
    "secure-web-storage": "^1.0.2"
  },
  "devDependencies": {
    "@types/crypto-js": "^4.0.2"
  }
}

但是在我导入的时候在我的服务文件中secure-web-storage像这样

import * as SecureStorage from 'secure-web-storage'; 我收到了一条消息,

TS7016: Could not find a declaration file for module 'secure-web-storage'.
 'D:/AMS/crypto-local-storage/projects/crypto-local-storage/node_modules/secure-web-storage/secure-storage.js' 
implicitly has an 'any' type.  
Try `npm i --save-dev @types/secure-web-storage` if it exists or add a new declaration (.d.ts) file containing 
`declare module 'secure-web-storage';`

secure-web-storage 不包含任何 @types/secure-web-storage 文件。那么我怎样才能摆脱这个错误呢?谷歌搜索了这么多也没有得到任何明确的答案。

我的文件夹结构可能对您有所帮助,

My Folder Structure Image

如果 运行 npm install -D @types/secure-web-storage 没有解决问题,请使用 require 而不是 import

const secureWebStorage= require('secure-web-storage');