best-unit 1.2.5 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,60 @@
1
+ // 枚举定义
2
+ export enum Locale {
3
+ ZH = "zh",
4
+ EN = "en",
5
+ }
6
+
7
+ export enum Theme {
8
+ WHITE = "white",
9
+ DARK = "dark",
10
+ }
11
+
12
+ export enum Env {
13
+ DEV = "dev",
14
+ DEVELOPMENT = "development",
15
+ TEST = "test",
16
+ PROD = "prod",
17
+ PRODUCTION = "production",
18
+ }
19
+
20
+ // 类型定义
21
+ export interface BalanceData {
22
+ fundBalanceId: string;
23
+ merchantId: number;
24
+ bizType: string;
25
+ currency: string;
26
+ totalAmount: string;
27
+ frozenAmount: string;
28
+ creditLimit: string;
29
+ creditUsed: string;
30
+ isCredit: boolean;
31
+ availableAmount: string;
32
+ pendingAmount: string;
33
+ status: string;
34
+ createdAt: string;
35
+ }
36
+
37
+ export interface InitParams {
38
+ token: string;
39
+ merchant_id?: string;
40
+ biz_type?: string;
41
+ fund_balance_id?: string;
42
+ user_id: string;
43
+ theme?: Theme;
44
+ locale?: Locale;
45
+ env: Env;
46
+ themeConfig?: ThemeConfig;
47
+ }
48
+
49
+ export interface ThemeConfig {
50
+ white?: {
51
+ color?: string;
52
+ };
53
+ dark?: {
54
+ color?: string;
55
+ };
56
+ }
57
+
1
58
  export declare function npmTest(): void;
2
59
 
3
60
  export declare function printCurrentTime(): void;
@@ -23,7 +80,7 @@ export declare function initFundUnit(params: {
23
80
  themeConfig?: ThemeConfig;
24
81
  };
25
82
 
26
- export declare function getBalanceData(): any;
83
+ export declare function getBalanceData(): Promise<BalanceData>;
27
84
 
28
85
  export declare function refreshBalance(): void;
29
86
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "best-unit",
3
3
  "private": false,
4
- "version": "1.2.5",
4
+ "version": "1.2.7",
5
5
  "type": "module",
6
6
  "main": "dist/best-unit.cjs",
7
7
  "module": "dist/best-unit.js",
@@ -1,3 +1,60 @@
1
+ // 枚举定义
2
+ export enum Locale {
3
+ ZH = "zh",
4
+ EN = "en",
5
+ }
6
+
7
+ export enum Theme {
8
+ WHITE = "white",
9
+ DARK = "dark",
10
+ }
11
+
12
+ export enum Env {
13
+ DEV = "dev",
14
+ DEVELOPMENT = "development",
15
+ TEST = "test",
16
+ PROD = "prod",
17
+ PRODUCTION = "production",
18
+ }
19
+
20
+ // 类型定义
21
+ export interface BalanceData {
22
+ fundBalanceId: string;
23
+ merchantId: number;
24
+ bizType: string;
25
+ currency: string;
26
+ totalAmount: string;
27
+ frozenAmount: string;
28
+ creditLimit: string;
29
+ creditUsed: string;
30
+ isCredit: boolean;
31
+ availableAmount: string;
32
+ pendingAmount: string;
33
+ status: string;
34
+ createdAt: string;
35
+ }
36
+
37
+ export interface InitParams {
38
+ token: string;
39
+ merchant_id?: string;
40
+ biz_type?: string;
41
+ fund_balance_id?: string;
42
+ user_id: string;
43
+ theme?: Theme;
44
+ locale?: Locale;
45
+ env: Env;
46
+ themeConfig?: ThemeConfig;
47
+ }
48
+
49
+ export interface ThemeConfig {
50
+ white?: {
51
+ color?: string;
52
+ };
53
+ dark?: {
54
+ color?: string;
55
+ };
56
+ }
57
+
1
58
  export declare function npmTest(): void;
2
59
 
3
60
  export declare function printCurrentTime(): void;
@@ -23,7 +80,7 @@ export declare function initFundUnit(params: {
23
80
  themeConfig?: ThemeConfig;
24
81
  };
25
82
 
26
- export declare function getBalanceData(): any;
83
+ export declare function getBalanceData(): Promise<BalanceData>;
27
84
 
28
85
  export declare function refreshBalance(): void;
29
86
 
@@ -4,16 +4,19 @@ import { Locale, Theme, type Env } from "@/types";
4
4
 
5
5
  // 余额数据结构接口
6
6
  export interface BalanceData {
7
- fundBalanceId: string; // 余额账户id
8
- merchantId: number; // 商户id
9
- bizType: string; // 业务类型
10
- currency: string; // 币种
11
- totalAmount: string; // 真实金额
12
- availableAmount: string; // 可用余额
13
- frozenAmount: string; // 冻结金额
14
- pendingAmount: string; // 待处理金额
15
- status: string; // 状态
16
- createdAt: string; // 创建时间
7
+ fundBalanceId: string;
8
+ merchantId: number;
9
+ bizType: string;
10
+ currency: string;
11
+ totalAmount: string;
12
+ frozenAmount: string;
13
+ creditLimit: string;
14
+ creditUsed: string;
15
+ isCredit: boolean;
16
+ availableAmount: string;
17
+ pendingAmount: string;
18
+ status: string;
19
+ createdAt: string;
17
20
  }
18
21
 
19
22
  interface ThemeConfig {