@v-miniapp/apis 1.0.11 → 1.0.13

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.
Files changed (64) hide show
  1. package/README.md +1 -1
  2. package/package.json +2 -21
  3. package/dist/api/index.d.ts +0 -101
  4. package/dist/api/index.js +0 -130
  5. package/dist/async.d.ts +0 -2
  6. package/dist/async.js +0 -4
  7. package/dist/global.d.ts +0 -7
  8. package/dist/index.d.ts +0 -5
  9. package/dist/index.js +0 -8
  10. package/dist/types/api/alert.d.ts +0 -15
  11. package/dist/types/api/bio-metrics/create-key.d.ts +0 -15
  12. package/dist/types/api/bio-metrics/create-signature.d.ts +0 -20
  13. package/dist/types/api/bio-metrics/delete-key.d.ts +0 -12
  14. package/dist/types/api/bio-metrics/index.d.ts +0 -6
  15. package/dist/types/api/bio-metrics/is-supported.d.ts +0 -19
  16. package/dist/types/api/bio-metrics/key-exists.d.ts +0 -12
  17. package/dist/types/api/bio-metrics/local-auth.d.ts +0 -15
  18. package/dist/types/api/choose-image.d.ts +0 -42
  19. package/dist/types/api/clear-storage.d.ts +0 -8
  20. package/dist/types/api/cloud/upload-file.d.ts +0 -19
  21. package/dist/types/api/compress-image.d.ts +0 -29
  22. package/dist/types/api/confirm.d.ts +0 -24
  23. package/dist/types/api/download-file.d.ts +0 -20
  24. package/dist/types/api/exit-miniapp.d.ts +0 -8
  25. package/dist/types/api/get-auth-code.d.ts +0 -26
  26. package/dist/types/api/get-beacon-discovery-status.d.ts +0 -13
  27. package/dist/types/api/get-clipboard.d.ts +0 -15
  28. package/dist/types/api/get-default-payment-method.d.ts +0 -16
  29. package/dist/types/api/get-image-info.d.ts +0 -30
  30. package/dist/types/api/get-location.d.ts +0 -32
  31. package/dist/types/api/get-setting.d.ts +0 -15
  32. package/dist/types/api/get-storage-info.d.ts +0 -19
  33. package/dist/types/api/get-storage.d.ts +0 -19
  34. package/dist/types/api/get-system-info.d.ts +0 -52
  35. package/dist/types/api/get-user-info.d.ts +0 -21
  36. package/dist/types/api/hide-loading.d.ts +0 -8
  37. package/dist/types/api/index.d.ts +0 -43
  38. package/dist/types/api/init-payment.d.ts +0 -88
  39. package/dist/types/api/make-phone-call.d.ts +0 -11
  40. package/dist/types/api/off-beacon-discovery.d.ts +0 -2
  41. package/dist/types/api/on-beacon-discovery.d.ts +0 -15
  42. package/dist/types/api/open-app-setting.d.ts +0 -8
  43. package/dist/types/api/open-native-app-store.d.ts +0 -20
  44. package/dist/types/api/open-setting.d.ts +0 -15
  45. package/dist/types/api/preview-image.d.ts +0 -17
  46. package/dist/types/api/prompt.d.ts +0 -31
  47. package/dist/types/api/remove-storage.d.ts +0 -11
  48. package/dist/types/api/request.d.ts +0 -29
  49. package/dist/types/api/save-image.d.ts +0 -11
  50. package/dist/types/api/scan.d.ts +0 -14
  51. package/dist/types/api/set-clipboard.d.ts +0 -11
  52. package/dist/types/api/set-storage.d.ts +0 -17
  53. package/dist/types/api/share-app.d.ts +0 -18
  54. package/dist/types/api/show-action-sheet.d.ts +0 -22
  55. package/dist/types/api/show-loading.d.ts +0 -11
  56. package/dist/types/api/show-payment-method.d.ts +0 -40
  57. package/dist/types/api/show-toast.d.ts +0 -21
  58. package/dist/types/api/start-beacon-discovery.d.ts +0 -11
  59. package/dist/types/api/stop-beacon-discovery.d.ts +0 -8
  60. package/dist/types/api/upload-file.d.ts +0 -29
  61. package/dist/types/common.d.ts +0 -12
  62. package/dist/types/vsf.d.ts +0 -664
  63. package/dist/utils/api.d.ts +0 -4
  64. package/dist/utils/api.js +0 -10
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @v-miniapp/apis
2
2
 
3
- **@v-miniapp/apis** là bộ thư viện JavaScript API được thiết kế đặc biệt cho việc phát triển V-App. SDK này cung cấp đầy đủ các API để tương tác với nền tảng V-App, bao gồm các nhóm API cơ bản (thoát MiniApp, chia sẻ, thông tin hệ thống), giao diện (dialog, toast, loading, action sheet), media (ảnh, video, âm thanh), lưu trữ (local storage), network & cloud (HTTP request, upload/download), thanh toán (payment flow), và các API phần cứng (Bluetooth, Biometrics, Geo location). Thư viện hỗ trợ cả hai cách gọi API: dạng sync (callback-based) và async (Promise-based) để phù hợp với mọi phong cách lập trình.
3
+ **@v-miniapp/apis** là bộ thư viện JavaScript API được thiết kế đặc biệt cho việc phát triển V-App.
4
4
 
5
5
  📚 **Tài liệu chính thức**: [Tổng quan về API | V-MiniApp](https://developer.v-app.vn/api/overview)
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v-miniapp/apis",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -18,28 +18,9 @@
18
18
  "types": "./dist/async.d.ts"
19
19
  }
20
20
  },
21
- "scripts": {
22
- "build:lib": "tsc -p tsconfig.lib.json && vite build --config vite.config.lib.ts",
23
- "lint": "eslint ."
24
- },
25
21
  "dependencies": {},
26
22
  "peerDependencies": {},
27
- "devDependencies": {
28
- "@eslint/js": "^9.33.0",
29
- "@types/node": "^24.3.3",
30
- "eslint": "^9.33.0",
31
- "eslint-config-prettier": "^10.1.8",
32
- "eslint-plugin-react-hooks": "^5.2.0",
33
- "eslint-plugin-react-refresh": "^0.4.20",
34
- "globals": "^16.3.0",
35
- "typescript": "~5.8.3",
36
- "typescript-eslint": "^8.39.1",
37
- "vite": "^7.1.2",
38
- "vite-plugin-dts": "^4.5.4",
39
- "vite-plugin-eslint": "^1.8.1"
40
- },
41
23
  "engines": {
42
24
  "node": ">=22"
43
- },
44
- "packageManager": "pnpm@10.16.0"
25
+ }
45
26
  }
@@ -1,101 +0,0 @@
1
- import { IVsfGetSystemInfoAsync } from '../types/api/get-system-info';
2
- import { IVsfClearStorageAsync } from '../types/api/clear-storage';
3
- import { IVsfGetClipboardAsync } from '../types/api/get-clipboard';
4
- import { IVsfSetClipboardAsync } from '../types/api/set-clipboard';
5
- import { IVsfExitMiniAppAsync } from '../types/api/exit-miniapp';
6
- import { IVsfGetSettingAsync } from '../types/api/get-setting';
7
- import { IVsfOpenSettingAsync } from '../types/api/open-setting';
8
- import { IVsfOpenAppSettingAsync } from '../types/api/open-app-setting';
9
- import { IVsfOpenNativeAppStoreAsync } from '../types/api/open-native-app-store';
10
- import { IVsfShareAppAsync } from '../types/api/share-app';
11
- import { IVsfSetStorageAsync } from '../types/api/set-storage';
12
- import { IVsfGetStorageAsync } from '../types/api/get-storage';
13
- import { IVsfRemoveStorageAsync } from '../types/api/remove-storage';
14
- import { IVsfGetStorageInfoAsync } from '../types/api/get-storage-info';
15
- import { IVsfAlertAsync } from '../types/api/alert';
16
- import { IVsfConfirmAsync } from '../types/api/confirm';
17
- import { IVsfPromptAsync } from '../types/api/prompt';
18
- import { IVsfShowToastAsync } from '../types/api/show-toast';
19
- import { IVsfShowLoadingAsync } from '../types/api/show-loading';
20
- import { IVsfShowActionSheetAsync } from '../types/api/show-action-sheet';
21
- import { IVsfChooseImageAsync } from '../types/api/choose-image';
22
- import { IVsfGetImageInfoAsync } from '../types/api/get-image-info';
23
- import { IVsfCompressImageAsync } from '../types/api/compress-image';
24
- import { IVsfRequestAsync } from '../types/api/request';
25
- import { IVsfDownloadFileAsync } from '../types/api/download-file';
26
- import { IVsfUploadFileAsync } from '../types/api/upload-file';
27
- import { IVsfGetLocationAsync } from '../types/api/get-location';
28
- import { IVsfScanAsync } from '../types/api/scan';
29
- import { IVsfMakePhoneCallAsync } from '../types/api/make-phone-call';
30
- import { IVsfPreviewImageAsync } from '../types/api/preview-image';
31
- import { IVsfSaveImageAsync } from '../types/api/save-image';
32
- import { IVsfGetAuthCodeAsync } from '../types/api/get-auth-code';
33
- import { IVsfGetUserInfoAsync } from '../types/api/get-user-info';
34
- import { IVsfInitPaymentAsync } from '../types/api/init-payment';
35
- import { IVsfShowPaymentMethodAsync } from '../types/api/show-payment-method';
36
- import { IVsfGetDefaultPaymentMethodAsync } from '../types/api/get-default-payment-method';
37
- import { IVsfStartBeaconDiscoveryAsync } from '../types/api/start-beacon-discovery';
38
- import { IVsfStopBeaconDiscoveryAsync } from '../types/api/stop-beacon-discovery';
39
- import { IVsfGetBeaconDiscoveryStatusAsync } from '../types/api/get-beacon-discovery-status';
40
- import { IVsfBioMetricsLocalAuthAsync } from '../types/api/bio-metrics/local-auth';
41
- import { IVsfBioMetricsIsSupportedAsync } from '../types/api/bio-metrics/is-supported';
42
- import { IVsfBioMetricsKeyExistsAsync } from '../types/api/bio-metrics/key-exists';
43
- import { IVsfBioMetricsCreateKeyAsync } from '../types/api/bio-metrics/create-key';
44
- import { IVsfBioMetricsCreateSignatureAsync } from '../types/api/bio-metrics/create-signature';
45
- import { IVsfBioMetricsDeleteKeyAsync } from '../types/api/bio-metrics/delete-key';
46
- import { IVsfHideLoadingAsync } from '../types/api';
47
- import { IVsf } from '../types/vsf';
48
- export declare const apisSync: IVsf;
49
- export declare const apisAsync: {
50
- getSystemInfo: IVsfGetSystemInfoAsync;
51
- clearStorage: IVsfClearStorageAsync;
52
- getClipboard: IVsfGetClipboardAsync;
53
- setClipboard: IVsfSetClipboardAsync;
54
- exitMiniApp: IVsfExitMiniAppAsync;
55
- getSetting: IVsfGetSettingAsync;
56
- openSetting: IVsfOpenSettingAsync;
57
- openAppSetting: IVsfOpenAppSettingAsync;
58
- openNativeStore: IVsfOpenNativeAppStoreAsync;
59
- shareApp: IVsfShareAppAsync;
60
- setStorage: IVsfSetStorageAsync;
61
- getStorage: IVsfGetStorageAsync;
62
- removeStorage: IVsfRemoveStorageAsync;
63
- getStorageInfo: IVsfGetStorageInfoAsync;
64
- alert: IVsfAlertAsync;
65
- confirm: IVsfConfirmAsync;
66
- prompt: IVsfPromptAsync;
67
- showToast: IVsfShowToastAsync;
68
- showLoading: IVsfShowLoadingAsync;
69
- hideLoading: IVsfHideLoadingAsync;
70
- showActionSheet: IVsfShowActionSheetAsync;
71
- chooseImage: IVsfChooseImageAsync;
72
- getImageInfo: IVsfGetImageInfoAsync;
73
- compressImage: IVsfCompressImageAsync;
74
- request: IVsfRequestAsync;
75
- downloadFile: IVsfDownloadFileAsync;
76
- uploadFile: IVsfUploadFileAsync;
77
- getLocation: IVsfGetLocationAsync;
78
- scan: IVsfScanAsync;
79
- makePhoneCall: IVsfMakePhoneCallAsync;
80
- previewImage: IVsfPreviewImageAsync;
81
- saveImage: IVsfSaveImageAsync;
82
- getAuthCode: IVsfGetAuthCodeAsync;
83
- getUserInfo: IVsfGetUserInfoAsync;
84
- initPayment: IVsfInitPaymentAsync;
85
- showPaymentMethod: IVsfShowPaymentMethodAsync;
86
- getDefaultPaymentMethod: IVsfGetDefaultPaymentMethodAsync;
87
- startBeaconDiscovery: IVsfStartBeaconDiscoveryAsync;
88
- stopBeaconDiscovery: IVsfStopBeaconDiscoveryAsync;
89
- getBeaconDiscoveryStatus: IVsfGetBeaconDiscoveryStatusAsync;
90
- onBeaconDiscovery: import('../types/api').IVsfOnBeaconBiscovery;
91
- offBeaconDiscovery: import('../types/api').IVsfOffBeaconDiscovery;
92
- bioMetrics: {
93
- localAuth: IVsfBioMetricsLocalAuthAsync;
94
- isSupported: IVsfBioMetricsIsSupportedAsync;
95
- keyExists: IVsfBioMetricsKeyExistsAsync;
96
- createKey: IVsfBioMetricsCreateKeyAsync;
97
- createSignature: IVsfBioMetricsCreateSignatureAsync;
98
- deleteKey: IVsfBioMetricsDeleteKeyAsync;
99
- };
100
- };
101
- export declare const apis: IVsf;
package/dist/api/index.js DELETED
@@ -1,130 +0,0 @@
1
- import { getVsfPromiseFunction as t } from "../utils/api.js";
2
- const e = new Proxy({}, {
3
- get(i, o) {
4
- return typeof window.vsf[o] == "function" ? (...a) => window.vsf[o](...a) : window.vsf[o];
5
- }
6
- }), s = {
7
- getSystemInfo: t(
8
- e.getSystemInfo
9
- ),
10
- clearStorage: t(
11
- e.clearStorage
12
- ),
13
- getClipboard: t(
14
- e.getClipboard
15
- ),
16
- setClipboard: t(
17
- e.setClipboard
18
- ),
19
- exitMiniApp: t(
20
- e.exitMiniApp
21
- ),
22
- getSetting: t(e.getSetting),
23
- openSetting: t(
24
- e.openSetting
25
- ),
26
- openAppSetting: t(
27
- e.openAppSetting
28
- ),
29
- openNativeStore: t(
30
- e.openNativeAppStore
31
- ),
32
- shareApp: t(e.shareApp),
33
- setStorage: t(e.setStorage),
34
- getStorage: t(e.getStorage),
35
- removeStorage: t(
36
- e.removeStorage
37
- ),
38
- getStorageInfo: t(
39
- e.getStorageInfo
40
- ),
41
- alert: t(e.alert),
42
- confirm: t(e.confirm),
43
- prompt: t(e.prompt),
44
- showToast: t(e.showToast),
45
- showLoading: t(
46
- e.showLoading
47
- ),
48
- hideLoading: t(
49
- e.hideLoading
50
- ),
51
- showActionSheet: t(
52
- e.showActionSheet
53
- ),
54
- chooseImage: t(
55
- e.chooseImage
56
- ),
57
- getImageInfo: t(
58
- e.getImageInfo
59
- ),
60
- compressImage: t(
61
- e.compressImage
62
- ),
63
- request: t(e.request),
64
- downloadFile: t(
65
- e.downloadFile
66
- ),
67
- uploadFile: t(e.uploadFile),
68
- getLocation: t(
69
- e.getLocation
70
- ),
71
- scan: t(e.scan),
72
- makePhoneCall: t(
73
- e.makePhoneCall
74
- ),
75
- previewImage: t(
76
- e.previewImage
77
- ),
78
- saveImage: t(e.saveImage),
79
- getAuthCode: t(
80
- e.getAuthCode
81
- ),
82
- getUserInfo: t(
83
- e.getUserInfo
84
- ),
85
- initPayment: t(
86
- e.initPayment
87
- ),
88
- showPaymentMethod: t(
89
- e.showPaymentMethod
90
- ),
91
- getDefaultPaymentMethod: t(
92
- e.getDefaultPaymentMethod
93
- ),
94
- startBeaconDiscovery: t(
95
- e.startBeaconDiscovery
96
- ),
97
- stopBeaconDiscovery: t(
98
- e.stopBeaconDiscovery
99
- ),
100
- getBeaconDiscoveryStatus: t(
101
- e.getBeaconDiscoveryStatus
102
- ),
103
- onBeaconDiscovery: e.onBeaconDiscovery,
104
- offBeaconDiscovery: e.offBeaconDiscovery,
105
- bioMetrics: {
106
- localAuth: t(
107
- e.bioMetrics.localAuth
108
- ),
109
- isSupported: t(
110
- e.bioMetrics.isSupported
111
- ),
112
- keyExists: t(
113
- e.bioMetrics.keyExists
114
- ),
115
- createKey: t(
116
- e.bioMetrics.createKey
117
- ),
118
- createSignature: t(
119
- e.bioMetrics.createSignature
120
- ),
121
- deleteKey: t(
122
- e.bioMetrics.deleteKey
123
- )
124
- }
125
- }, r = e;
126
- export {
127
- r as apis,
128
- s as apisAsync,
129
- e as apisSync
130
- };
package/dist/async.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { apisAsync } from './api';
2
- export default apisAsync;
package/dist/async.js DELETED
@@ -1,4 +0,0 @@
1
- import { apisAsync as o } from "./api/index.js";
2
- export {
3
- o as default
4
- };
package/dist/global.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { IVsf } from './types/vsf';
2
- declare global {
3
- interface Window {
4
- vsf: IVsf;
5
- }
6
- }
7
- export {};
package/dist/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import { apis, apisAsync, apisSync } from './api';
2
- export type * from './types/api';
3
- export type * from './types/common';
4
- export { apis, apisAsync, apisSync };
5
- export default apis;
package/dist/index.js DELETED
@@ -1,8 +0,0 @@
1
- import { apis as a } from "./api/index.js";
2
- import { apisAsync as s, apisSync as i } from "./api/index.js";
3
- export {
4
- a as apis,
5
- s as apisAsync,
6
- i as apisSync,
7
- a as default
8
- };
@@ -1,15 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../common';
2
- /**
3
- * Tham số để hiển thị hộp thoại alert
4
- */
5
- export type IVsfAlertOptions = {
6
- /** Tiêu đề của hộp thoại */
7
- title?: string;
8
- /** Nội dung của hộp thoại */
9
- content?: string;
10
- /** Text hiển thị trên nút bấm */
11
- buttonText?: string;
12
- };
13
- export type IVsfAlertOptionsWithCallback = IVsfOptionsWithCallback<IVsfAlertOptions, void>;
14
- export type IVsfAlert = (options?: IVsfAlertOptionsWithCallback) => void;
15
- export type IVsfAlertAsync = (options?: IVsfAlertOptions) => Promise<void>;
@@ -1,15 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../../common';
2
- /**
3
- * Kết quả trả về khi tạo key sinh trắc học
4
- */
5
- export type IVsfBioMetricsCreateKeyData = {
6
- /** Public key được tạo */
7
- publicKey: string;
8
- };
9
- /**
10
- * Tham số để tạo key sinh trắc học
11
- */
12
- export type IVsfBioMetricsCreateKeyOptions = void;
13
- export type IVsfBioMetricsCreateKeyOptionsWithCallback = IVsfOptionsWithCallback<IVsfBioMetricsCreateKeyOptions, IVsfBioMetricsCreateKeyData>;
14
- export type IVsfBioMetricsCreateKey = (options: IVsfBioMetricsCreateKeyOptionsWithCallback) => void;
15
- export type IVsfBioMetricsCreateKeyAsync = (options: IVsfBioMetricsCreateKeyOptions) => Promise<IVsfBioMetricsCreateKeyData>;
@@ -1,20 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../../common';
2
- /**
3
- * Kết quả trả về khi tạo chữ ký sinh trắc học
4
- */
5
- export type IVsfBioMetricsCreateSignatureData = {
6
- /** Chữ ký được tạo */
7
- signature: string;
8
- };
9
- /**
10
- * Tham số để tạo chữ ký sinh trắc học
11
- */
12
- export type IVsfBioMetricsCreateSignatureOptions = {
13
- /** Chuỗi challenge để ký */
14
- challenge: string;
15
- /** Nội dung cần ký */
16
- content: string;
17
- };
18
- export type IVsfBioMetricsCreateSignatureOptionsWithCallback = IVsfOptionsWithCallback<IVsfBioMetricsCreateSignatureOptions, IVsfBioMetricsCreateSignatureData>;
19
- export type IVsfBioMetricsCreateSignature = (options: IVsfBioMetricsCreateSignatureOptionsWithCallback) => void;
20
- export type IVsfBioMetricsCreateSignatureAsync = (options: IVsfBioMetricsCreateSignatureOptions) => Promise<IVsfBioMetricsCreateSignatureData>;
@@ -1,12 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../../common';
2
- /**
3
- * Kết quả trả về khi xóa key sinh trắc học (true nếu thành công)
4
- */
5
- export type IVsfBioMetricsDeleteKeyData = boolean;
6
- /**
7
- * Tham số để xóa key sinh trắc học
8
- */
9
- export type IVsfBioMetricsDeleteKeyOptions = void;
10
- export type IVsfBioMetricsDeleteKeyOptionsWithCallback = IVsfOptionsWithCallback<IVsfBioMetricsDeleteKeyOptions, IVsfBioMetricsDeleteKeyData>;
11
- export type IVsfBioMetricsDeleteKey = (options: IVsfBioMetricsDeleteKeyOptionsWithCallback) => void;
12
- export type IVsfBioMetricsDeleteKeyAsync = (options: IVsfBioMetricsDeleteKeyOptions) => Promise<IVsfBioMetricsDeleteKeyData>;
@@ -1,6 +0,0 @@
1
- export * from './local-auth';
2
- export * from './is-supported';
3
- export * from './key-exists';
4
- export * from './create-key';
5
- export * from './create-signature';
6
- export * from './delete-key';
@@ -1,19 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../../common';
2
- /**
3
- * Kết quả trả về kiểm tra hỗ trợ sinh trắc học
4
- */
5
- export type IVsfBioMetricsIsSupportedData = {
6
- /** Thiết bị có hỗ trợ sinh trắc học hay không */
7
- isSupported: boolean;
8
- /** Chế độ sinh trắc học: 'fingerprint' hoặc 'facial' (chỉ có trên iOS, Android không trả về) */
9
- mode?: string;
10
- /** Thông báo lỗi nếu có */
11
- error?: string;
12
- };
13
- /**
14
- * Tham số để kiểm tra hỗ trợ sinh trắc học
15
- */
16
- export type IVsfBioMetricsIsSupportedOptions = void;
17
- export type IVsfBioMetricsIsSupportedOptionsWithCallback = IVsfOptionsWithCallback<IVsfBioMetricsIsSupportedOptions, IVsfBioMetricsIsSupportedData>;
18
- export type IVsfBioMetricsIsSupported = (options: IVsfBioMetricsIsSupportedOptionsWithCallback) => void;
19
- export type IVsfBioMetricsIsSupportedAsync = (options: IVsfBioMetricsIsSupportedOptions) => Promise<IVsfBioMetricsIsSupportedData>;
@@ -1,12 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../../common';
2
- /**
3
- * Kết quả trả về kiểm tra key sinh trắc học tồn tại (true nếu tồn tại)
4
- */
5
- export type IVsfBioMetricsKeyExistsData = boolean;
6
- /**
7
- * Tham số để kiểm tra key sinh trắc học tồn tại
8
- */
9
- export type IVsfBioMetricsKeyExistsOptions = void;
10
- export type IVsfBioMetricsKeyExistsOptionsWithCallback = IVsfOptionsWithCallback<IVsfBioMetricsKeyExistsOptions, IVsfBioMetricsKeyExistsData>;
11
- export type IVsfBioMetricsKeyExists = (options: IVsfBioMetricsKeyExistsOptionsWithCallback) => void;
12
- export type IVsfBioMetricsKeyExistsAsync = (options: IVsfBioMetricsKeyExistsOptions) => Promise<IVsfBioMetricsKeyExistsData>;
@@ -1,15 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../../common';
2
- /**
3
- * Kết quả trả về xác thực sinh trắc học (true nếu thành công)
4
- */
5
- export type IVsfBioMetricsLocalAuthData = boolean;
6
- /**
7
- * Tham số để xác thực sinh trắc học
8
- */
9
- export type IVsfBioMetricsLocalAuthOptions = {
10
- /** Nội dung hiển thị khi yêu cầu xác thực */
11
- content: string;
12
- };
13
- export type IVsfBioMetricsLocalAuthOptionsWithCallback = IVsfOptionsWithCallback<IVsfBioMetricsLocalAuthOptions, IVsfBioMetricsLocalAuthData>;
14
- export type IVsfBioMetricsLocalAuth = (options: IVsfBioMetricsLocalAuthOptionsWithCallback) => void;
15
- export type IVsfBioMetricsLocalAuthAsync = (options: IVsfBioMetricsLocalAuthOptions) => Promise<IVsfBioMetricsLocalAuthData>;
@@ -1,42 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../common';
2
- /**
3
- * Thông tin chi tiết của một ảnh được chọn
4
- */
5
- export type IVsfChooseImageTempFile = {
6
- /** Đường dẫn tạm thời của ảnh */
7
- path: string;
8
- /** Dung lượng của ảnh. Đơn vị tính: byte */
9
- size: number;
10
- /** Chiều rộng của ảnh. Đơn vị tính: pixel */
11
- width: number;
12
- /** Chiều cao của ảnh. Đơn vị tính: pixel */
13
- height: number;
14
- /** Base64 data của image nếu trong request có includeBase64 */
15
- data?: string;
16
- };
17
- /**
18
- * Kết quả trả về khi chọn ảnh
19
- */
20
- export type IVsfChooseImageData = {
21
- /** Đường dẫn của các ảnh được chọn. Sử dụng đường dẫn này để display image hoặc upload */
22
- filePaths: Array<string>;
23
- /** Danh sách các ảnh được chọn cùng với các thông tin như path, size, width, height, ... */
24
- tempFiles: Array<IVsfChooseImageTempFile>;
25
- };
26
- export type IVsfChooseImageOptions = {
27
- /**
28
- * Số lượng tối đa ảnh có thể chọn. Mặc định là 1
29
- */
30
- count?: number;
31
- /**
32
- * Mặc định chỉ trả về filePath, nếu field này được enable sẽ có thêm data là base 64 trong kết quả trả về
33
- */
34
- includeBase64?: boolean;
35
- /**
36
- * Chụp hình bằng camera hay lấy hình từ album. Mặc định là cả 2. ['camera, 'album']
37
- */
38
- sourceType?: Array<'camera' | 'album'>;
39
- };
40
- export type IVsfChooseImageOptionsWithCallback = IVsfOptionsWithCallback<IVsfChooseImageOptions, IVsfChooseImageData>;
41
- export type IVsfChooseImage = (options?: IVsfChooseImageOptionsWithCallback) => void;
42
- export type IVsfChooseImageAsync = (options?: IVsfChooseImageOptions) => Promise<IVsfChooseImageData>;
@@ -1,8 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../common';
2
- /**
3
- * Tham số để xóa toàn bộ dữ liệu trong storage
4
- */
5
- export type IVsfClearStorageOptions = void;
6
- export type IVsfClearStorageOptionsWithCallback = IVsfOptionsWithCallback<IVsfClearStorageOptions, void>;
7
- export type IVsfClearStorage = (options: IVsfClearStorageOptionsWithCallback) => void;
8
- export type IVsfClearStorageAsync = (options: IVsfClearStorageOptions) => Promise<void>;
@@ -1,19 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../../common';
2
- /**
3
- * Input upload file
4
- */
5
- export type IVsfCloudUploadFileOptions = {
6
- /** Loại file */
7
- fileType: string;
8
- /** Tên file */
9
- fileName: string;
10
- /** Đường dẫn của file */
11
- filePath: string;
12
- };
13
- /**
14
- * Kết quả trả về khi upload file
15
- */
16
- export type IVsfCloudUploadFileData = any;
17
- export type IVsfCloudUploadFileOptionsWithCallback = IVsfOptionsWithCallback<IVsfCloudUploadFileOptions, IVsfCloudUploadFileData>;
18
- export type IVsfCloudUploadFile = (options: IVsfCloudUploadFileOptionsWithCallback) => void;
19
- export type IVsfCloudUploadFileAsync = (options: IVsfCloudUploadFileOptions) => Promise<IVsfCloudUploadFileData>;
@@ -1,29 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../common';
2
- /**
3
- * Tùy chọn nén ảnh
4
- */
5
- export type IVsfCompressImageOptions = {
6
- /** Chất lượng ảnh sau khi nén (0-100) */
7
- quality?: number;
8
- /** Chiều rộng tối đa của ảnh sau khi nén (pixel) */
9
- maxWidth?: number;
10
- };
11
- /**
12
- * Kết quả trả về sau khi nén ảnh
13
- */
14
- export type IVsfCompressImageData = {
15
- /** Danh sách đường dẫn các ảnh đã nén */
16
- filePaths: Array<string>;
17
- };
18
- /**
19
- * Tham số để nén ảnh
20
- */
21
- export type IVsfCompressImageOptionsParam = {
22
- /** Danh sách đường dẫn các ảnh cần nén */
23
- filePaths: Array<string>;
24
- /** Tùy chọn nén */
25
- options?: IVsfCompressImageOptions;
26
- };
27
- export type IVsfCompressImageOptionsWithCallback = IVsfOptionsWithCallback<IVsfCompressImageOptionsParam, IVsfCompressImageData>;
28
- export type IVsfCompressImage = (options: IVsfCompressImageOptionsWithCallback) => void;
29
- export type IVsfCompressImageAsync = (options: IVsfCompressImageOptionsParam) => Promise<IVsfCompressImageData>;
@@ -1,24 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../common';
2
- /**
3
- * Kết quả trả về khi người dùng tương tác với hộp thoại confirm
4
- */
5
- export type IVsfConfirmData = {
6
- /** true nếu người dùng bấm nút xác nhận, false nếu bấm hủy */
7
- confirm: boolean;
8
- };
9
- /**
10
- * Tham số để hiển thị hộp thoại confirm
11
- */
12
- export type IVsfConfirmOptions = {
13
- /** Tiêu đề của hộp thoại */
14
- title?: string;
15
- /** Nội dung của hộp thoại */
16
- content?: string;
17
- /** Text hiển thị trên nút xác nhận */
18
- confirmButtonText?: string;
19
- /** Text hiển thị trên nút hủy */
20
- cancelButtonText?: string;
21
- };
22
- export type IVsfConfirmOptionsWithCallback = IVsfOptionsWithCallback<IVsfConfirmOptions, IVsfConfirmData>;
23
- export type IVsfConfirm = (options?: IVsfConfirmOptionsWithCallback) => void;
24
- export type IVsfConfirmAsync = (options?: IVsfConfirmOptions) => Promise<IVsfConfirmData>;
@@ -1,20 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../common';
2
- /**
3
- * Kết quả trả về khi download file thành công
4
- */
5
- export type IVsfDownloadFileData = {
6
- /** Đường dẫn của file sau khi download */
7
- filePath: string;
8
- };
9
- /**
10
- * Tham số để cấu hình việc download file
11
- */
12
- export type IVsfDownloadFileOptions = {
13
- /** Đường dẫn của file muốn download */
14
- url: string;
15
- /** Cấu hình headers khi thực hiện gọi network */
16
- headers?: Record<string, string>;
17
- };
18
- export type IVsfDownloadFileOptionsWithCallback = IVsfOptionsWithCallback<IVsfDownloadFileOptions, IVsfDownloadFileData>;
19
- export type IVsfDownloadFile = (options: IVsfDownloadFileOptionsWithCallback) => void;
20
- export type IVsfDownloadFileAsync = (options: IVsfDownloadFileOptions) => Promise<IVsfDownloadFileData>;
@@ -1,8 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../common';
2
- /**
3
- * Tham số để thoát khỏi miniapp
4
- */
5
- export type IVsfExitMiniAppOptions = void;
6
- export type IVsfExitMiniAppOptionsWithCallback = IVsfOptionsWithCallback<IVsfExitMiniAppOptions, void>;
7
- export type IVsfExitMiniApp = (options: IVsfExitMiniAppOptionsWithCallback) => void;
8
- export type IVsfExitMiniAppAsync = (options: IVsfExitMiniAppOptions) => Promise<void>;
@@ -1,26 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../common';
2
- /**
3
- * Các scope quyền có thể yêu cầu: profile, phone, email
4
- */
5
- export type IVsfGetAuthCodeAuthScope = 'profile' | 'phone' | 'email';
6
- /**
7
- * Kết quả trả về khi lấy auth code
8
- */
9
- export type IVsfGetAuthCodeData = {
10
- /** Mã xác thực */
11
- authCode: string;
12
- /** Các scope bị lỗi và lý do */
13
- authErrorScopes?: Record<IVsfGetAuthCodeAuthScope, string>;
14
- /** Các scope được cấp quyền thành công */
15
- authSuccessScopes: IVsfGetAuthCodeAuthScope[];
16
- };
17
- /**
18
- * Tham số để lấy auth code
19
- */
20
- export type IVsfGetAuthCodeOptions = {
21
- /** Danh sách các scope quyền cần yêu cầu */
22
- scopes?: IVsfGetAuthCodeAuthScope[];
23
- };
24
- export type IVsfGetAuthCodeOptionsWithCallback = IVsfOptionsWithCallback<IVsfGetAuthCodeOptions, IVsfGetAuthCodeData>;
25
- export type IVsfGetAuthCode = (options?: IVsfGetAuthCodeOptionsWithCallback) => void;
26
- export type IVsfGetAuthCodeAsync = (options?: IVsfGetAuthCodeOptions) => Promise<IVsfGetAuthCodeData>;
@@ -1,13 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../common';
2
- /**
3
- * Kết quả trả về khi lấy trạng thái Beacon Discovery
4
- * Trạng thái hiện tại: initializing - đang khởi tạo, started - đã bắt đầu, stopped - đã dừng
5
- */
6
- export type IVsfGetBeaconDiscoveryStatusData = 'initializing' | 'started' | 'stopped';
7
- /**
8
- * Tham số để lấy trạng thái Beacon Discovery hiện tại
9
- */
10
- export type IVsfGetBeaconDiscoveryStatusOptions = void;
11
- export type IVsfGetBeaconDiscoveryStatusOptionsWithCallback = IVsfOptionsWithCallback<IVsfGetBeaconDiscoveryStatusOptions, IVsfGetBeaconDiscoveryStatusData>;
12
- export type IVsfGetBeaconDiscoveryStatus = (options: IVsfGetBeaconDiscoveryStatusOptionsWithCallback) => void;
13
- export type IVsfGetBeaconDiscoveryStatusAsync = (options: IVsfGetBeaconDiscoveryStatusOptions) => Promise<IVsfGetBeaconDiscoveryStatusData>;
@@ -1,15 +0,0 @@
1
- import { IVsfOptionsWithCallback } from '../common';
2
- /**
3
- * Kết quả trả về khi lấy nội dung từ clipboard
4
- */
5
- export type IVsfGetClipboardData = {
6
- /** Nội dung text trong clipboard */
7
- text: string;
8
- };
9
- /**
10
- * Tham số để lấy nội dung từ clipboard
11
- */
12
- export type IVsfGetClipboardOptions = void;
13
- export type IVsfGetClipboardOptionsWithCallback = IVsfOptionsWithCallback<IVsfGetClipboardOptions, IVsfGetClipboardData>;
14
- export type IVsfGetClipboard = (options: IVsfGetClipboardOptionsWithCallback) => void;
15
- export type IVsfGetClipboardAsync = (options: IVsfGetClipboardOptions) => Promise<IVsfGetClipboardData>;