@txgw/payout-components 1.0.1 → 1.0.3
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.
- package/dist/index.d.ts +112 -16
- package/package.json +6 -4
package/dist/index.d.ts
CHANGED
|
@@ -8,18 +8,18 @@ import { WildcardHandler } from 'mitt';
|
|
|
8
8
|
|
|
9
9
|
declare const BANK_DETAILS_FORM_KEY = "bankDetails";
|
|
10
10
|
|
|
11
|
-
declare interface BaseProps<T extends keyof typeof ElementsMap> extends InitOptions {
|
|
11
|
+
export declare interface BaseProps<T extends keyof typeof ElementsMap> extends InitOptions {
|
|
12
12
|
emitter: Emitter<Events<T>>;
|
|
13
13
|
mi18n: Mi18nInstance;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
declare function BeneficiaryForm(props: Props): JSX_2.Element;
|
|
17
17
|
|
|
18
|
-
declare interface BeneficiaryFormCustomizations {
|
|
18
|
+
export declare interface BeneficiaryFormCustomizations {
|
|
19
19
|
layout?: LayoutSection[];
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
declare type BeneficiaryFormFinalValues = {
|
|
22
|
+
export declare type BeneficiaryFormFinalValues = {
|
|
23
23
|
beneficiary?: {
|
|
24
24
|
address?: {
|
|
25
25
|
country?: string;
|
|
@@ -51,19 +51,30 @@ declare type BeneficiaryFormFinalValues = {
|
|
|
51
51
|
receive_currency?: string;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
declare type BeneficiaryFormOptions<T extends keyof typeof ElementsMap> = Omit<BeneficiaryFormProps, keyof BaseProps<T>>;
|
|
54
|
+
export declare type BeneficiaryFormOptions<T extends keyof typeof ElementsMap> = Omit<BeneficiaryFormProps, keyof BaseProps<T>>;
|
|
55
55
|
|
|
56
|
-
declare type BeneficiaryFormProps = ComponentProps<typeof BeneficiaryForm>;
|
|
56
|
+
export declare type BeneficiaryFormProps = ComponentProps<typeof BeneficiaryForm>;
|
|
57
|
+
|
|
58
|
+
export declare interface BeneficiaryFormValues {
|
|
59
|
+
inputRegionCode?: string;
|
|
60
|
+
inputPayoutType: PayoutType;
|
|
61
|
+
inputCurrency?: string;
|
|
62
|
+
inputPaymentMethod?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export declare interface BeneficiarySchema {
|
|
66
|
+
amis_page: string;
|
|
67
|
+
}
|
|
57
68
|
|
|
58
69
|
export declare function createElement<T extends keyof typeof ElementsMap>(type: T, options?: ElementOptionsTypes<T>[T]): SDKComponent<T>;
|
|
59
70
|
|
|
60
|
-
declare interface ElementEventsMap extends Record<EventType, unknown> {
|
|
71
|
+
export declare interface ElementEventsMap extends Record<EventType, unknown> {
|
|
61
72
|
beneficiaryForm: {
|
|
62
73
|
submit: BeneficiaryFormFinalValues;
|
|
63
74
|
};
|
|
64
75
|
}
|
|
65
76
|
|
|
66
|
-
declare interface ElementOptionsTypes<T extends keyof typeof ElementsMap> {
|
|
77
|
+
export declare interface ElementOptionsTypes<T extends keyof typeof ElementsMap> {
|
|
67
78
|
beneficiaryForm: BeneficiaryFormOptions<T>;
|
|
68
79
|
}
|
|
69
80
|
|
|
@@ -73,34 +84,109 @@ declare const ElementsMap: {
|
|
|
73
84
|
}>;
|
|
74
85
|
};
|
|
75
86
|
|
|
76
|
-
declare type EntityDetailType = "ENTITY_TYPE_PERSONAL";
|
|
87
|
+
export declare type EntityDetailType = "ENTITY_TYPE_PERSONAL";
|
|
88
|
+
|
|
89
|
+
export declare type Events<T extends keyof typeof ElementsMap> = ElementEventsMap[T];
|
|
77
90
|
|
|
78
|
-
declare type
|
|
91
|
+
export declare type EventsData<T extends keyof typeof ElementsMap> = Events<T>[keyof Events<T>];
|
|
79
92
|
|
|
80
|
-
declare
|
|
93
|
+
export declare interface GetBeneficiaryFormSchemaResponse {
|
|
94
|
+
beneficiary_schema: BeneficiarySchema;
|
|
95
|
+
version: string;
|
|
96
|
+
schema_key: string;
|
|
97
|
+
}
|
|
81
98
|
|
|
82
99
|
export declare function init(options: InitOptions): void;
|
|
83
100
|
|
|
84
|
-
declare interface InitOptions {
|
|
101
|
+
export declare interface InitOptions {
|
|
85
102
|
authCode: string;
|
|
86
103
|
domain: string;
|
|
87
104
|
codeVerifier: string;
|
|
88
105
|
locale?: Locale;
|
|
89
106
|
}
|
|
90
107
|
|
|
91
|
-
declare interface LayoutSection {
|
|
108
|
+
export declare interface LayoutSection {
|
|
92
109
|
title?: string;
|
|
93
110
|
name?: typeof BANK_DETAILS_FORM_KEY;
|
|
94
111
|
hidden?: boolean;
|
|
95
112
|
}
|
|
96
113
|
|
|
97
|
-
declare type Locale = "en" | "zh-Hant" | "ar" | "ja" | "th" | "zh" | "tr" | "de" | "es" | "fr" | "id" | "ko" | "ms" | "pt" | "ru" | "vi" | "it" | "bn" | "ur" | "my" | "uz";
|
|
114
|
+
export declare type Locale = "en" | "zh-Hant" | "ar" | "ja" | "th" | "zh" | "tr" | "de" | "es" | "fr" | "id" | "ko" | "ms" | "pt" | "ru" | "vi" | "it" | "bn" | "ur" | "my" | "uz";
|
|
115
|
+
|
|
116
|
+
export declare interface PaymentMethodInfo {
|
|
117
|
+
payment_method: string;
|
|
118
|
+
logo_url: string;
|
|
119
|
+
display_name: string;
|
|
120
|
+
description: string;
|
|
121
|
+
status: string;
|
|
122
|
+
category: string;
|
|
123
|
+
transfer_limit: string;
|
|
124
|
+
transfer_fee: string;
|
|
125
|
+
transfer_speed: string;
|
|
126
|
+
}
|
|
98
127
|
|
|
99
|
-
declare
|
|
128
|
+
export declare type PayoutType = "B2P";
|
|
129
|
+
|
|
130
|
+
export declare interface PlaceSearchResponse {
|
|
131
|
+
ret: number;
|
|
132
|
+
code: string;
|
|
133
|
+
msg: string;
|
|
134
|
+
data: {
|
|
135
|
+
status: number;
|
|
136
|
+
message: string;
|
|
137
|
+
request_id: string;
|
|
138
|
+
count: number;
|
|
139
|
+
data: {
|
|
140
|
+
id: string;
|
|
141
|
+
title: string;
|
|
142
|
+
address: string;
|
|
143
|
+
location: {
|
|
144
|
+
lat: number;
|
|
145
|
+
lng: number;
|
|
146
|
+
};
|
|
147
|
+
_distance: number;
|
|
148
|
+
}[];
|
|
149
|
+
};
|
|
150
|
+
requestId: string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export declare interface Props extends BaseProps<"beneficiaryForm"> {
|
|
100
154
|
defaultValues?: BeneficiaryFormFinalValues;
|
|
101
155
|
customizations?: BeneficiaryFormCustomizations;
|
|
102
156
|
}
|
|
103
157
|
|
|
158
|
+
export declare interface QueryCurrenciesResponse {
|
|
159
|
+
currencies: string[];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export declare interface QueryPaymentMethodsInfoResponse {
|
|
163
|
+
countries: {
|
|
164
|
+
[countryCode: string]: {
|
|
165
|
+
payout_type: {
|
|
166
|
+
[payoutType: string]: {
|
|
167
|
+
payment_method_infos: PaymentMethodInfo[];
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
currency_display_order: string[];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export declare interface QueryRegionInfosResponse {
|
|
176
|
+
region_infos?: RegionInfo[];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export declare interface RegionInfo {
|
|
180
|
+
region_code: string;
|
|
181
|
+
region_code3?: string;
|
|
182
|
+
region_name?: string;
|
|
183
|
+
region_name_standard?: string;
|
|
184
|
+
region_name_cn?: string;
|
|
185
|
+
region_number?: string;
|
|
186
|
+
currency_code?: string;
|
|
187
|
+
currency_number?: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
104
190
|
declare class SDKComponent<T extends keyof typeof ElementsMap> {
|
|
105
191
|
private loader;
|
|
106
192
|
private options;
|
|
@@ -111,11 +197,21 @@ declare class SDKComponent<T extends keyof typeof ElementsMap> {
|
|
|
111
197
|
constructor(loader: (typeof ElementsMap)[T], options: InitOptions, mi18n: Mi18nInstance);
|
|
112
198
|
mount(container: Element): Promise<void>;
|
|
113
199
|
unmount(): void;
|
|
114
|
-
on
|
|
200
|
+
on<K extends keyof Events<T>>(type: K, handler: Handler<EventsData<T>>): void;
|
|
115
201
|
on(type: "*", handler: WildcardHandler<Events<T>>): void;
|
|
116
|
-
off
|
|
202
|
+
off<K extends keyof Events<T>>(type: K, handler?: Handler<EventsData<T>>): void;
|
|
117
203
|
off(type: "*", handler?: WildcardHandler<Events<T>>): void;
|
|
118
204
|
isMounted(): boolean;
|
|
119
205
|
}
|
|
120
206
|
|
|
207
|
+
export declare interface TransferMethodFormSchema {
|
|
208
|
+
type: string;
|
|
209
|
+
name: string;
|
|
210
|
+
label: string;
|
|
211
|
+
options: {
|
|
212
|
+
value: string;
|
|
213
|
+
body: JSX.Element;
|
|
214
|
+
}[];
|
|
215
|
+
}
|
|
216
|
+
|
|
121
217
|
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@txgw/payout-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -19,8 +19,12 @@
|
|
|
19
19
|
"access": "public",
|
|
20
20
|
"registry": "https://registry.npmjs.org/"
|
|
21
21
|
},
|
|
22
|
-
"
|
|
22
|
+
"dependencies": {
|
|
23
23
|
"@mi18n/react": "^5.16.4",
|
|
24
|
+
"mitt": "^3.0.1",
|
|
25
|
+
"react": "^18.3.1"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
24
28
|
"@microsoft/api-extractor": "^7.58.0",
|
|
25
29
|
"@types/crypto-js": "^4.2.2",
|
|
26
30
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -33,9 +37,7 @@
|
|
|
33
37
|
"clsx": "^2.1.1",
|
|
34
38
|
"crypto-js": "^4.2.0",
|
|
35
39
|
"lodash-es": "^4.18.1",
|
|
36
|
-
"mitt": "^3.0.1",
|
|
37
40
|
"postcss-discard-comments": "^7.0.6",
|
|
38
|
-
"react": "^18.3.1",
|
|
39
41
|
"react-dom": "^18.3.1",
|
|
40
42
|
"rollup-plugin-visualizer": "^7.0.1",
|
|
41
43
|
"sass-embedded": "^1.99.0",
|