Closed hc-danieltiziani closed 4 years ago
@hc-danieltiziani
I have checked your problem, please make these changes:
import CryptoES from 'crypto-es';
"skipLibCheck": true,
:@hc-danieltiziani
I have checked your problem, please make these changes:
1. In Typescript projects you need to make overall import like `import CryptoES from 'crypto-es';` 2. add this entry to your tsconfig.json's compilerOptions: `"skipLibCheck": true,`:
@entronad You really should separate the TypeScript definition file...
@JasonHK You mean create .d.ts files for all js files in /lib dir?
@JasonHK You mean create .d.ts files for all js files in /lib dir?
是的,不能将所有模块都包在一个namespace里面,这样没法treeshaking,都把代码打包进去了。 可以参考命名空间和模块这里改改
@JasonHK All js files have own d.ts now in v2.0.0
I can't seem to find how to import the modules to use in typescript:
I tried all formats but all givens an error:
import { MD5 } from 'crypto-es'; Errors: node_modules/crypto-es/lib/index.d.ts:19:21 - error TS2370: A rest parameter must be of an array type.
19 static create(...args?: Array): Base;