@apps-in-toss/web-bridge 1.4.6 → 1.4.8
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/built/index.cjs +73 -53
- package/built/index.d.cts +47 -2
- package/built/index.d.ts +47 -2
- package/built/index.js +37 -18
- package/package.json +5 -5
package/built/index.cjs
CHANGED
|
@@ -24,6 +24,7 @@ var index_exports = {};
|
|
|
24
24
|
__export(index_exports, {
|
|
25
25
|
GoogleAdMob: () => GoogleAdMob,
|
|
26
26
|
IAP: () => IAP,
|
|
27
|
+
SafeAreaInsets: () => SafeAreaInsets,
|
|
27
28
|
Storage: () => Storage,
|
|
28
29
|
appsInTossEvent: () => appsInTossEvent,
|
|
29
30
|
env: () => env,
|
|
@@ -303,7 +304,7 @@ var IAP = {
|
|
|
303
304
|
* @category 인앱결제
|
|
304
305
|
* @name getPendingOrders
|
|
305
306
|
* @description 대기 중인 주문 목록을 가져와요. 이 함수를 사용하면 결제가 아직 완료되지 않은 주문 정보를 확인할 수 있어요.
|
|
306
|
-
* @returns {Promise<{ orders: { orderId: string; sku: string; }[]}}>} 대기 중인 주문의 배열을 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.234.0, iOS 5.231.0)보다 낮으면 `undefined`를 반환해요.
|
|
307
|
+
* @returns {Promise<{ orders: { orderId: string; sku: string; paymentCompletedDate: string; }[]}}>} 대기 중인 주문의 배열을 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.234.0, iOS 5.231.0)보다 낮으면 `undefined`를 반환해요.
|
|
307
308
|
*
|
|
308
309
|
* @example
|
|
309
310
|
* ### 대기 중인 주문 목록 가져오기
|
|
@@ -320,7 +321,9 @@ var IAP = {
|
|
|
320
321
|
* }
|
|
321
322
|
* ```
|
|
322
323
|
*/
|
|
323
|
-
getPendingOrders: (0, import_bridge_core3.createAsyncBridge)(
|
|
324
|
+
getPendingOrders: (0, import_bridge_core3.createAsyncBridge)(
|
|
325
|
+
"getPendingOrders"
|
|
326
|
+
),
|
|
324
327
|
/**
|
|
325
328
|
* @public
|
|
326
329
|
* @category 인앱결제
|
|
@@ -373,12 +376,28 @@ var IAP = {
|
|
|
373
376
|
var import_bridge_core4 = require("@apps-in-toss/bridge-core");
|
|
374
377
|
var getSafeAreaBottom = (0, import_bridge_core4.createConstantBridge)("getSafeAreaBottom");
|
|
375
378
|
var getSafeAreaTop = (0, import_bridge_core4.createConstantBridge)("getSafeAreaTop");
|
|
379
|
+
var getSafeAreaLeft = (0, import_bridge_core4.createConstantBridge)("getSafeAreaLeft");
|
|
380
|
+
var getSafeAreaRight = (0, import_bridge_core4.createConstantBridge)("getSafeAreaRight");
|
|
376
381
|
function getSafeAreaInsets() {
|
|
377
|
-
return { top: getSafeAreaTop(), bottom: getSafeAreaBottom() };
|
|
382
|
+
return { top: getSafeAreaTop(), bottom: getSafeAreaBottom(), left: getSafeAreaLeft(), right: getSafeAreaRight() };
|
|
378
383
|
}
|
|
379
384
|
|
|
380
|
-
// src/
|
|
385
|
+
// src/safeAreaInsets.ts
|
|
381
386
|
var import_bridge_core5 = require("@apps-in-toss/bridge-core");
|
|
387
|
+
function subscribeSafeAreaInsets({ onEvent }) {
|
|
388
|
+
return (0, import_bridge_core5.createEventBridge)("safeAreaInsetsChange")({
|
|
389
|
+
onEvent,
|
|
390
|
+
onError: () => {
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
var SafeAreaInsets = {
|
|
395
|
+
get: getSafeAreaInsets,
|
|
396
|
+
subscribe: subscribeSafeAreaInsets
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
// src/googleAdMob.ts
|
|
400
|
+
var import_bridge_core6 = require("@apps-in-toss/bridge-core");
|
|
382
401
|
var GoogleAdMob = {
|
|
383
402
|
/**
|
|
384
403
|
* @public
|
|
@@ -429,9 +448,9 @@ var GoogleAdMob = {
|
|
|
429
448
|
* ```
|
|
430
449
|
*/
|
|
431
450
|
loadAdMobInterstitialAd: Object.assign(
|
|
432
|
-
(0,
|
|
451
|
+
(0, import_bridge_core6.createEventBridge)("loadAdMobInterstitialAd"),
|
|
433
452
|
{
|
|
434
|
-
isSupported: (0,
|
|
453
|
+
isSupported: (0, import_bridge_core6.createConstantBridge)("loadAdMobInterstitialAd_isSupported")
|
|
435
454
|
}
|
|
436
455
|
),
|
|
437
456
|
/**
|
|
@@ -504,9 +523,9 @@ var GoogleAdMob = {
|
|
|
504
523
|
* ```
|
|
505
524
|
*/
|
|
506
525
|
showAdMobInterstitialAd: Object.assign(
|
|
507
|
-
(0,
|
|
526
|
+
(0, import_bridge_core6.createEventBridge)("showAdMobInterstitialAd"),
|
|
508
527
|
{
|
|
509
|
-
isSupported: (0,
|
|
528
|
+
isSupported: (0, import_bridge_core6.createConstantBridge)("showAdMobInterstitialAd_isSupported")
|
|
510
529
|
}
|
|
511
530
|
),
|
|
512
531
|
/**
|
|
@@ -558,9 +577,9 @@ var GoogleAdMob = {
|
|
|
558
577
|
* ```
|
|
559
578
|
*/
|
|
560
579
|
loadAdMobRewardedAd: Object.assign(
|
|
561
|
-
(0,
|
|
580
|
+
(0, import_bridge_core6.createEventBridge)("loadAdMobRewardedAd"),
|
|
562
581
|
{
|
|
563
|
-
isSupported: (0,
|
|
582
|
+
isSupported: (0, import_bridge_core6.createConstantBridge)("loadAdMobRewardedAd_isSupported")
|
|
564
583
|
}
|
|
565
584
|
),
|
|
566
585
|
/**
|
|
@@ -633,9 +652,9 @@ var GoogleAdMob = {
|
|
|
633
652
|
* ```
|
|
634
653
|
*/
|
|
635
654
|
showAdMobRewardedAd: Object.assign(
|
|
636
|
-
(0,
|
|
655
|
+
(0, import_bridge_core6.createEventBridge)("showAdMobRewardedAd"),
|
|
637
656
|
{
|
|
638
|
-
isSupported: (0,
|
|
657
|
+
isSupported: (0, import_bridge_core6.createConstantBridge)("showAdMobRewardedAd_isSupported")
|
|
639
658
|
}
|
|
640
659
|
),
|
|
641
660
|
/**
|
|
@@ -692,8 +711,8 @@ var GoogleAdMob = {
|
|
|
692
711
|
* }
|
|
693
712
|
* ```
|
|
694
713
|
*/
|
|
695
|
-
loadAppsInTossAdMob: Object.assign((0,
|
|
696
|
-
isSupported: (0,
|
|
714
|
+
loadAppsInTossAdMob: Object.assign((0, import_bridge_core6.createEventBridge)("loadAppsInTossAdMob"), {
|
|
715
|
+
isSupported: (0, import_bridge_core6.createConstantBridge)("loadAppsInTossAdMob_isSupported")
|
|
697
716
|
}),
|
|
698
717
|
/**
|
|
699
718
|
* @public
|
|
@@ -770,19 +789,19 @@ var GoogleAdMob = {
|
|
|
770
789
|
* }
|
|
771
790
|
* ```
|
|
772
791
|
*/
|
|
773
|
-
showAppsInTossAdMob: Object.assign((0,
|
|
774
|
-
isSupported: (0,
|
|
792
|
+
showAppsInTossAdMob: Object.assign((0, import_bridge_core6.createEventBridge)("showAppsInTossAdMob"), {
|
|
793
|
+
isSupported: (0, import_bridge_core6.createConstantBridge)("showAppsInTossAdMob_isSupported")
|
|
775
794
|
})
|
|
776
795
|
};
|
|
777
796
|
|
|
778
797
|
// src/graniteEvent.ts
|
|
779
|
-
var
|
|
798
|
+
var import_bridge_core7 = require("@apps-in-toss/bridge-core");
|
|
780
799
|
var graniteEvent = {
|
|
781
800
|
addEventListener: (event, {
|
|
782
801
|
onEvent,
|
|
783
802
|
onError,
|
|
784
803
|
options
|
|
785
|
-
}) => (0,
|
|
804
|
+
}) => (0, import_bridge_core7.createEventBridge)(event)({
|
|
786
805
|
onEvent,
|
|
787
806
|
onError: onError ?? (() => {
|
|
788
807
|
}),
|
|
@@ -791,13 +810,13 @@ var graniteEvent = {
|
|
|
791
810
|
};
|
|
792
811
|
|
|
793
812
|
// src/appsInTossEvent.ts
|
|
794
|
-
var
|
|
813
|
+
var import_bridge_core8 = require("@apps-in-toss/bridge-core");
|
|
795
814
|
var appsInTossEvent = {
|
|
796
815
|
addEventListener: (event, {
|
|
797
816
|
onEvent,
|
|
798
817
|
onError,
|
|
799
818
|
options
|
|
800
|
-
}) => (0,
|
|
819
|
+
}) => (0, import_bridge_core8.createEventBridge)(event)({
|
|
801
820
|
onEvent,
|
|
802
821
|
onError: onError ?? (() => {
|
|
803
822
|
}),
|
|
@@ -806,18 +825,18 @@ var appsInTossEvent = {
|
|
|
806
825
|
};
|
|
807
826
|
|
|
808
827
|
// src/env.ts
|
|
809
|
-
var
|
|
828
|
+
var import_bridge_core9 = require("@apps-in-toss/bridge-core");
|
|
810
829
|
var env = {
|
|
811
|
-
getDeploymentId: (0,
|
|
830
|
+
getDeploymentId: (0, import_bridge_core9.createConstantBridge)("getDeploymentId")
|
|
812
831
|
};
|
|
813
832
|
|
|
814
833
|
// src/global.ts
|
|
815
|
-
var
|
|
816
|
-
var deploymentId = (0,
|
|
817
|
-
var brandDisplayName = (0,
|
|
818
|
-
var brandIcon = (0,
|
|
819
|
-
var brandPrimaryColor = (0,
|
|
820
|
-
var brandBridgeColorMode = (0,
|
|
834
|
+
var import_bridge_core10 = require("@apps-in-toss/bridge-core");
|
|
835
|
+
var deploymentId = (0, import_bridge_core10.createConstantBridge)("deploymentId");
|
|
836
|
+
var brandDisplayName = (0, import_bridge_core10.createConstantBridge)("brandDisplayName");
|
|
837
|
+
var brandIcon = (0, import_bridge_core10.createConstantBridge)("brandIcon");
|
|
838
|
+
var brandPrimaryColor = (0, import_bridge_core10.createConstantBridge)("brandPrimaryColor");
|
|
839
|
+
var brandBridgeColorMode = (0, import_bridge_core10.createConstantBridge)("brandBridgeColorMode");
|
|
821
840
|
var getAppsInTossGlobals = () => {
|
|
822
841
|
return {
|
|
823
842
|
deploymentId: deploymentId(),
|
|
@@ -829,7 +848,7 @@ var getAppsInTossGlobals = () => {
|
|
|
829
848
|
};
|
|
830
849
|
|
|
831
850
|
// src/tdsEvent.ts
|
|
832
|
-
var
|
|
851
|
+
var import_bridge_core11 = require("@apps-in-toss/bridge-core");
|
|
833
852
|
var tdsEvent = {
|
|
834
853
|
/**
|
|
835
854
|
* @public
|
|
@@ -859,7 +878,7 @@ var tdsEvent = {
|
|
|
859
878
|
onEvent,
|
|
860
879
|
onError,
|
|
861
880
|
options
|
|
862
|
-
}) => (0,
|
|
881
|
+
}) => (0, import_bridge_core11.createEventBridge)(event)({
|
|
863
882
|
onEvent,
|
|
864
883
|
onError: onError ?? (() => {
|
|
865
884
|
}),
|
|
@@ -868,7 +887,7 @@ var tdsEvent = {
|
|
|
868
887
|
};
|
|
869
888
|
|
|
870
889
|
// src/partner.ts
|
|
871
|
-
var
|
|
890
|
+
var import_bridge_core12 = require("@apps-in-toss/bridge-core");
|
|
872
891
|
var partner = {
|
|
873
892
|
/**
|
|
874
893
|
* @public
|
|
@@ -890,7 +909,7 @@ var partner = {
|
|
|
890
909
|
});
|
|
891
910
|
* ```
|
|
892
911
|
*/
|
|
893
|
-
addAccessoryButton: (0,
|
|
912
|
+
addAccessoryButton: (0, import_bridge_core12.createAsyncBridge)("addAccessoryButton"),
|
|
894
913
|
/**
|
|
895
914
|
* @public
|
|
896
915
|
* @category 파트너
|
|
@@ -904,18 +923,18 @@ var partner = {
|
|
|
904
923
|
* partner.removeAccessoryButton();
|
|
905
924
|
* ```
|
|
906
925
|
*/
|
|
907
|
-
removeAccessoryButton: (0,
|
|
926
|
+
removeAccessoryButton: (0, import_bridge_core12.createAsyncBridge)("removeAccessoryButton")
|
|
908
927
|
};
|
|
909
928
|
|
|
910
929
|
// src/permissions/fetchAlbumPhotos.ts
|
|
911
|
-
var
|
|
930
|
+
var import_bridge_core14 = require("@apps-in-toss/bridge-core");
|
|
912
931
|
var import_types = require("@apps-in-toss/types");
|
|
913
932
|
|
|
914
933
|
// src/permissions/createPermissionFunction.ts
|
|
915
|
-
var
|
|
916
|
-
var requestPermission = (0,
|
|
917
|
-
var getPermission = (0,
|
|
918
|
-
var openPermissionDialog = (0,
|
|
934
|
+
var import_bridge_core13 = require("@apps-in-toss/bridge-core");
|
|
935
|
+
var requestPermission = (0, import_bridge_core13.createAsyncBridge)("requestPermission");
|
|
936
|
+
var getPermission = (0, import_bridge_core13.createAsyncBridge)("getPermission");
|
|
937
|
+
var openPermissionDialog = (0, import_bridge_core13.createAsyncBridge)("openPermissionDialog");
|
|
919
938
|
function createPermissionFunction({
|
|
920
939
|
permission,
|
|
921
940
|
handler,
|
|
@@ -936,7 +955,7 @@ function createPermissionFunction({
|
|
|
936
955
|
// src/permissions/fetchAlbumPhotos.ts
|
|
937
956
|
var fetchAlbumPhotos = createPermissionFunction({
|
|
938
957
|
handler: (options) => {
|
|
939
|
-
return (0,
|
|
958
|
+
return (0, import_bridge_core14.createAsyncBridge)("fetchAlbumPhotos")(
|
|
940
959
|
options
|
|
941
960
|
);
|
|
942
961
|
},
|
|
@@ -948,11 +967,11 @@ var fetchAlbumPhotos = createPermissionFunction({
|
|
|
948
967
|
});
|
|
949
968
|
|
|
950
969
|
// src/permissions/fetchContacts.ts
|
|
951
|
-
var
|
|
970
|
+
var import_bridge_core15 = require("@apps-in-toss/bridge-core");
|
|
952
971
|
var import_types2 = require("@apps-in-toss/types");
|
|
953
972
|
var fetchContacts = createPermissionFunction({
|
|
954
973
|
handler: (options) => {
|
|
955
|
-
return (0,
|
|
974
|
+
return (0, import_bridge_core15.createAsyncBridge)("fetchContacts")(options);
|
|
956
975
|
},
|
|
957
976
|
permission: {
|
|
958
977
|
name: "contacts",
|
|
@@ -962,11 +981,11 @@ var fetchContacts = createPermissionFunction({
|
|
|
962
981
|
});
|
|
963
982
|
|
|
964
983
|
// src/permissions/getCurrentLocation.ts
|
|
965
|
-
var
|
|
984
|
+
var import_bridge_core16 = require("@apps-in-toss/bridge-core");
|
|
966
985
|
var import_types3 = require("@apps-in-toss/types");
|
|
967
986
|
var getCurrentLocation = createPermissionFunction({
|
|
968
987
|
handler: (options) => {
|
|
969
|
-
return (0,
|
|
988
|
+
return (0, import_bridge_core16.createAsyncBridge)(
|
|
970
989
|
"getCurrentLocation"
|
|
971
990
|
)(options);
|
|
972
991
|
},
|
|
@@ -978,11 +997,11 @@ var getCurrentLocation = createPermissionFunction({
|
|
|
978
997
|
});
|
|
979
998
|
|
|
980
999
|
// src/permissions/openCamera.ts
|
|
981
|
-
var
|
|
1000
|
+
var import_bridge_core17 = require("@apps-in-toss/bridge-core");
|
|
982
1001
|
var import_types4 = require("@apps-in-toss/types");
|
|
983
1002
|
var openCamera = createPermissionFunction({
|
|
984
1003
|
handler: (options) => {
|
|
985
|
-
return (0,
|
|
1004
|
+
return (0, import_bridge_core17.createAsyncBridge)("openCamera")(options);
|
|
986
1005
|
},
|
|
987
1006
|
permission: {
|
|
988
1007
|
name: "camera",
|
|
@@ -992,11 +1011,11 @@ var openCamera = createPermissionFunction({
|
|
|
992
1011
|
});
|
|
993
1012
|
|
|
994
1013
|
// src/permissions/setClipboardText.ts
|
|
995
|
-
var
|
|
1014
|
+
var import_bridge_core18 = require("@apps-in-toss/bridge-core");
|
|
996
1015
|
var import_types5 = require("@apps-in-toss/types");
|
|
997
1016
|
var setClipboardText = createPermissionFunction({
|
|
998
1017
|
handler: (options) => {
|
|
999
|
-
return (0,
|
|
1018
|
+
return (0, import_bridge_core18.createAsyncBridge)("setClipboardText")(
|
|
1000
1019
|
options
|
|
1001
1020
|
);
|
|
1002
1021
|
},
|
|
@@ -1008,11 +1027,11 @@ var setClipboardText = createPermissionFunction({
|
|
|
1008
1027
|
});
|
|
1009
1028
|
|
|
1010
1029
|
// src/permissions/getClipboardText.ts
|
|
1011
|
-
var
|
|
1030
|
+
var import_bridge_core19 = require("@apps-in-toss/bridge-core");
|
|
1012
1031
|
var import_types6 = require("@apps-in-toss/types");
|
|
1013
1032
|
var getClipboardText = createPermissionFunction({
|
|
1014
1033
|
handler: () => {
|
|
1015
|
-
return (0,
|
|
1034
|
+
return (0, import_bridge_core19.createAsyncBridge)("getClipboardText")();
|
|
1016
1035
|
},
|
|
1017
1036
|
permission: {
|
|
1018
1037
|
name: "clipboard",
|
|
@@ -1022,12 +1041,12 @@ var getClipboardText = createPermissionFunction({
|
|
|
1022
1041
|
});
|
|
1023
1042
|
|
|
1024
1043
|
// src/permissions/startUpdateLocation.ts
|
|
1025
|
-
var
|
|
1044
|
+
var import_bridge_core20 = require("@apps-in-toss/bridge-core");
|
|
1026
1045
|
var import_types7 = require("@apps-in-toss/types");
|
|
1027
|
-
var getPermission2 = (0,
|
|
1028
|
-
var openPermissionDialog2 = (0,
|
|
1046
|
+
var getPermission2 = (0, import_bridge_core20.createAsyncBridge)("getPermission");
|
|
1047
|
+
var openPermissionDialog2 = (0, import_bridge_core20.createAsyncBridge)("openPermissionDialog");
|
|
1029
1048
|
var startUpdateLocation = (params) => {
|
|
1030
|
-
return (0,
|
|
1049
|
+
return (0, import_bridge_core20.createEventBridge)("updateLocationEvent")({
|
|
1031
1050
|
...params,
|
|
1032
1051
|
onError: (error) => {
|
|
1033
1052
|
const locationError = new import_types7.StartUpdateLocationPermissionError();
|
|
@@ -1047,6 +1066,7 @@ __reExport(index_exports, require("@apps-in-toss/types"), module.exports);
|
|
|
1047
1066
|
0 && (module.exports = {
|
|
1048
1067
|
GoogleAdMob,
|
|
1049
1068
|
IAP,
|
|
1069
|
+
SafeAreaInsets,
|
|
1050
1070
|
Storage,
|
|
1051
1071
|
appsInTossEvent,
|
|
1052
1072
|
env,
|
package/built/index.d.cts
CHANGED
|
@@ -230,7 +230,7 @@ declare const IAP: {
|
|
|
230
230
|
* @category 인앱결제
|
|
231
231
|
* @name getPendingOrders
|
|
232
232
|
* @description 대기 중인 주문 목록을 가져와요. 이 함수를 사용하면 결제가 아직 완료되지 않은 주문 정보를 확인할 수 있어요.
|
|
233
|
-
* @returns {Promise<{ orders: { orderId: string; sku: string; }[]}}>} 대기 중인 주문의 배열을 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.234.0, iOS 5.231.0)보다 낮으면 `undefined`를 반환해요.
|
|
233
|
+
* @returns {Promise<{ orders: { orderId: string; sku: string; paymentCompletedDate: string; }[]}}>} 대기 중인 주문의 배열을 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.234.0, iOS 5.231.0)보다 낮으면 `undefined`를 반환해요.
|
|
234
234
|
*
|
|
235
235
|
* @example
|
|
236
236
|
* ### 대기 중인 주문 목록 가져오기
|
|
@@ -251,6 +251,7 @@ declare const IAP: {
|
|
|
251
251
|
orders: {
|
|
252
252
|
orderId: string;
|
|
253
253
|
sku: string;
|
|
254
|
+
paymentCompletedDate: string;
|
|
254
255
|
}[];
|
|
255
256
|
}>;
|
|
256
257
|
/**
|
|
@@ -305,9 +306,53 @@ declare const IAP: {
|
|
|
305
306
|
}) => Promise<boolean>;
|
|
306
307
|
};
|
|
307
308
|
|
|
309
|
+
/**
|
|
310
|
+
*
|
|
311
|
+
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link SafeAreaInsets.get}를 사용해주세요.
|
|
312
|
+
*/
|
|
308
313
|
declare function getSafeAreaInsets(): {
|
|
309
314
|
top: number;
|
|
310
315
|
bottom: number;
|
|
316
|
+
left: number;
|
|
317
|
+
right: number;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* @public
|
|
322
|
+
* @name subscribeSafeAreaInsets
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* ### 화면 모드 변경 시 바뀌는 safe area 값 구독하기
|
|
326
|
+
* ```tsx
|
|
327
|
+
* import { SafeAreaInsets } from '@apps-in-toss/web-framework';
|
|
328
|
+
* import { useEffect, useState } from 'react';
|
|
329
|
+
*
|
|
330
|
+
* function Page() {
|
|
331
|
+
* const [safeAreaInsetsValue, setSafeAreaInsetsValue] = useState<SafeAreaInsets>(() => SafeAreaInsets.get())
|
|
332
|
+
* useEffect(() => {
|
|
333
|
+
* const cleanup = SafeAreaInsets.subscribe({
|
|
334
|
+
* onEvent: (insets) => {
|
|
335
|
+
* setSafeAreaInsetsValue(insets);
|
|
336
|
+
* }
|
|
337
|
+
* });
|
|
338
|
+
*
|
|
339
|
+
* return () => cleanup();
|
|
340
|
+
* }, []);
|
|
341
|
+
* }
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
declare function subscribeSafeAreaInsets({ onEvent }: {
|
|
345
|
+
onEvent: (data: SafeAreaInsets) => void;
|
|
346
|
+
}): () => void;
|
|
347
|
+
interface SafeAreaInsets {
|
|
348
|
+
top: number;
|
|
349
|
+
bottom: number;
|
|
350
|
+
left: number;
|
|
351
|
+
right: number;
|
|
352
|
+
}
|
|
353
|
+
declare const SafeAreaInsets: {
|
|
354
|
+
get: typeof getSafeAreaInsets;
|
|
355
|
+
subscribe: typeof subscribeSafeAreaInsets;
|
|
311
356
|
};
|
|
312
357
|
|
|
313
358
|
declare const GoogleAdMob: {
|
|
@@ -922,4 +967,4 @@ declare const startUpdateLocation: {
|
|
|
922
967
|
openPermissionDialog(): Promise<"denied" | "allowed">;
|
|
923
968
|
};
|
|
924
969
|
|
|
925
|
-
export { type AddAccessoryButtonOptions, type AppsInTossEvent, type AppsInTossGlobals, type CompletedOrRefundedOrdersResult, GoogleAdMob, type GraniteEvent, IAP, type IapCreateOneTimePurchaseOrderOptions, type IapProductListItem, Storage, type TdsEvent, appsInTossEvent, env, fetchAlbumPhotos, fetchContacts, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getSafeAreaInsets, graniteEvent, isMinVersionSupported, openCamera, partner, setClipboardText, startUpdateLocation, tdsEvent };
|
|
970
|
+
export { type AddAccessoryButtonOptions, type AppsInTossEvent, type AppsInTossGlobals, type CompletedOrRefundedOrdersResult, GoogleAdMob, type GraniteEvent, IAP, type IapCreateOneTimePurchaseOrderOptions, type IapProductListItem, SafeAreaInsets, Storage, type TdsEvent, appsInTossEvent, env, fetchAlbumPhotos, fetchContacts, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getSafeAreaInsets, graniteEvent, isMinVersionSupported, openCamera, partner, setClipboardText, startUpdateLocation, tdsEvent };
|
package/built/index.d.ts
CHANGED
|
@@ -230,7 +230,7 @@ declare const IAP: {
|
|
|
230
230
|
* @category 인앱결제
|
|
231
231
|
* @name getPendingOrders
|
|
232
232
|
* @description 대기 중인 주문 목록을 가져와요. 이 함수를 사용하면 결제가 아직 완료되지 않은 주문 정보를 확인할 수 있어요.
|
|
233
|
-
* @returns {Promise<{ orders: { orderId: string; sku: string; }[]}}>} 대기 중인 주문의 배열을 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.234.0, iOS 5.231.0)보다 낮으면 `undefined`를 반환해요.
|
|
233
|
+
* @returns {Promise<{ orders: { orderId: string; sku: string; paymentCompletedDate: string; }[]}}>} 대기 중인 주문의 배열을 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.234.0, iOS 5.231.0)보다 낮으면 `undefined`를 반환해요.
|
|
234
234
|
*
|
|
235
235
|
* @example
|
|
236
236
|
* ### 대기 중인 주문 목록 가져오기
|
|
@@ -251,6 +251,7 @@ declare const IAP: {
|
|
|
251
251
|
orders: {
|
|
252
252
|
orderId: string;
|
|
253
253
|
sku: string;
|
|
254
|
+
paymentCompletedDate: string;
|
|
254
255
|
}[];
|
|
255
256
|
}>;
|
|
256
257
|
/**
|
|
@@ -305,9 +306,53 @@ declare const IAP: {
|
|
|
305
306
|
}) => Promise<boolean>;
|
|
306
307
|
};
|
|
307
308
|
|
|
309
|
+
/**
|
|
310
|
+
*
|
|
311
|
+
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link SafeAreaInsets.get}를 사용해주세요.
|
|
312
|
+
*/
|
|
308
313
|
declare function getSafeAreaInsets(): {
|
|
309
314
|
top: number;
|
|
310
315
|
bottom: number;
|
|
316
|
+
left: number;
|
|
317
|
+
right: number;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* @public
|
|
322
|
+
* @name subscribeSafeAreaInsets
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* ### 화면 모드 변경 시 바뀌는 safe area 값 구독하기
|
|
326
|
+
* ```tsx
|
|
327
|
+
* import { SafeAreaInsets } from '@apps-in-toss/web-framework';
|
|
328
|
+
* import { useEffect, useState } from 'react';
|
|
329
|
+
*
|
|
330
|
+
* function Page() {
|
|
331
|
+
* const [safeAreaInsetsValue, setSafeAreaInsetsValue] = useState<SafeAreaInsets>(() => SafeAreaInsets.get())
|
|
332
|
+
* useEffect(() => {
|
|
333
|
+
* const cleanup = SafeAreaInsets.subscribe({
|
|
334
|
+
* onEvent: (insets) => {
|
|
335
|
+
* setSafeAreaInsetsValue(insets);
|
|
336
|
+
* }
|
|
337
|
+
* });
|
|
338
|
+
*
|
|
339
|
+
* return () => cleanup();
|
|
340
|
+
* }, []);
|
|
341
|
+
* }
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
declare function subscribeSafeAreaInsets({ onEvent }: {
|
|
345
|
+
onEvent: (data: SafeAreaInsets) => void;
|
|
346
|
+
}): () => void;
|
|
347
|
+
interface SafeAreaInsets {
|
|
348
|
+
top: number;
|
|
349
|
+
bottom: number;
|
|
350
|
+
left: number;
|
|
351
|
+
right: number;
|
|
352
|
+
}
|
|
353
|
+
declare const SafeAreaInsets: {
|
|
354
|
+
get: typeof getSafeAreaInsets;
|
|
355
|
+
subscribe: typeof subscribeSafeAreaInsets;
|
|
311
356
|
};
|
|
312
357
|
|
|
313
358
|
declare const GoogleAdMob: {
|
|
@@ -922,4 +967,4 @@ declare const startUpdateLocation: {
|
|
|
922
967
|
openPermissionDialog(): Promise<"denied" | "allowed">;
|
|
923
968
|
};
|
|
924
969
|
|
|
925
|
-
export { type AddAccessoryButtonOptions, type AppsInTossEvent, type AppsInTossGlobals, type CompletedOrRefundedOrdersResult, GoogleAdMob, type GraniteEvent, IAP, type IapCreateOneTimePurchaseOrderOptions, type IapProductListItem, Storage, type TdsEvent, appsInTossEvent, env, fetchAlbumPhotos, fetchContacts, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getSafeAreaInsets, graniteEvent, isMinVersionSupported, openCamera, partner, setClipboardText, startUpdateLocation, tdsEvent };
|
|
970
|
+
export { type AddAccessoryButtonOptions, type AppsInTossEvent, type AppsInTossGlobals, type CompletedOrRefundedOrdersResult, GoogleAdMob, type GraniteEvent, IAP, type IapCreateOneTimePurchaseOrderOptions, type IapProductListItem, SafeAreaInsets, Storage, type TdsEvent, appsInTossEvent, env, fetchAlbumPhotos, fetchContacts, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getSafeAreaInsets, graniteEvent, isMinVersionSupported, openCamera, partner, setClipboardText, startUpdateLocation, tdsEvent };
|
package/built/index.js
CHANGED
|
@@ -262,7 +262,7 @@ var IAP = {
|
|
|
262
262
|
* @category 인앱결제
|
|
263
263
|
* @name getPendingOrders
|
|
264
264
|
* @description 대기 중인 주문 목록을 가져와요. 이 함수를 사용하면 결제가 아직 완료되지 않은 주문 정보를 확인할 수 있어요.
|
|
265
|
-
* @returns {Promise<{ orders: { orderId: string; sku: string; }[]}}>} 대기 중인 주문의 배열을 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.234.0, iOS 5.231.0)보다 낮으면 `undefined`를 반환해요.
|
|
265
|
+
* @returns {Promise<{ orders: { orderId: string; sku: string; paymentCompletedDate: string; }[]}}>} 대기 중인 주문의 배열을 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.234.0, iOS 5.231.0)보다 낮으면 `undefined`를 반환해요.
|
|
266
266
|
*
|
|
267
267
|
* @example
|
|
268
268
|
* ### 대기 중인 주문 목록 가져오기
|
|
@@ -279,7 +279,9 @@ var IAP = {
|
|
|
279
279
|
* }
|
|
280
280
|
* ```
|
|
281
281
|
*/
|
|
282
|
-
getPendingOrders: createAsyncBridge2(
|
|
282
|
+
getPendingOrders: createAsyncBridge2(
|
|
283
|
+
"getPendingOrders"
|
|
284
|
+
),
|
|
283
285
|
/**
|
|
284
286
|
* @public
|
|
285
287
|
* @category 인앱결제
|
|
@@ -332,12 +334,28 @@ var IAP = {
|
|
|
332
334
|
import { createConstantBridge as createConstantBridge2 } from "@apps-in-toss/bridge-core";
|
|
333
335
|
var getSafeAreaBottom = createConstantBridge2("getSafeAreaBottom");
|
|
334
336
|
var getSafeAreaTop = createConstantBridge2("getSafeAreaTop");
|
|
337
|
+
var getSafeAreaLeft = createConstantBridge2("getSafeAreaLeft");
|
|
338
|
+
var getSafeAreaRight = createConstantBridge2("getSafeAreaRight");
|
|
335
339
|
function getSafeAreaInsets() {
|
|
336
|
-
return { top: getSafeAreaTop(), bottom: getSafeAreaBottom() };
|
|
340
|
+
return { top: getSafeAreaTop(), bottom: getSafeAreaBottom(), left: getSafeAreaLeft(), right: getSafeAreaRight() };
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// src/safeAreaInsets.ts
|
|
344
|
+
import { createEventBridge as createEventBridge2 } from "@apps-in-toss/bridge-core";
|
|
345
|
+
function subscribeSafeAreaInsets({ onEvent }) {
|
|
346
|
+
return createEventBridge2("safeAreaInsetsChange")({
|
|
347
|
+
onEvent,
|
|
348
|
+
onError: () => {
|
|
349
|
+
}
|
|
350
|
+
});
|
|
337
351
|
}
|
|
352
|
+
var SafeAreaInsets = {
|
|
353
|
+
get: getSafeAreaInsets,
|
|
354
|
+
subscribe: subscribeSafeAreaInsets
|
|
355
|
+
};
|
|
338
356
|
|
|
339
357
|
// src/googleAdMob.ts
|
|
340
|
-
import { createConstantBridge as createConstantBridge3, createEventBridge as
|
|
358
|
+
import { createConstantBridge as createConstantBridge3, createEventBridge as createEventBridge3 } from "@apps-in-toss/bridge-core";
|
|
341
359
|
var GoogleAdMob = {
|
|
342
360
|
/**
|
|
343
361
|
* @public
|
|
@@ -388,7 +406,7 @@ var GoogleAdMob = {
|
|
|
388
406
|
* ```
|
|
389
407
|
*/
|
|
390
408
|
loadAdMobInterstitialAd: Object.assign(
|
|
391
|
-
|
|
409
|
+
createEventBridge3("loadAdMobInterstitialAd"),
|
|
392
410
|
{
|
|
393
411
|
isSupported: createConstantBridge3("loadAdMobInterstitialAd_isSupported")
|
|
394
412
|
}
|
|
@@ -463,7 +481,7 @@ var GoogleAdMob = {
|
|
|
463
481
|
* ```
|
|
464
482
|
*/
|
|
465
483
|
showAdMobInterstitialAd: Object.assign(
|
|
466
|
-
|
|
484
|
+
createEventBridge3("showAdMobInterstitialAd"),
|
|
467
485
|
{
|
|
468
486
|
isSupported: createConstantBridge3("showAdMobInterstitialAd_isSupported")
|
|
469
487
|
}
|
|
@@ -517,7 +535,7 @@ var GoogleAdMob = {
|
|
|
517
535
|
* ```
|
|
518
536
|
*/
|
|
519
537
|
loadAdMobRewardedAd: Object.assign(
|
|
520
|
-
|
|
538
|
+
createEventBridge3("loadAdMobRewardedAd"),
|
|
521
539
|
{
|
|
522
540
|
isSupported: createConstantBridge3("loadAdMobRewardedAd_isSupported")
|
|
523
541
|
}
|
|
@@ -592,7 +610,7 @@ var GoogleAdMob = {
|
|
|
592
610
|
* ```
|
|
593
611
|
*/
|
|
594
612
|
showAdMobRewardedAd: Object.assign(
|
|
595
|
-
|
|
613
|
+
createEventBridge3("showAdMobRewardedAd"),
|
|
596
614
|
{
|
|
597
615
|
isSupported: createConstantBridge3("showAdMobRewardedAd_isSupported")
|
|
598
616
|
}
|
|
@@ -651,7 +669,7 @@ var GoogleAdMob = {
|
|
|
651
669
|
* }
|
|
652
670
|
* ```
|
|
653
671
|
*/
|
|
654
|
-
loadAppsInTossAdMob: Object.assign(
|
|
672
|
+
loadAppsInTossAdMob: Object.assign(createEventBridge3("loadAppsInTossAdMob"), {
|
|
655
673
|
isSupported: createConstantBridge3("loadAppsInTossAdMob_isSupported")
|
|
656
674
|
}),
|
|
657
675
|
/**
|
|
@@ -729,19 +747,19 @@ var GoogleAdMob = {
|
|
|
729
747
|
* }
|
|
730
748
|
* ```
|
|
731
749
|
*/
|
|
732
|
-
showAppsInTossAdMob: Object.assign(
|
|
750
|
+
showAppsInTossAdMob: Object.assign(createEventBridge3("showAppsInTossAdMob"), {
|
|
733
751
|
isSupported: createConstantBridge3("showAppsInTossAdMob_isSupported")
|
|
734
752
|
})
|
|
735
753
|
};
|
|
736
754
|
|
|
737
755
|
// src/graniteEvent.ts
|
|
738
|
-
import { createEventBridge as
|
|
756
|
+
import { createEventBridge as createEventBridge4 } from "@apps-in-toss/bridge-core";
|
|
739
757
|
var graniteEvent = {
|
|
740
758
|
addEventListener: (event, {
|
|
741
759
|
onEvent,
|
|
742
760
|
onError,
|
|
743
761
|
options
|
|
744
|
-
}) =>
|
|
762
|
+
}) => createEventBridge4(event)({
|
|
745
763
|
onEvent,
|
|
746
764
|
onError: onError ?? (() => {
|
|
747
765
|
}),
|
|
@@ -750,13 +768,13 @@ var graniteEvent = {
|
|
|
750
768
|
};
|
|
751
769
|
|
|
752
770
|
// src/appsInTossEvent.ts
|
|
753
|
-
import { createEventBridge as
|
|
771
|
+
import { createEventBridge as createEventBridge5 } from "@apps-in-toss/bridge-core";
|
|
754
772
|
var appsInTossEvent = {
|
|
755
773
|
addEventListener: (event, {
|
|
756
774
|
onEvent,
|
|
757
775
|
onError,
|
|
758
776
|
options
|
|
759
|
-
}) =>
|
|
777
|
+
}) => createEventBridge5(event)({
|
|
760
778
|
onEvent,
|
|
761
779
|
onError: onError ?? (() => {
|
|
762
780
|
}),
|
|
@@ -788,7 +806,7 @@ var getAppsInTossGlobals = () => {
|
|
|
788
806
|
};
|
|
789
807
|
|
|
790
808
|
// src/tdsEvent.ts
|
|
791
|
-
import { createEventBridge as
|
|
809
|
+
import { createEventBridge as createEventBridge6 } from "@apps-in-toss/bridge-core";
|
|
792
810
|
var tdsEvent = {
|
|
793
811
|
/**
|
|
794
812
|
* @public
|
|
@@ -818,7 +836,7 @@ var tdsEvent = {
|
|
|
818
836
|
onEvent,
|
|
819
837
|
onError,
|
|
820
838
|
options
|
|
821
|
-
}) =>
|
|
839
|
+
}) => createEventBridge6(event)({
|
|
822
840
|
onEvent,
|
|
823
841
|
onError: onError ?? (() => {
|
|
824
842
|
}),
|
|
@@ -983,14 +1001,14 @@ var getClipboardText = createPermissionFunction({
|
|
|
983
1001
|
});
|
|
984
1002
|
|
|
985
1003
|
// src/permissions/startUpdateLocation.ts
|
|
986
|
-
import { createAsyncBridge as createAsyncBridge11, createEventBridge as
|
|
1004
|
+
import { createAsyncBridge as createAsyncBridge11, createEventBridge as createEventBridge7 } from "@apps-in-toss/bridge-core";
|
|
987
1005
|
import {
|
|
988
1006
|
StartUpdateLocationPermissionError
|
|
989
1007
|
} from "@apps-in-toss/types";
|
|
990
1008
|
var getPermission2 = createAsyncBridge11("getPermission");
|
|
991
1009
|
var openPermissionDialog2 = createAsyncBridge11("openPermissionDialog");
|
|
992
1010
|
var startUpdateLocation = (params) => {
|
|
993
|
-
return
|
|
1011
|
+
return createEventBridge7("updateLocationEvent")({
|
|
994
1012
|
...params,
|
|
995
1013
|
onError: (error) => {
|
|
996
1014
|
const locationError = new StartUpdateLocationPermissionError();
|
|
@@ -1009,6 +1027,7 @@ export * from "@apps-in-toss/types";
|
|
|
1009
1027
|
export {
|
|
1010
1028
|
GoogleAdMob,
|
|
1011
1029
|
IAP,
|
|
1030
|
+
SafeAreaInsets,
|
|
1012
1031
|
Storage,
|
|
1013
1032
|
appsInTossEvent,
|
|
1014
1033
|
env,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apps-in-toss/web-bridge",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.8",
|
|
5
5
|
"description": "Web Bridge for Apps In Toss",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"built"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@apps-in-toss/types": "1.4.
|
|
31
|
+
"@apps-in-toss/types": "1.4.8"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@apps-in-toss/bridge-core": "1.4.
|
|
35
|
-
"@apps-in-toss/framework": "1.4.
|
|
34
|
+
"@apps-in-toss/bridge-core": "1.4.8",
|
|
35
|
+
"@apps-in-toss/framework": "1.4.8",
|
|
36
36
|
"@swc/core": "^1.12.7",
|
|
37
37
|
"picocolors": "^1.1.1",
|
|
38
38
|
"ts-morph": "^26.0.0",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "cc855970b30e1ce9098bd639b48212b8e21c0722"
|
|
50
50
|
}
|