修复声明

master
yutent 2025-01-03 18:46:51 +08:00
parent a740ad2f73
commit fae1ce2f15
3 changed files with 7 additions and 10 deletions

View File

@ -2,7 +2,7 @@
> 本模块是对原生的`crypto`模块二次封装的,在使用上更加简单方便。
## 更新日志
+ v3.3.2
+ v3.3.3
- 优化`.d.ts`参数声明
+ v3.3.1

View File

@ -1,7 +1,7 @@
{
"name": "crypto.js",
"type": "module",
"version": "3.3.2",
"version": "3.3.3",
"description": "原生crypto加密模块的二次封装,简化常用加密函数的使用",
"keywords": [
"md5",

13
src/index.d.ts vendored
View File

@ -3,16 +3,17 @@
* @author yutent<yutent.io@gmail.com>
* @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