@v-miniapp/apis 1.0.11

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 +60 -0
  2. package/dist/api/index.d.ts +101 -0
  3. package/dist/api/index.js +130 -0
  4. package/dist/async.d.ts +2 -0
  5. package/dist/async.js +4 -0
  6. package/dist/global.d.ts +7 -0
  7. package/dist/index.d.ts +5 -0
  8. package/dist/index.js +8 -0
  9. package/dist/types/api/alert.d.ts +15 -0
  10. package/dist/types/api/bio-metrics/create-key.d.ts +15 -0
  11. package/dist/types/api/bio-metrics/create-signature.d.ts +20 -0
  12. package/dist/types/api/bio-metrics/delete-key.d.ts +12 -0
  13. package/dist/types/api/bio-metrics/index.d.ts +6 -0
  14. package/dist/types/api/bio-metrics/is-supported.d.ts +19 -0
  15. package/dist/types/api/bio-metrics/key-exists.d.ts +12 -0
  16. package/dist/types/api/bio-metrics/local-auth.d.ts +15 -0
  17. package/dist/types/api/choose-image.d.ts +42 -0
  18. package/dist/types/api/clear-storage.d.ts +8 -0
  19. package/dist/types/api/cloud/upload-file.d.ts +19 -0
  20. package/dist/types/api/compress-image.d.ts +29 -0
  21. package/dist/types/api/confirm.d.ts +24 -0
  22. package/dist/types/api/download-file.d.ts +20 -0
  23. package/dist/types/api/exit-miniapp.d.ts +8 -0
  24. package/dist/types/api/get-auth-code.d.ts +26 -0
  25. package/dist/types/api/get-beacon-discovery-status.d.ts +13 -0
  26. package/dist/types/api/get-clipboard.d.ts +15 -0
  27. package/dist/types/api/get-default-payment-method.d.ts +16 -0
  28. package/dist/types/api/get-image-info.d.ts +30 -0
  29. package/dist/types/api/get-location.d.ts +32 -0
  30. package/dist/types/api/get-setting.d.ts +15 -0
  31. package/dist/types/api/get-storage-info.d.ts +19 -0
  32. package/dist/types/api/get-storage.d.ts +19 -0
  33. package/dist/types/api/get-system-info.d.ts +52 -0
  34. package/dist/types/api/get-user-info.d.ts +21 -0
  35. package/dist/types/api/hide-loading.d.ts +8 -0
  36. package/dist/types/api/index.d.ts +43 -0
  37. package/dist/types/api/init-payment.d.ts +88 -0
  38. package/dist/types/api/make-phone-call.d.ts +11 -0
  39. package/dist/types/api/off-beacon-discovery.d.ts +2 -0
  40. package/dist/types/api/on-beacon-discovery.d.ts +15 -0
  41. package/dist/types/api/open-app-setting.d.ts +8 -0
  42. package/dist/types/api/open-native-app-store.d.ts +20 -0
  43. package/dist/types/api/open-setting.d.ts +15 -0
  44. package/dist/types/api/preview-image.d.ts +17 -0
  45. package/dist/types/api/prompt.d.ts +31 -0
  46. package/dist/types/api/remove-storage.d.ts +11 -0
  47. package/dist/types/api/request.d.ts +29 -0
  48. package/dist/types/api/save-image.d.ts +11 -0
  49. package/dist/types/api/scan.d.ts +14 -0
  50. package/dist/types/api/set-clipboard.d.ts +11 -0
  51. package/dist/types/api/set-storage.d.ts +17 -0
  52. package/dist/types/api/share-app.d.ts +18 -0
  53. package/dist/types/api/show-action-sheet.d.ts +22 -0
  54. package/dist/types/api/show-loading.d.ts +11 -0
  55. package/dist/types/api/show-payment-method.d.ts +40 -0
  56. package/dist/types/api/show-toast.d.ts +21 -0
  57. package/dist/types/api/start-beacon-discovery.d.ts +11 -0
  58. package/dist/types/api/stop-beacon-discovery.d.ts +8 -0
  59. package/dist/types/api/upload-file.d.ts +29 -0
  60. package/dist/types/common.d.ts +12 -0
  61. package/dist/types/vsf.d.ts +664 -0
  62. package/dist/utils/api.d.ts +4 -0
  63. package/dist/utils/api.js +10 -0
  64. package/package.json +45 -0
@@ -0,0 +1,11 @@
1
+ import { IVsfOptionsWithCallback } from '../common';
2
+ /**
3
+ * Tham số để hiển thị loading
4
+ */
5
+ export type IVsfShowLoadingOptions = {
6
+ /** Nội dung hiển thị kèm loading */
7
+ content?: string;
8
+ };
9
+ export type IVsfShowLoadingOptionsWithCallback = IVsfOptionsWithCallback<IVsfShowLoadingOptions, void>;
10
+ export type IVsfShowLoading = (options?: IVsfShowLoadingOptionsWithCallback) => void;
11
+ export type IVsfShowLoadingAsync = (options?: IVsfShowLoadingOptions) => Promise<void>;
@@ -0,0 +1,40 @@
1
+ import { IVsfOptionsWithCallback } from '../common';
2
+ /**
3
+ * Thông tin phương thức thanh toán
4
+ */
5
+ export type IVsfPaymentMethod = {
6
+ /** Danh mục phương thức thanh toán */
7
+ category?: string;
8
+ /** Mã phương thức thanh toán */
9
+ code: string;
10
+ /** Loại phương thức thanh toán */
11
+ type: string;
12
+ /** URL icon */
13
+ iconUrl?: string;
14
+ /** Tên phương thức thanh toán */
15
+ name: string;
16
+ /** ID nhà cung cấp */
17
+ providerId: string;
18
+ /** Tên nhà cung cấp */
19
+ providerName: string;
20
+ /** ID phương thức thanh toán */
21
+ paymentMethodId: string;
22
+ /** ID phương thức thanh toán của người dùng */
23
+ userPaymentMethodId?: string;
24
+ };
25
+ /**
26
+ * Kết quả trả về khi người dùng chọn phương thức thanh toán (mảng các phương thức)
27
+ */
28
+ export type IVsfShowPaymentMethodData = IVsfPaymentMethod[];
29
+ /**
30
+ * Tham số để hiển thị danh sách phương thức thanh toán
31
+ */
32
+ export type IVsfShowPaymentMethodOptions = {
33
+ /** API key thanh toán */
34
+ paymentApiKey: string;
35
+ /** Số tiền thanh toán */
36
+ amount?: number;
37
+ };
38
+ export type IVsfShowPaymentMethodOptionsWithCallback = IVsfOptionsWithCallback<IVsfShowPaymentMethodOptions, IVsfShowPaymentMethodData>;
39
+ export type IVsfShowPaymentMethod = (options: IVsfShowPaymentMethodOptionsWithCallback) => void;
40
+ export type IVsfShowPaymentMethodAsync = (options: IVsfShowPaymentMethodOptions) => Promise<IVsfShowPaymentMethodData>;
@@ -0,0 +1,21 @@
1
+ import { IVsfOptionsWithCallback } from '../common';
2
+ /**
3
+ * Tham số để hiển thị toast
4
+ */
5
+ export type IVsfShowToastOptions = {
6
+ /** Loại toast (success, fail, none, ...) */
7
+ type?: 'success' | 'fail' | 'info';
8
+ /** Nội dung hiển thị */
9
+ content?: string;
10
+ /** Text hiển thị trên nút */
11
+ buttonText?: string;
12
+ /** Thời gian hiển thị toast (ms) */
13
+ duration?: number;
14
+ /** Vị trí hiển thị. Mặc định: top */
15
+ position?: 'top' | 'bottom';
16
+ /** Hiển thị close button. Mặc định: true */
17
+ showCloseButton?: boolean;
18
+ };
19
+ export type IVsfShowToastOptionsWithCallback = IVsfOptionsWithCallback<IVsfShowToastOptions, void>;
20
+ export type IVsfShowToast = (options?: IVsfShowToastOptionsWithCallback) => void;
21
+ export type IVsfShowToastAsync = (options?: IVsfShowToastOptions) => Promise<void>;
@@ -0,0 +1,11 @@
1
+ import { IVsfOptionsWithCallback } from '../common';
2
+ /**
3
+ * Tham số để bắt đầu quét các thiết bị beacons.
4
+ * Cần người dùng cấp quyền truy cập Bluetooth và Location.
5
+ */
6
+ export type IVsfStartBeaconDiscoveryOptions = {
7
+ UUID?: string;
8
+ };
9
+ export type IVsfStartBeaconDiscoveryOptionsWithCallback = IVsfOptionsWithCallback<IVsfStartBeaconDiscoveryOptions, void>;
10
+ export type IVsfStartBeaconDiscovery = (options?: IVsfStartBeaconDiscoveryOptionsWithCallback) => void;
11
+ export type IVsfStartBeaconDiscoveryAsync = (options?: IVsfStartBeaconDiscoveryOptions) => Promise<void>;
@@ -0,0 +1,8 @@
1
+ import { IVsfOptionsWithCallback } from '../common';
2
+ /**
3
+ * Tham số để dừng việc quét các thiết bị beacons
4
+ */
5
+ export type IVsfStopBeaconDiscoveryOptions = void;
6
+ export type IVsfStopBeaconDiscoveryOptionsWithCallback = IVsfOptionsWithCallback<IVsfStopBeaconDiscoveryOptions, void>;
7
+ export type IVsfStopBeaconDiscovery = (options: IVsfStopBeaconDiscoveryOptionsWithCallback) => void;
8
+ export type IVsfStopBeaconDiscoveryAsync = (options: IVsfStopBeaconDiscoveryOptions) => Promise<void>;
@@ -0,0 +1,29 @@
1
+ import { IVsfOptionsWithCallback } from '../common';
2
+ /**
3
+ * Kết quả trả về khi upload file thành công
4
+ */
5
+ export type IVsfUploadFileData = any;
6
+ /**
7
+ * Tham số để cấu hình việc upload file
8
+ */
9
+ export type IVsfUploadFileOptions = {
10
+ /** Đường dẫn của server muốn upload */
11
+ url: string;
12
+ /** Phương thức gọi network. Mặc định sẽ là POST */
13
+ method?: string;
14
+ /** Tên file sử dụng làm key trong form data, server sẽ lấy ra file từ field này */
15
+ fileName: string;
16
+ /** Đường dẫn tạm thời của file */
17
+ filePath?: string;
18
+ /** Trong trường hợp upload multiple files thì là mảng các đường dẫn của file */
19
+ filePaths?: Array<string>;
20
+ /** Các field khác của form cần send khi upload file */
21
+ formData?: Record<string, any>;
22
+ /** Loại file: image / video / audio */
23
+ fileType: string;
24
+ /** Cấu hình headers khi thực hiện gọi network */
25
+ headers?: Record<string, string>;
26
+ };
27
+ export type IVsfUploadFileOptionsWithCallback = IVsfOptionsWithCallback<IVsfUploadFileOptions, IVsfUploadFileData>;
28
+ export type IVsfUploadFile = (options: IVsfUploadFileOptionsWithCallback) => void;
29
+ export type IVsfUploadFileAsync = (options: IVsfUploadFileOptions) => Promise<IVsfUploadFileData>;
@@ -0,0 +1,12 @@
1
+ export type IVsfOptionsWithCallback<Options = void, Success = any, Error = any> = Options extends void ? void | {
2
+ success?: (res: Success) => void;
3
+ fail?: (error: Error) => void;
4
+ complete?: (error: Error) => void;
5
+ } : Options & {
6
+ success?: (res: Success) => void;
7
+ fail?: (error: Error) => void;
8
+ complete?: (error: Error) => void;
9
+ };
10
+ export type IVsfPlatform = 'ios' | 'android' | 'macos' | 'windows' | 'web' | 'native' | ({} & string);
11
+ export type IVsfSystem = 'Android' | 'iOS' | 'iPhone OS' | 'iPadOS' | ({} & string);
12
+ export type IVsfLocale = 'en' | 'vi' | ({} & string);