优化index.d.ts

master
yutent 2025-01-03 18:25:00 +08:00
parent b25b04efbc
commit a740ad2f73
3 changed files with 14 additions and 1 deletions

View File

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

View File

@ -1,7 +1,7 @@
{
"name": "crypto.js",
"type": "module",
"version": "3.3.1",
"version": "3.3.2",
"description": "原生crypto加密模块的二次封装,简化常用加密函数的使用",
"keywords": [
"md5",
@ -28,6 +28,7 @@
"start": "node ./build.js"
},
"exports": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
}

10
src/index.d.ts vendored
View File

@ -3,7 +3,17 @@
* @author yutent<yutent.io@gmail.com>
* @date 2024/12/12 15:41:25
*/
import crypto from 'crypto'
declare module 'crypto.js' {
// 原生 crypto 模块
export const crypto: crypto
/**
* @deprecated('use crypto instead')
*/
export const origin: crypto
// 随机数生成
export function rand(len: number, forceNum?: boolean): string