diff --git a/Readme.md b/Readme.md index ce2734d..6822dad 100644 --- a/Readme.md +++ b/Readme.md @@ -2,7 +2,7 @@ > 本模块是对原生的`crypto`模块二次封装的,在使用上更加简单方便。 ## 更新日志 -+ v3.3.2 ++ v3.3.3 - 优化`.d.ts`参数声明 + v3.3.1 diff --git a/package.json b/package.json index e8331f3..a63feca 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "crypto.js", "type": "module", - "version": "3.3.2", + "version": "3.3.3", "description": "原生crypto加密模块的二次封装,简化常用加密函数的使用", "keywords": [ "md5", diff --git a/src/index.d.ts b/src/index.d.ts index 60d4298..3c03974 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -3,16 +3,17 @@ * @author yutent * @date 2024/12/12 15:41:25 */ -import crypto from 'crypto' declare module 'crypto.js' { + import crypto from 'node:crypto' + // 原生 crypto 模块 - export const crypto: crypto + export { crypto } /** - * @deprecated('use crypto instead') + * @deprecated Use `crypto` instead. */ - export const origin: crypto + export const origin: typeof crypto // 随机数生成 export function rand(len: number, forceNum?: boolean): string @@ -36,10 +37,6 @@ declare module 'crypto.js' { export function sha256Sign(path: string, encode?: string): string | Buffer - export function sha1(data: string, encode?: string): string | Buffer - - export function sha1Sign(path: string, encode?: string): string | Buffer - export function sha512(data: string, encode?: string): string | Buffer export function sha512Sign(path: string, encode?: string): string | Buffer