zmp-sdk 2.46.0-beta.1 → 2.46.0-beta.2

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/index.d.ts CHANGED
@@ -2036,7 +2036,15 @@ type GetStorageReturns = {
2036
2036
  [key: string]: any;
2037
2037
  };
2038
2038
  type StorageInfo = {
2039
+ /**
2040
+ * Không gian hiện tại bị chiếm (tính bằng KB)
2041
+ * @minimumVersion 2.43.0
2042
+ */
2039
2043
  currentSize: number;
2044
+ /**
2045
+ * Giới hạn kích thước không gian (tính bằng KB)
2046
+ * @minimumVersion 2.43.0
2047
+ */
2040
2048
  limitSize: number;
2041
2049
  };
2042
2050
  type RemoveStorageReturns = {
@@ -2289,11 +2297,11 @@ type ChooseImageReturns = {
2289
2297
  /**
2290
2298
  * Đường dẫn các file đã chọn.
2291
2299
  */
2292
- filePaths: Array<string>;
2300
+ filePaths: string[];
2293
2301
  /**
2294
2302
  * Thông tin các temp files.
2295
2303
  */
2296
- tempFiles: Array<TempFile>;
2304
+ tempFiles: TempFile[];
2297
2305
  };
2298
2306
  type CreateOrderReturns = {
2299
2307
  orderId: string;
@@ -2330,13 +2338,13 @@ type GetSettingReturn = {
2330
2338
  /**
2331
2339
  * Thông tin cấp quyền, tham khảo bảng Scopes.
2332
2340
  *
2333
- * | Scope | Corresponding APIs | Description |
2334
- * |-----------------------|------------------------------------------------------------------|---------------------------------|
2335
- * | scope.userInfo | [getUserInfo](../user-information/getUserInfo.md) | Thông tin user (tên, avatar...) |
2336
- * | scope.userLocation | [getLocation](../../location/getLocation.md) | Thông tin vị trí user |
2337
- * | scope.userPhonenumber | [getPhoneNumber](../user-information/getPhoneNumber.md) | Số điện thoại |
2338
- * | scope.camera | [createCameraContext](../../media/camera/createCameraContext.md) | Camera |
2339
- * | scope.micro | [createCameraContext](../../media/camera/createCameraContext.md) | Micro |
2341
+ * | Scope | Corresponding APIs | Description |
2342
+ * | --------------------- | --------------------- | ------------------------------- |
2343
+ * | scope.userInfo | `getUserInfo` | Thông tin user (tên, avatar...) |
2344
+ * | scope.userLocation | `getLocation` | Thông tin vị trí user |
2345
+ * | scope.userPhonenumber | `getPhoneNumber` | Số điện thoại |
2346
+ * | scope.camera | `createCameraContext` | Camera |
2347
+ * | scope.micro | `createCameraContext` | Micro |
2340
2348
  *
2341
2349
  * Với các scope có giá trị trả về là `true`, tương ứng với việc người dùng đã cấp quyền sử dụng API trước đó, Mini Apps có thể truy xuất thông tin một cách trực tiếp.
2342
2350
  */
@@ -2399,7 +2407,7 @@ type PhotoConstraint = {
2399
2407
  minScreenshotHeight?: number;
2400
2408
  };
2401
2409
 
2402
- /***
2410
+ /**
2403
2411
  * Lấy thông tin của cache theo cơ chế đồng bộ.
2404
2412
  *
2405
2413
  * @minimumVersion 2.43.0
@@ -2421,7 +2429,7 @@ declare const removeItemArgs: ZodString[];
2421
2429
  * @minimumVersion 2.43.0
2422
2430
  * @behavior Ở môi trường phát triển, nhóm API Native Storage sẽ fallback về Local Storage để lưu trữ dữ liệu. Khi chạy bên trong ứng dụng Zalo mobile, Native Storage lưu trữ dữ liệu trong bộ nhớ của ứng dụng Zalo.
2423
2431
  *
2424
- * @param {string} key Tên khóa của dữ liệu cần lấy
2432
+ * @param {string} key Tên khóa của dữ liệu cần xoá
2425
2433
  *
2426
2434
  * @example Xoá từ khoá tìm kiếm cũ khỏi bộ nhớ:
2427
2435
  * ```ts
@@ -2631,8 +2639,7 @@ declare function login(args?: AsyncCallback<string>): Promise<string>;
2631
2639
  * @important Cập nhật
2632
2640
  * Từ phiên bản SDK 2.35.0, ứng dụng mặc định có quyền truy xuất access tokens mà không cần người dùng xác nhận đồng ý. Thông qua access tokens này, ứng dụng chỉ có thể xuất ID người sử dụng. Nếu ứng dụng có nhu cầu sử dụng Tên và Ảnh đại diện, vui lòng sử dụng API authorize để yêu cầu người dùng cho phép truy cập scope.userInfo trước khi sử dụng API này. Lưu ý: Với các Zalo App có nhiều hơn 1 Mini App, hệ thống vẫn yêu cầu người dùng xác nhận khi truy xuất access tokens cho từng Mini App.
2633
2641
  *
2634
- * @param args
2635
- * @returns {string} `accessToken`
2642
+ * @returns {string} `accessToken`.
2636
2643
  * @example
2637
2644
  * ```ts
2638
2645
  * const accessToken = await getAccessToken();
@@ -2644,6 +2651,7 @@ declare function getVersion(): string;
2644
2651
 
2645
2652
  /**
2646
2653
  * API truy xuất thông tin hệ thống, thiết bị đang sử dụng.
2654
+ * @minimumVersion 2.4.0
2647
2655
  * @returns {SystemInfo} các thông tin về phiên bản, ngôn ngữ, theme của hệ thống.
2648
2656
  * @example Lấy các thông tin phiên bản:
2649
2657
  * ```ts
@@ -2845,7 +2853,7 @@ declare function getUserInfo(args?: AsyncCallback<GetUserInfoReturns> & TypeOf<(
2845
2853
  /**
2846
2854
  * API truy xuất kiểu kết nối mạng hiện tại.
2847
2855
  *
2848
- * @returns {GetNetworkTypeReturns} chứa kiểu kết nối mạng hiện tại.
2856
+ * @returns {GetNetworkTypeReturns} kiểu kết nối mạng hiện tại.
2849
2857
  *
2850
2858
  * @example Lấy kiểu kết nối mạng hiện tại:
2851
2859
  * ```ts
@@ -3023,11 +3031,11 @@ declare const openProfileArgs: ZodOptional<ZodObject<{
3023
3031
  * @minimumVersion 2.5.3
3024
3032
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
3025
3033
  *
3026
- * @param {string} type - Nhận các giá trị sau:
3034
+ * @param {"user" | "oa" | "aliasOA"} type Nhận các giá trị sau:
3027
3035
  * - `user`: Mở profile User.
3028
3036
  * - `oa`: Mở profile OA.
3029
3037
  * - `aliasOA`: Mở profile OA bằng Alias (field id truyền lên là alias của OA).
3030
- * @param {string} id - Id của User hoặc OA.
3038
+ * @param {string} id Id của User hoặc OA.
3031
3039
  *
3032
3040
  * @example Mở cửa sổ chat với người dùng:
3033
3041
  * ```ts
@@ -3188,13 +3196,13 @@ declare const openPostFeedArgs: ZodUnion<[ZodObject<{
3188
3196
  * @minimumVersion 2.5.3
3189
3197
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
3190
3198
  *
3191
- * @param {string} type - Nhận các giá trị sau:
3199
+ * @param {"image" | "link" | "profile"} type Nhận các giá trị sau:
3192
3200
  * - `image`: Chia sẻ hình ảnh.
3193
3201
  * - `link`: Chia sẻ liên kết.
3194
3202
  * - `profile`: Chia sẻ profile OA.
3195
- * @param {Object} data - Nội dung cần chia sẻ, tùy thuộc vào `type`.
3203
+ * @param {Object} data Nội dung cần chia sẻ, tùy thuộc vào `type`.
3196
3204
  *
3197
- * @returns {OpenPostFeedReturns} chứa thông tin kết quả chia sẻ.
3205
+ * @returns {OpenPostFeedReturns} thông tin kết quả chia sẻ.
3198
3206
  *
3199
3207
  * @example Chia sẻ hình ảnh:
3200
3208
  * ```ts
@@ -3247,7 +3255,7 @@ declare const followOAArgs: ZodOptional<ZodObject<{
3247
3255
  * @minimumVersion 2.5.3
3248
3256
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
3249
3257
  *
3250
- * @param {string} id - Id của Official Account cần theo dõi.
3258
+ * @param {string} id Id của Official Account cần theo dõi.
3251
3259
  *
3252
3260
  * @example Theo dõi Official Account:
3253
3261
  * ```ts
@@ -3504,17 +3512,29 @@ declare const openShareSheetArgs: ZodUnion<[ZodObject<{
3504
3512
  * @minimumVersion 2.5.3
3505
3513
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
3506
3514
  *
3507
- * @param {"image" | "link" | "oa" | "gif" | "video" | "zmp" | "zmp_deep_link"} type Nhận các giá trị sau:
3508
- * `image`: Chia sẻ hình ảnh.
3509
- * `link`: Chia sẻ liên kết.
3510
- * `oa`: Chia sẻ Official Account.
3511
- * `gif`: Chia sẻ ảnh động.
3512
- * `video`: Chia sẻ video.
3513
- * `zmp`: Chia sẻ page hiện tại của Zalo Mini App.
3514
- * `zmp_deep_link`: Chia sẻ page hiện tại của Zalo Mini App thông qua deep link (hỗ trợ từ API 2.25.7).
3515
+ * @param {"text" | "image" | "link" | "oa" | "gif" | "video" | "zmp" | "zmp_deep_link"} type Nhận các giá trị sau:
3516
+ * - `text`: Chia sẻ văn bản.
3517
+ * - `image`: Chia sẻ hình ảnh.
3518
+ * - `link`: Chia sẻ liên kết.
3519
+ * - `oa`: Chia sẻ Official Account.
3520
+ * - `gif`: Chia sẻ ảnh động.
3521
+ * - `video`: Chia sẻ video.
3522
+ * - `zmp`: Chia sẻ page hiện tại của Zalo Mini App.
3523
+ * - `zmp_deep_link`: Chia sẻ page hiện tại của Zalo Mini App thông qua deep link (hỗ trợ từ API 2.25.7).
3515
3524
  * @param {object} data Nội dung cần chia sẻ, tùy thuộc vào `type`.
3516
3525
  *
3517
- * @returns {OpenShareSheetReturns} Promise chứa thông tin kết quả chia sẻ.
3526
+ * @returns {OpenShareSheetReturns} thông tin kết quả chia sẻ.
3527
+ *
3528
+ * @example Chia sẻ văn bản:
3529
+ * ```ts
3530
+ * const data = await openShareSheet({
3531
+ * type: "text",
3532
+ * data: {
3533
+ * text: "My Zalo Mini App - HomePage",
3534
+ * },
3535
+ * });
3536
+ * console.log(data);
3537
+ * ```
3518
3538
  *
3519
3539
  * @example Chia sẻ hình ảnh:
3520
3540
  * ```ts
@@ -3625,7 +3645,7 @@ declare const createShortcutArgs: ZodOptional<ZodObject<{
3625
3645
  * @minimumVersion 2.16.3: hỗ trợ thêm params vào shortcut.
3626
3646
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
3627
3647
  *
3628
- * @param {Record<string, string>} [params] - Params cần thêm vào Zalo Mini App khi mở..
3648
+ * @param {Record<string, string>} [params] Params cần thêm vào Zalo Mini App khi mở..
3629
3649
  *
3630
3650
  * @example Tạo shortcut đơn giản:
3631
3651
  * ```ts
@@ -3690,6 +3710,8 @@ declare const showToastArgs: ZodOptional<ZodObject<{
3690
3710
  /**
3691
3711
  * API hiển thị một thông báo ngắn trên màn hình.
3692
3712
  *
3713
+ * @minimumVersion 2.5.3
3714
+ *
3693
3715
  * @param {string} message Nội dung thông báo cần hiển thị.
3694
3716
  *
3695
3717
  * @example Hiện thông báo đặt hàng thành công:
@@ -3727,7 +3749,7 @@ declare const openPhoneArgs: ZodObject<{
3727
3749
  * @minimumVersion 2.5.3
3728
3750
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
3729
3751
  *
3730
- * @param {string} phoneNumber - Số điện thoại cần gọi.
3752
+ * @param {string} phoneNumber Số điện thoại cần gọi.
3731
3753
  *
3732
3754
  * @example Mở màn hình cuộc gọi với số điện thoại cụ thể:
3733
3755
  * ```ts
@@ -4018,7 +4040,7 @@ declare const vibrateArgs: ZodObject<{
4018
4040
  *
4019
4041
  * @example Rung thiết bị trong 1 giây:
4020
4042
  * ```ts
4021
- * vibrate({
4043
+ * await vibrate({
4022
4044
  * type: "oneShot",
4023
4045
  * milliseconds: 1000
4024
4046
  * })
@@ -4195,7 +4217,7 @@ declare function sendDataToPreviousMiniApp(args: AsyncVoidCallback & TypeOf<(typ
4195
4217
  * @requirePermission Cần xin Cấp quyền sử dụng các API này cho Mini App ID tại trang Quản lý ứng dụng. Nếu không, sẽ bị [lỗi với người dùng bình thường, mặc dù Developer/Admin thì không bị](https://mini.zalo.me/community/8746968970844796879/loi-chi-xay-ra-voi-nguoi-dung-binh-thuong-con-developer-admin-thi-khong-bi).
4196
4218
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
4197
4219
  *
4198
- * @returns {GetPhoneNumberReturns} chứa token để truy xuất thông tin số điện thoại.
4220
+ * @returns {GetPhoneNumberReturns} token để truy xuất thông tin số điện thoại.
4199
4221
  *
4200
4222
  * @example
4201
4223
  * 1. Ở Zalo Mini App, gọi API này để lấy token số điện thoại:
@@ -4220,11 +4242,11 @@ declare const openProfilePickerArgs: ZodObject<{
4220
4242
  * @minimumVersion 2.16.1
4221
4243
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
4222
4244
  *
4223
- * @param {number} [maxProfile=1] - Số lượng bạn bè tối đa được chọn. Giới hạn trong khoảng 1 đến 10.
4245
+ * @param {number} [maxProfile=1] Số lượng bạn bè tối đa được chọn. Giới hạn trong khoảng 1 đến 10.
4224
4246
  *
4225
- * @returns {OpenProfilePickerReturns} chứa danh sách những bạn bè được chọn.
4247
+ * @returns {OpenProfilePickerReturns} danh sách những bạn bè được chọn.
4226
4248
  *
4227
- * @example Mở cửa sổ chọn bạn bè và lấy danh sách người dùng được chọn:
4249
+ * @example Chọn tối đa 2 bạn bè trong danh sách bạn bè của người dùng:
4228
4250
  * ```ts
4229
4251
  * const { users } = await openProfilePicker({
4230
4252
  * maxProfile: 2,
@@ -4297,7 +4319,7 @@ declare const openMediaPickerArgs: ZodObject<{
4297
4319
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
4298
4320
  *
4299
4321
  * @param {string} serverUploadUrl Đường dẫn upload media. Server phải hỗ trợ upload media qua POST và trả về kết quả dạng JSON. Xem ví dụ về server tại [đây](https://mini.zalo.me/documents/api/openMediaPicker/#server).
4300
- * @param {"photo" | "file" | "video" | "zcamera" | "zcamera_photo" | "zcamera_video" | "zcamera_scan"} typeLoại media cần chọn. Các giá trị:
4322
+ * @param {"photo" | "file" | "video" | "zcamera" | "zcamera_photo" | "zcamera_video" | "zcamera_scan"} type Loại media cần chọn. Các giá trị:
4301
4323
  * - 'photo': Mở cửa sổ chọn ảnh.
4302
4324
  * - 'file': Mở cửa sổ chọn file.
4303
4325
  * - 'video': Mở cửa sổ chọn video.
@@ -4315,7 +4337,7 @@ declare const openMediaPickerArgs: ZodObject<{
4315
4337
  * @param {boolean} [editView.enable=true] Hiển thị view chỉnh sửa ảnh.
4316
4338
  * @param {string} [editView.aspectRatio="1:1"] Cắt ảnh theo tỉ lệ đã chỉ định. Tỉ lệ truyền vào theo format `width:height` (phân số tối giản quy định tỉ lệ width/height).
4317
4339
  *
4318
- * @returns {OpenMediaPickerReturns} chứa kết quả trả về.
4340
+ * @returns {OpenMediaPickerReturns} kết quả trả về.
4319
4341
  *
4320
4342
  * @example Mở cửa sổ chọn ảnh nhận kết quả trả về dạng JSON:
4321
4343
  * ```ts
@@ -4416,6 +4438,7 @@ declare function getDeviceId(): string;
4416
4438
 
4417
4439
  /**
4418
4440
  * API trả về chuỗi Device ID của thiết bị đã được hash. Các tài khoản người dùng khác nhau đăng nhập trên cùng 1 thiết bị và sử dụng cùng 1 Mini App (hoặc các Mini App có chung Zalo App ID) sẽ có giá trị Device ID giống nhau. Nếu không lấy được Device ID thì giá trị trả về là `unknown`.
4441
+ * @minimumVersion 2.20.0
4419
4442
  * @returns {string} chuỗi Device ID của thiết bị đã được hash.
4420
4443
  * @example Sử dụng kết hợp với `await`:
4421
4444
  * ```ts
@@ -4430,6 +4453,8 @@ declare function getContext(): ContextInfo | null;
4430
4453
  * API trả về thông tin ngữ cảnh của người dùng hoặc nhóm khi Mini App được mở từ Menu mở rộng trong cửa sổ chat Zalo.
4431
4454
  * Nếu ngữ cảnh không hợp lệ hoặc phiên bản Zalo không hỗ trợ, giá trị trả về sẽ rỗng.
4432
4455
  *
4456
+ * @minimumVersion Zalo Android: 22.06.02
4457
+ * @minimumVersion ZMP SDK: 2.22.0
4433
4458
  * @returns {ContextInfo} ngữ cảnh hiện tại.
4434
4459
  * @example Kiểm tra ngữ cảnh hợp lệ và trả về thông tin ngữ cảnh:
4435
4460
  * ```ts
@@ -4476,9 +4501,9 @@ declare const chooseImageArgs: ZodObject<{
4476
4501
  * @minimumVersion 2.23.4
4477
4502
  *
4478
4503
  * @param {("album" | "camera")[]} [sourceType] Nguồn chọn hình ảnh. Có thể chọn từ album/tệp (`album`), chụp ảnh mới từ camera (`camera`), hoặc cả hai.
4479
- * @param {("back" | "front")} [cameraType] Xác định camera cần mở là camera trước hay sau.
4504
+ * @param {"back" | "front"} [cameraType] Xác định camera cần mở là camera trước hay sau.
4480
4505
  * @param {number} [count] Số lượng hình ảnh tối đa có thể chọn.
4481
- * @returns {ChooseImageReturns} chứa đường dẫn tới hình ảnh đã chọn.
4506
+ * @returns {ChooseImageReturns} đường dẫn tới hình ảnh đã chọn.
4482
4507
  * @example Chụp hình ảnh từ camera trước:
4483
4508
  * ```ts
4484
4509
  * const { filePaths } = await chooseImage({
@@ -4514,7 +4539,7 @@ declare function chooseImage(args: AsyncCallback<ChooseImageReturns> & TypeOf<(t
4514
4539
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
4515
4540
  * @behavior Ở môi trường phát triển, API này sẽ luôn thành công và trả về token rỗng (`""`). Khi chạy bên trong ứng dụng Zalo mobile, API này sẽ hiển thị thông báo xin cấp quyền, và trả về token hợp lệ nếu người dùng đồng ý hoặc lỗi nếu người dùng từ chối.
4516
4541
  *
4517
- * @returns {GetLocationReturns} chứa token vị trí.
4542
+ * @returns {GetLocationReturns} token vị trí.
4518
4543
  * @example
4519
4544
  * 1. Ở Zalo Mini App, gọi API này để lấy token vị trí:
4520
4545
  * ```ts
@@ -4836,7 +4861,6 @@ declare function configAppView(args: AsyncVoidCallback & TypeOf<(typeof configAp
4836
4861
  * ![Thu nhỏ ứng dụng](https://mini.zalo.me/documents/img/ZMA-Floating.png)
4837
4862
  *
4838
4863
  * @minimumVersion 2.26.1
4839
- * @requirePermission Cần xin Cấp quyền sử dụng các API này cho Mini App ID tại trang Quản lý ứng dụng. Nếu không, sẽ bị [lỗi với người dùng bình thường, mặc dù Developer/Admin thì không bị](https://mini.zalo.me/community/8746968970844796879/loi-chi-xay-ra-voi-nguoi-dung-binh-thuong-con-developer-admin-thi-khong-bi).
4840
4864
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
4841
4865
  *
4842
4866
  * @example Thu nhỏ ứng dụng:
@@ -4852,8 +4876,6 @@ declare function minimizeApp(args?: AsyncVoidCallback): Promise<void>;
4852
4876
  * @minimumVersion 2.27.1
4853
4877
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
4854
4878
  *
4855
- * @returns {Promise<void>} Promise không trả về giá trị.
4856
- *
4857
4879
  * @example Mở cửa sổ cài đặt quyền:
4858
4880
  * ```ts
4859
4881
  * await openPermissionSetting();
@@ -4917,7 +4939,7 @@ declare const interactOAArgs$1: ZodObject<{
4917
4939
  * @minimumVersion 2.28.8
4918
4940
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
4919
4941
  *
4920
- * @param {string} oaId - Id của Official Account.
4942
+ * @param {string} oaId Id của Official Account.
4921
4943
  *
4922
4944
  * @example Yêu cầu người dùng cho phép gửi thông báo thông qua Official Account:
4923
4945
  * ```ts
@@ -4960,7 +4982,7 @@ declare function checkIsAllowedInteractWithOA(args: AsyncVoidCallback & TypeOf<(
4960
4982
  * @minimumVersion 2.31.0
4961
4983
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
4962
4984
  *
4963
- * @returns {GetSettingReturn} chứa thông tin cài đặt hiện tại của người dùng.
4985
+ * @returns {GetSettingReturn} thông tin cài đặt hiện tại của người dùng.
4964
4986
  *
4965
4987
  * @example Lấy thông tin cài đặt hiện tại của người dùng:
4966
4988
  * ```ts
@@ -4977,11 +4999,6 @@ declare const authorizeArgs: ZodOptional<ZodObject<{
4977
4999
  scopes?: ("scope.userInfo" | "scope.userLocation" | "scope.userPhonenumber")[] | undefined;
4978
5000
  }>>[];
4979
5001
  /**
4980
- * @minimumVersion Zalo iOS: 23.12.02 (573)
4981
- * @minimumVersion Zalo Android: 23.12.02 (724)
4982
- * @minimumVersion ZMP SDK: 2.34.0
4983
- * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
4984
- *
4985
5002
  * ### Cấp quyền sử dụng API
4986
5003
  *
4987
5004
  * Một số API cần sự cho phép của người dùng trước khi có thể được gọi. Các API này được chia thành nhiều phạm vi (Scope) tương ứng với từng mục đích sử dụng, mô tả chi tiết tham khảo bảng Scopes:
@@ -5015,9 +5032,13 @@ declare const authorizeArgs: ZodOptional<ZodObject<{
5015
5032
  * - Chỉ khởi tạo yêu cầu cấp quyền khi cần thiết, giải thích rõ ràng lý do tại sao bạn muốn sử dụng nó trong yêu cầu cấp quyền.
5016
5033
  * - Sử dụng API `getSetting` trước để lấy trạng thái cho phép hiện tại của người dùng, sau đó yêu cầu xin cấp thêm các quyền còn thiếu.
5017
5034
  *
5018
- * @param {string[]} scopes Danh sách các quyền cần được cấp, tham khảo bảng Scopes.
5035
+ * @minimumVersion Zalo iOS: 23.12.02 (573)
5036
+ * @minimumVersion Zalo Android: 23.12.02 (724)
5037
+ * @minimumVersion ZMP SDK: 2.34.0
5038
+ * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
5019
5039
  *
5020
- * @returns {Promise<Scopes>} chứa các trạng thái của các quyền được cấp.
5040
+ * @param {string[]} scopes Danh sách các quyền cần được cấp, tham khảo bảng Scopes.
5041
+ * @returns {Scopes} các trạng thái của các quyền được cấp.
5021
5042
  * @property {boolean} scope.userInfo Trạng thái quyền thông tin user.
5022
5043
  * @property {boolean} scope.userLocation Trạng thái quyền vị trí user.
5023
5044
  * @property {boolean} scope.userPhonenumber Trạng thái quyền số điện thoại.
@@ -5050,7 +5071,7 @@ declare function checkZaloCameraPermission(args?: AsyncCallback<CheckZaloCameraP
5050
5071
  * @minimumVersion 2.32.2
5051
5072
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
5052
5073
  *
5053
- * @returns {string} chứa ID người dùng.
5074
+ * @returns {string} ID người dùng.
5054
5075
  *
5055
5076
  * @example Truy xuất ID người dùng:
5056
5077
  * ```ts
@@ -5253,12 +5274,13 @@ declare const loadAdArgs: ZodObject<{
5253
5274
  /**
5254
5275
  * API dùng để tải quảng cáo. Có các loại quảng cáo sau đây:
5255
5276
  *
5256
- * ID Size
5257
- * ZMA_Masthead 480x270
5258
- * ZMA_Middle 300x250
5259
- * ZMA_Fullscreen Toàn màn hình
5260
- * ZMA_Reward Toàn màn hình
5261
- * ZMA_Bottom Tùy chỉnh
5277
+ * | ID | Size |
5278
+ * | -------------- | ------------- |
5279
+ * | ZMA_Masthead | 480x270 |
5280
+ * | ZMA_Middle | 300x250 |
5281
+ * | ZMA_Fullscreen | Toàn màn hình |
5282
+ * | ZMA_Reward | Toàn màn hình |
5283
+ * | ZMA_Bottom | Tùy chỉnh |
5262
5284
  *
5263
5285
  * Mặc định quảng cáo sẽ được hiển thị sau khi tải xong. Vị trí hiển thị quảng cáo sẽ được xác định theo ID của từng loại.
5264
5286
  *
@@ -5391,8 +5413,7 @@ declare const showOAWidgetArgs: ZodObject<{
5391
5413
  * @param {string} id ID của element, nơi cần hiển thị widget.
5392
5414
  * @param {string} [guidingText="Nhận thông báo khuyến mãi mới nhất từ cửa hàng"] Chuỗi dùng để thông báo cho người dùng.
5393
5415
  * @param {string} [color="#0068FF"] Màu chủ đạo của widget. Giá trị phải là chuỗi hex.
5394
- * @param {function} [onStatusChange] Trả về trạng thái khi nhấn theo dõi OA.
5395
- * @param {function} [onError] Trả về lỗi khi thao tác widget.
5416
+ * @param {(status: boolean) => void} [onStatusChange] Callback được gọi khi người dùng nhấn theo dõi OA. Trạng thái theo dõi mới được truyền vào tham số của callback.
5396
5417
  *
5397
5418
  * @example Hiển thị Widget Quan tâm OA:
5398
5419
  * ```ts
@@ -5478,8 +5499,8 @@ declare const showFunctionButtonWidgetArgs: ZodObject<{
5478
5499
  * @param {string} [color="#0068FF"] Màu chủ đạo của widget. Giá trị phải là chuỗi hex.
5479
5500
  * @param {string} [textColor="#FFFFFF"] Màu chữ trong button. Giá trị phải là chuỗi hex.
5480
5501
  * @param {string} [borderRadius="48px"] Bo góc (bo tròn các góc của button).
5481
- * @param {function} [onDataReceived] Trả về `messageToken` khi click widget.
5482
- * @param {function} [onError] Trả về `error` khi click widget.
5502
+ * @param {(messageToken: string) => void} [onDataReceived] Callback được gọi khi người dùng nhấn vào widget. Callback này chứa `messageToken` là một token được dùng để gửi tin nhắn tới người dùng. Có giá trị trong 7 ngày.
5503
+ * @param {(error: string) => void} [onError] Callback được gọi khi có lỗi xảy ra khi người dùng nhấn vào widget. Callback này chứa `error` là thông tin về lỗi.
5483
5504
  *
5484
5505
  * @example Hiển thị Widget Function Button:
5485
5506
  * ```ts
@@ -5585,8 +5606,8 @@ declare const downloadFileArgs: ZodOptional<ZodObject<{
5585
5606
  * @requirePermission Cần xin Cấp quyền sử dụng các API này cho Mini App ID tại trang Quản lý ứng dụng. Nếu không, sẽ bị [lỗi với người dùng bình thường, mặc dù Developer/Admin thì không bị](https://mini.zalo.me/community/8746968970844796879/loi-chi-xay-ra-voi-nguoi-dung-binh-thuong-con-developer-admin-thi-khong-bi).
5586
5607
  * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
5587
5608
  *
5588
- * @param {string} url - Đường dẫn của file muốn download.
5589
- * @param {(progress: number) => void} [onProgress] - Callback function tiến độ tải file. Với `progress` là số từ 0 đến 100%.
5609
+ * @param {string} url Đường dẫn của file muốn download.
5610
+ * @param {(progress: number) => void} [onProgress] Callback function tiến độ tải file. Với `progress` là số từ 0 đến 100%.
5590
5611
  *
5591
5612
  * @example Thông báo một lần sau khi tải file xong:
5592
5613
  * ```ts
@@ -5625,6 +5646,100 @@ declare const trackingManager: {
5625
5646
  logEvent: typeof logEvent;
5626
5647
  };
5627
5648
 
5649
+ declare const showCustomOAWidgetArgs: ZodObject<{
5650
+ id: ZodString;
5651
+ textColor: ZodOptional<ZodString>;
5652
+ fontSize: ZodOptional<ZodString>;
5653
+ buttonHeight: ZodOptional<ZodString>;
5654
+ buttonColor: ZodOptional<ZodString>;
5655
+ buttonTextColor: ZodOptional<ZodString>;
5656
+ buttonRadius: ZodOptional<ZodString>;
5657
+ buttonText: ZodOptional<ZodString>;
5658
+ checkboxBGColor: ZodOptional<ZodString>;
5659
+ checkboxCheckmarkColor: ZodOptional<ZodString>;
5660
+ onClick: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>>;
5661
+ onStatusChange: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>>;
5662
+ onError: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>>;
5663
+ }, "strip", ZodAny, {
5664
+ [x: string]: any;
5665
+ textColor?: string | undefined;
5666
+ onStatusChange?: ((...args: unknown[]) => unknown) | undefined;
5667
+ onError?: ((...args: unknown[]) => unknown) | undefined;
5668
+ fontSize?: string | undefined;
5669
+ buttonHeight?: string | undefined;
5670
+ buttonColor?: string | undefined;
5671
+ buttonTextColor?: string | undefined;
5672
+ buttonRadius?: string | undefined;
5673
+ buttonText?: string | undefined;
5674
+ checkboxBGColor?: string | undefined;
5675
+ checkboxCheckmarkColor?: string | undefined;
5676
+ onClick?: ((...args: unknown[]) => unknown) | undefined;
5677
+ id: string;
5678
+ }, {
5679
+ [x: string]: any;
5680
+ textColor?: string | undefined;
5681
+ onStatusChange?: ((...args: unknown[]) => unknown) | undefined;
5682
+ onError?: ((...args: unknown[]) => unknown) | undefined;
5683
+ fontSize?: string | undefined;
5684
+ buttonHeight?: string | undefined;
5685
+ buttonColor?: string | undefined;
5686
+ buttonTextColor?: string | undefined;
5687
+ buttonRadius?: string | undefined;
5688
+ buttonText?: string | undefined;
5689
+ checkboxBGColor?: string | undefined;
5690
+ checkboxCheckmarkColor?: string | undefined;
5691
+ onClick?: ((...args: unknown[]) => unknown) | undefined;
5692
+ id: string;
5693
+ }>[];
5694
+ /**
5695
+ * Nhằm tối ưu hiệu quả tăng follower của OA cho nhóm đối tác nội bộ, đồng thời đảm bảo trải nghiệm của User, không cảm thấy confuse, spam, Platform đã hỗ trợ cho nhóm đối tác nội bộ tool Widget "Quan tâm OA custom".
5696
+ * Đối tác có thể chỉnh sửa và gắn widget vào Mini App.
5697
+ *
5698
+ * @minimumVersion 2.46.0
5699
+ * @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
5700
+ *
5701
+ * @param {string} id - ID của element, nơi cần hiển thị widget.
5702
+ * @param {string} [textColor='#6F7071'] - Màu chữ của checkbox ("Đồng ý theo dõi OA").
5703
+ * @param {string} [fontSize='12px'] - Kích thước chữ cho checkbox
5704
+ * @param {string} [buttonHeight='48px'] - Chiều cao của nút CTA.
5705
+ * @param {string} [buttonColor='#0068FF'] - Màu nền của nút CTA.
5706
+ * @param {string} [buttonTextColor='#FFFFFF'] - Màu chữ của nút CTA.
5707
+ * @param {string} [buttonRadius='9999px'] - Border radius của nút CTA.
5708
+ * @param {string} [buttonText='Đồng ý'] - Nội dung hiển thị trên nút CTA.
5709
+ * @param {string} [checkboxBGColor='#0068FF'] - Màu nền của ô checkbox.
5710
+ * @param {string} [checkboxCheckmarkColor='#FFFFFF'] - Màu của dấu check (checkmark) trong checkbox.
5711
+ * @param {(status: boolean) => void} [onClick] - Callback được gọi khi người dùng nhấn nút CTA. Trả về `true` nếu checkbox được tick, ngược lại `false`.
5712
+ * @param {(error: string) => void} [onError] - Callback được gọi khi có lỗi xảy ra trong quá trình tương tác với widget.
5713
+ *
5714
+ * @example Hiển thị Widget Quan tâm OA Custom:
5715
+ * ```ts
5716
+ * import React, { useEffect } from "react";
5717
+ * import { showCustomOAWidget } from "zmp-sdk/apis";
5718
+ *
5719
+ * function HomePage() {
5720
+ * useEffect(() => {
5721
+ * showCustomOAWidget({
5722
+ * id: "oaCustomWidget",
5723
+ * onClick: (status) => {
5724
+ * console.log(status);
5725
+ * },
5726
+ * });
5727
+ * }, []);
5728
+ *
5729
+ * return (
5730
+ * <>
5731
+ * ...
5732
+ * <div id="oaCustomWidget" />
5733
+ * ...
5734
+ * </>
5735
+ * );
5736
+ * }
5737
+ *
5738
+ * export default HomePage;
5739
+ * ```
5740
+ */
5741
+ declare function showCustomOAWidget(args: AsyncVoidCallback & TypeOf<(typeof showCustomOAWidgetArgs)[0]>): Promise<void>;
5742
+
5628
5743
  declare class AppError {
5629
5744
  code: number;
5630
5745
  message: string | string[];
@@ -5759,6 +5874,7 @@ declare const otherApis: {
5759
5874
  trackingManager: {
5760
5875
  logEvent: typeof logEvent;
5761
5876
  };
5877
+ showCustomOAWidget: typeof showCustomOAWidget;
5762
5878
  FacingMode: typeof FacingMode;
5763
5879
  PhotoFormat: typeof PhotoFormat;
5764
5880
  PhotoQuality: typeof PhotoQuality;
@@ -5766,4 +5882,4 @@ declare const otherApis: {
5766
5882
  ZMACameraImp: typeof ZMACameraImp;
5767
5883
  };
5768
5884
 
5769
- export { Action, AndroidBottomNavigationBarType, AppError, AsyncCallback, AsyncCallbackFailObject, AsyncProgressCallback, AsyncVoidCallback, AuthorizeType, CameraEvents, CameraParams, ChatType, CheckStateBioAuthenticationReturns, CheckTransactionReturns, CheckZaloCameraPermissionReturns, CheckoutSDK, ChooseImageReturns, Common, ContextInfo, CreateOrderIAPReturns, CreateOrderReturns, Events as EventName, Events, FacingMode, FunctionProps, GetAppInfoReturns, GetAuthCodeReturns, GetBeaconDiscoveryReturns, GetLocationReturns, GetNetworkTypeReturns, GetPhoneNumberReturns, GetSettingReturn, GetStorageReturns, GetUserInfoReturns, GetZPITokenReturns, IAPMethodType, IAPPayType, IAPPayTypeType, IOSSafeAreaBottomType, JumpStatus, KeepScreenReturns, LogData, MediaConstraints, MediaDevice, MediaPickerType, NativeCallBackData, NetworkType, OpenBioAuthenticationReturns, OpenMediaPickerReturns, OpenPostFeedReturns, OpenProfilePickerReturns, OpenShareSheetReturns, OpenWebviewReturns, OrientationType, Payment, PhotoConstraint, PhotoFormat, PhotoFrame, PhotoQuality, PickAttr, PickedProfile, PlatformType, PostFeedType, ProfileInfo, ProfileType, ProrationMode, ProrationModeType, RemoveStorageReturns, RequestCameraPermissionReturns, SaveFileReturns, ScanNFCType, ScanQRCodeReturns, SelectPaymentMethodReturns, SetStorageReturns, ShareSheetType, StatusBarType, StorageInfo, StreamType, SystemInfo, TempFile, TextAlignType, UserInfo, VibrateType, ZMACamera, ZMACameraImp, addRating, authorize, checkNFC, checkStateBioAuthentication, checkTransaction, checkZaloCameraPermission, chooseImage, clearStorage, closeApp, closeLoading, configAppView, connectWifi, createCameraContext, createOrder, createOrderIAP, createShortcut, otherApis as default, displayAd, downloadFile, events, favoriteApp, followOA, getAccessToken, getAppInfo, getAuthCode, getBeacons, getContext, getContextAsync, getDeviceId, getDeviceIdAsync, getIDToken, getLocation, getNetworkType, getPhoneNumber, getRouteParams, getSetting, getShareableLink, getStorage, getStorageInfo, getSystemInfo, getUserID, getUserInfo, getVersion, getZPIToken, hideKeyboard, iBeaconInfo, interactOA, interactOA as interactOa, checkIsAllowedInteractWithOA as isAllowedInteractWithOA, keepScreen, loadAd, login, minimizeApp, nativeStorage, offConfirmToExit, offKeepScreen, onCallbackData, onConfirmToExit, onKeepScreen, onNetworkStatusChange, openBioAuthentication, openChat, openGroupList, openMediaPicker, openMiniApp, openOutApp, openPermissionSetting, openPhone, openPostFeed, openProfile, openProfilePicker, openSMS, openShareSheet, openWebview, purchase, refreshAd, removeStorage, requestCameraPermission, requestSendNotification, requestUpdateZalo, saveImageToGallery, saveVideoToGallery, scanNFC, scanQRCode, selectPaymentMethod, sendDataToPreviousMiniApp, setAccessToken, setAndroidBottomNavigationBar, setIOSBottomSafeArea, setNavigationBarColor, setNavigationBarLeftButton, setNavigationBarTitle, setStatusBar, setStorage, setupAd, showFunctionButtonWidget, showOAWidget, showToast, startBeaconDiscovery, stopBeaconDiscovery, trackingManager, unfollowOA, vibrate, viewOAQr };
5885
+ export { Action, AndroidBottomNavigationBarType, AppError, AsyncCallback, AsyncCallbackFailObject, AsyncProgressCallback, AsyncVoidCallback, AuthorizeType, CameraEvents, CameraParams, ChatType, CheckStateBioAuthenticationReturns, CheckTransactionReturns, CheckZaloCameraPermissionReturns, CheckoutSDK, ChooseImageReturns, Common, ContextInfo, CreateOrderIAPReturns, CreateOrderReturns, Events as EventName, Events, FacingMode, FunctionProps, GetAppInfoReturns, GetAuthCodeReturns, GetBeaconDiscoveryReturns, GetLocationReturns, GetNetworkTypeReturns, GetPhoneNumberReturns, GetSettingReturn, GetStorageReturns, GetUserInfoReturns, GetZPITokenReturns, IAPMethodType, IAPPayType, IAPPayTypeType, IOSSafeAreaBottomType, JumpStatus, KeepScreenReturns, LogData, MediaConstraints, MediaDevice, MediaPickerType, NativeCallBackData, NetworkType, OpenBioAuthenticationReturns, OpenMediaPickerReturns, OpenPostFeedReturns, OpenProfilePickerReturns, OpenShareSheetReturns, OpenWebviewReturns, OrientationType, Payment, PhotoConstraint, PhotoFormat, PhotoFrame, PhotoQuality, PickAttr, PickedProfile, PlatformType, PostFeedType, ProfileInfo, ProfileType, ProrationMode, ProrationModeType, RemoveStorageReturns, RequestCameraPermissionReturns, SaveFileReturns, ScanNFCType, ScanQRCodeReturns, SelectPaymentMethodReturns, SetStorageReturns, ShareSheetType, StatusBarType, StorageInfo, StreamType, SystemInfo, TempFile, TextAlignType, UserInfo, VibrateType, ZMACamera, ZMACameraImp, addRating, authorize, checkNFC, checkStateBioAuthentication, checkTransaction, checkZaloCameraPermission, chooseImage, clearStorage, closeApp, closeLoading, configAppView, connectWifi, createCameraContext, createOrder, createOrderIAP, createShortcut, otherApis as default, displayAd, downloadFile, events, favoriteApp, followOA, getAccessToken, getAppInfo, getAuthCode, getBeacons, getContext, getContextAsync, getDeviceId, getDeviceIdAsync, getIDToken, getLocation, getNetworkType, getPhoneNumber, getRouteParams, getSetting, getShareableLink, getStorage, getStorageInfo, getSystemInfo, getUserID, getUserInfo, getVersion, getZPIToken, hideKeyboard, iBeaconInfo, interactOA, interactOA as interactOa, checkIsAllowedInteractWithOA as isAllowedInteractWithOA, keepScreen, loadAd, login, minimizeApp, nativeStorage, offConfirmToExit, offKeepScreen, onCallbackData, onConfirmToExit, onKeepScreen, onNetworkStatusChange, openBioAuthentication, openChat, openGroupList, openMediaPicker, openMiniApp, openOutApp, openPermissionSetting, openPhone, openPostFeed, openProfile, openProfilePicker, openSMS, openShareSheet, openWebview, purchase, refreshAd, removeStorage, requestCameraPermission, requestSendNotification, requestUpdateZalo, saveImageToGallery, saveVideoToGallery, scanNFC, scanQRCode, selectPaymentMethod, sendDataToPreviousMiniApp, setAccessToken, setAndroidBottomNavigationBar, setIOSBottomSafeArea, setNavigationBarColor, setNavigationBarLeftButton, setNavigationBarTitle, setStatusBar, setStorage, setupAd, showCustomOAWidget, showFunctionButtonWidget, showOAWidget, showToast, startBeaconDiscovery, stopBeaconDiscovery, trackingManager, unfollowOA, vibrate, viewOAQr };