File tree Expand file tree Collapse file tree 8 files changed +24
-34
lines changed
Expand file tree Collapse file tree 8 files changed +24
-34
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @ethan-utils/pay-gateway " : patch
3+ ---
4+
5+ 优化导出类型反馈
Original file line number Diff line number Diff line change @@ -288,3 +288,6 @@ function verifyNotify(params: SevenPay.Params.Notify): boolean {
288288 const signStr = signParams ( filtered , sevenPayConfig . key ) ;
289289 return signStr === params . sign ;
290290}
291+
292+ // 导出类型
293+ export type { SevenPay } from "./types.d.ts" ;
Original file line number Diff line number Diff line change @@ -200,4 +200,7 @@ declare global {
200200 }
201201}
202202
203+ // 导出 SevenPay 命名空间
204+ export type { SevenPay } ;
205+
203206export { } ;
Original file line number Diff line number Diff line change @@ -2,11 +2,9 @@ export function helloPayGateway() {
22 console . log ( "你好,`@ethan-utils/pay-gateway` 支付网关!" ) ;
33}
44
5- // 重新导出 ltzf 相关功能
6- export * as ltzf from "./ltzf/index.js" ;
7-
8- // 重新导出 7pay 相关功能
9- export * as sevenPay from "./7pay/index.js" ;
5+ // 导出类型
6+ export type { LTZF } from "./ltzf/types.d.ts" ;
7+ export type { SevenPay } from "./7pay/types.d.ts" ;
108
119// 导入模块用于默认导出
1210import * as ltzfModule from "./ltzf/index.js" ;
Original file line number Diff line number Diff line change @@ -432,6 +432,9 @@ export async function scanPay(
432432 return response ;
433433}
434434
435+ // 重新导出类型定义,让外部可以访问
436+ export type { LTZF } from "./types.d.ts" ;
437+
435438/**
436439 * H5支付API请求方法
437440 * @param {LTZF.Params.H5PayInput } params - H5支付参数
Original file line number Diff line number Diff line change @@ -508,4 +508,5 @@ declare global {
508508 }
509509}
510510
511- export { } ;
511+ // 导出 LTZF 命名空间
512+ export type { LTZF } ;
Original file line number Diff line number Diff line change 88 "files" : [
99 " dist" ,
1010 " types" ,
11- " README.md" ,
12- " USAGE.md"
11+ " README.md"
1312 ],
1413 "exports" : {
1514 "." : {
1615 "import" : " ./dist/index.js" ,
1716 "require" : " ./dist/index.cjs" ,
1817 "types" : " ./types/index.d.ts"
19- },
20- "./7pay" : {
21- "import" : " ./dist/pay/sevenPay.js" ,
22- "require" : " ./dist/pay/sevenPay.cjs" ,
23- "types" : " ./types/7pay/index.d.ts"
24- },
25- "./ltzf" : {
26- "import" : " ./dist/pay/ltzf.js" ,
27- "require" : " ./dist/pay/ltzf.cjs" ,
28- "types" : " ./types/ltzf/index.d.ts"
2918 }
3019 },
3120 "scripts" : {
Original file line number Diff line number Diff line change @@ -3,33 +3,21 @@ import { defineConfig } from "rolldown";
33export default defineConfig ( [
44 // ESM build
55 {
6- input : {
7- index : "./index.ts" ,
8- "pay/ltzf" : "./ltzf/index.ts" ,
9- "pay/sevenPay" : "./7pay/index.ts" ,
10- } ,
6+ input : "./index.ts" ,
117 output : {
128 format : "esm" ,
13- dir : "dist" ,
9+ file : "dist/index.js " ,
1410 minify : true ,
15- entryFileNames : "[name].js" ,
16- chunkFileNames : "chunks/[name]-[hash].js" ,
1711 } ,
1812 external : [ "@ethan-utils/axios" , "crypto-js" ] ,
1913 } ,
2014 // CommonJS build
2115 {
22- input : {
23- index : "./index.ts" ,
24- "pay/ltzf" : "./ltzf/index.ts" ,
25- "pay/sevenPay" : "./7pay/index.ts" ,
26- } ,
16+ input : "./index.ts" ,
2717 output : {
2818 format : "cjs" ,
29- dir : "dist" ,
19+ file : "dist/index.cjs " ,
3020 minify : true ,
31- entryFileNames : "[name].cjs" ,
32- chunkFileNames : "chunks/[name]-[hash].cjs" ,
3321 } ,
3422 external : [ "@ethan-utils/axios" , "crypto-js" ] ,
3523 } ,
You can’t perform that action at this time.
0 commit comments