@apps-in-toss/native-modules 0.0.0-dev.1757573431379 → 0.0.0-dev.1758103372343
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +28 -40
- package/dist/index.d.cts +1 -7
- package/dist/index.d.ts +1 -7
- package/dist/index.js +6 -18
- package/package.json +5 -5
- package/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts +1 -2
- package/dist/VisibilityChangedByTransparentServiceWebEvent-D6XJvPVh.d.cts +0 -20
- package/dist/VisibilityChangedByTransparentServiceWebEvent-D6XJvPVh.d.ts +0 -20
- package/dist/chunk-YS54L7RG.js +0 -209
- package/dist/private.cjs +0 -236
- package/dist/private.d.cts +0 -17
- package/dist/private.d.ts +0 -17
- package/dist/private.js +0 -11
- package/src/AppsInTossModule/native-event-emitter/event-plugins/HomeIconButtonClickHandleEvent.ts +0 -10
package/dist/index.cjs
CHANGED
|
@@ -68,7 +68,7 @@ __export(index_exports, {
|
|
|
68
68
|
module.exports = __toCommonJS(index_exports);
|
|
69
69
|
|
|
70
70
|
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
71
|
-
var
|
|
71
|
+
var import_react_native7 = require("@granite-js/react-native");
|
|
72
72
|
|
|
73
73
|
// src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
|
|
74
74
|
var import_react_native = require("@granite-js/react-native");
|
|
@@ -81,24 +81,13 @@ var EntryMessageExitedEvent = class extends import_react_native.GraniteEventDefi
|
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/HomeIconButtonClickHandleEvent.ts
|
|
85
|
-
var import_react_native2 = require("@granite-js/react-native");
|
|
86
|
-
var HomeIconButtonClickHandleEvent = class extends import_react_native2.GraniteEventDefinition {
|
|
87
|
-
name = "homeIconButtonClickEvent";
|
|
88
|
-
remove() {
|
|
89
|
-
}
|
|
90
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
91
|
-
listener(_) {
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
84
|
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
96
85
|
var import_types = require("@apps-in-toss/types");
|
|
97
|
-
var
|
|
86
|
+
var import_react_native4 = require("@granite-js/react-native");
|
|
98
87
|
|
|
99
88
|
// src/AppsInTossModule/native-modules/AppsInTossModule.ts
|
|
100
|
-
var
|
|
101
|
-
var Module =
|
|
89
|
+
var import_react_native2 = require("react-native");
|
|
90
|
+
var Module = import_react_native2.TurboModuleRegistry.getEnforcing("AppsInTossModule");
|
|
102
91
|
var AppsInTossModuleInstance = Module;
|
|
103
92
|
var AppsInTossModule = Module;
|
|
104
93
|
|
|
@@ -125,11 +114,11 @@ async function requestPermission(permission) {
|
|
|
125
114
|
}
|
|
126
115
|
|
|
127
116
|
// src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts
|
|
128
|
-
var
|
|
129
|
-
var nativeEventEmitter = new
|
|
117
|
+
var import_react_native3 = require("react-native");
|
|
118
|
+
var nativeEventEmitter = new import_react_native3.NativeEventEmitter(AppsInTossModuleInstance);
|
|
130
119
|
|
|
131
120
|
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
132
|
-
var UpdateLocationEvent = class extends
|
|
121
|
+
var UpdateLocationEvent = class extends import_react_native4.GraniteEventDefinition {
|
|
133
122
|
name = "updateLocationEvent";
|
|
134
123
|
subscriptionCount = 0;
|
|
135
124
|
ref = {
|
|
@@ -159,7 +148,7 @@ var UpdateLocationEvent = class extends import_react_native5.GraniteEventDefinit
|
|
|
159
148
|
};
|
|
160
149
|
|
|
161
150
|
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
162
|
-
var
|
|
151
|
+
var import_react_native5 = require("@granite-js/react-native");
|
|
163
152
|
|
|
164
153
|
// src/utils/generateUUID.ts
|
|
165
154
|
function generateUUID(placeholder) {
|
|
@@ -221,7 +210,7 @@ var INTERNAL__appBridgeHandler = {
|
|
|
221
210
|
|
|
222
211
|
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
223
212
|
var UNSAFE__nativeEventEmitter = nativeEventEmitter;
|
|
224
|
-
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends
|
|
213
|
+
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_native5.GraniteEventDefinition {
|
|
225
214
|
static INTERNAL__appBridgeSubscription;
|
|
226
215
|
name = "appBridgeCallbackEvent";
|
|
227
216
|
constructor() {
|
|
@@ -251,8 +240,8 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_
|
|
|
251
240
|
};
|
|
252
241
|
|
|
253
242
|
// src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
254
|
-
var
|
|
255
|
-
var VisibilityChangedByTransparentServiceWebEvent = class extends
|
|
243
|
+
var import_react_native6 = require("@granite-js/react-native");
|
|
244
|
+
var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_native6.GraniteEventDefinition {
|
|
256
245
|
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
257
246
|
subscription = null;
|
|
258
247
|
remove() {
|
|
@@ -277,10 +266,9 @@ var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_n
|
|
|
277
266
|
};
|
|
278
267
|
|
|
279
268
|
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
280
|
-
var appsInTossEvent = new
|
|
269
|
+
var appsInTossEvent = new import_react_native7.GraniteEvent([
|
|
281
270
|
new UpdateLocationEvent(),
|
|
282
271
|
new EntryMessageExitedEvent(),
|
|
283
|
-
new HomeIconButtonClickHandleEvent(),
|
|
284
272
|
// Internal events
|
|
285
273
|
new AppBridgeCallbackEvent(),
|
|
286
274
|
new VisibilityChangedByTransparentServiceWebEvent()
|
|
@@ -295,7 +283,7 @@ function getOperationalEnvironment() {
|
|
|
295
283
|
}
|
|
296
284
|
|
|
297
285
|
// src/AppsInTossModule/native-modules/isMinVersionSupported.ts
|
|
298
|
-
var
|
|
286
|
+
var import_react_native8 = require("react-native");
|
|
299
287
|
|
|
300
288
|
// src/utils/compareVersion.ts
|
|
301
289
|
var SEMVER_REGEX = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
|
|
@@ -371,7 +359,7 @@ function isMinVersionSupported(minVersions) {
|
|
|
371
359
|
return true;
|
|
372
360
|
}
|
|
373
361
|
const currentVersion = AppsInTossModule.tossAppVersion;
|
|
374
|
-
const isIOS =
|
|
362
|
+
const isIOS = import_react_native8.Platform.OS === "ios";
|
|
375
363
|
const minVersion = isIOS ? minVersions.ios : minVersions.android;
|
|
376
364
|
if (minVersion === void 0) {
|
|
377
365
|
return false;
|
|
@@ -795,7 +783,7 @@ var Storage = {
|
|
|
795
783
|
};
|
|
796
784
|
|
|
797
785
|
// src/AppsInTossModule/native-modules/openGameCenterLeaderboard.ts
|
|
798
|
-
var
|
|
786
|
+
var import_react_native9 = require("@granite-js/react-native");
|
|
799
787
|
|
|
800
788
|
// src/AppsInTossModule/constants.ts
|
|
801
789
|
var GAME_CENTER_MIN_VERSION = {
|
|
@@ -815,7 +803,7 @@ async function openGameCenterLeaderboard() {
|
|
|
815
803
|
const url = new URL("servicetoss://game-center/leaderboard?_navbar=hide");
|
|
816
804
|
url.searchParams.set("appName", appName);
|
|
817
805
|
url.searchParams.set("referrer", `appsintoss.${appName}`);
|
|
818
|
-
return (0,
|
|
806
|
+
return (0, import_react_native9.openURL)(url.toString());
|
|
819
807
|
}
|
|
820
808
|
|
|
821
809
|
// src/AppsInTossModule/native-modules/getGameCenterGameProfile.ts
|
|
@@ -888,8 +876,8 @@ function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
|
888
876
|
}
|
|
889
877
|
|
|
890
878
|
// src/BedrockModule/native-modules/natives/BedrockModule.ts
|
|
891
|
-
var
|
|
892
|
-
var BedrockModule =
|
|
879
|
+
var import_react_native10 = require("react-native");
|
|
880
|
+
var BedrockModule = import_react_native10.NativeModules.BedrockModule;
|
|
893
881
|
|
|
894
882
|
// src/BedrockModule/native-modules/natives/closeView.ts
|
|
895
883
|
async function closeView() {
|
|
@@ -897,10 +885,10 @@ async function closeView() {
|
|
|
897
885
|
}
|
|
898
886
|
|
|
899
887
|
// src/BedrockModule/native-modules/natives/getLocale.ts
|
|
900
|
-
var
|
|
888
|
+
var import_react_native11 = require("react-native");
|
|
901
889
|
function getLocale() {
|
|
902
890
|
const locale = BedrockModule?.DeviceInfo?.locale ?? "ko-KR";
|
|
903
|
-
if (
|
|
891
|
+
if (import_react_native11.Platform.OS === "android") {
|
|
904
892
|
return replaceUnderbarToHypen(locale);
|
|
905
893
|
}
|
|
906
894
|
return locale;
|
|
@@ -948,24 +936,24 @@ async function setIosSwipeGestureEnabled(options) {
|
|
|
948
936
|
}
|
|
949
937
|
|
|
950
938
|
// src/BedrockModule/native-modules/natives/openURL.ts
|
|
951
|
-
var
|
|
939
|
+
var import_react_native12 = require("react-native");
|
|
952
940
|
function openURL2(url) {
|
|
953
|
-
return
|
|
941
|
+
return import_react_native12.Linking.openURL(url);
|
|
954
942
|
}
|
|
955
943
|
|
|
956
944
|
// src/BedrockModule/native-modules/natives/getPlatformOS.ts
|
|
957
|
-
var
|
|
945
|
+
var import_react_native13 = require("react-native");
|
|
958
946
|
function getPlatformOS() {
|
|
959
|
-
return
|
|
947
|
+
return import_react_native13.Platform.OS;
|
|
960
948
|
}
|
|
961
949
|
|
|
962
950
|
// src/BedrockModule/native-modules/core/BedrockCoreModule.ts
|
|
963
|
-
var
|
|
964
|
-
var BedrockCoreModule =
|
|
951
|
+
var import_react_native14 = require("react-native");
|
|
952
|
+
var BedrockCoreModule = import_react_native14.NativeModules.BedrockCoreModule;
|
|
965
953
|
|
|
966
954
|
// src/AppsInTossModule/native-modules/tossCore.ts
|
|
967
|
-
var
|
|
968
|
-
var TossCoreModule =
|
|
955
|
+
var import_react_native15 = require("react-native");
|
|
956
|
+
var TossCoreModule = import_react_native15.NativeModules.TossCoreModule;
|
|
969
957
|
function tossCoreEventLog(params) {
|
|
970
958
|
const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
|
|
971
959
|
const isSandbox = getOperationalEnvironment() === "sandbox";
|
package/dist/index.d.cts
CHANGED
|
@@ -237,12 +237,6 @@ declare class EntryMessageExitedEvent extends GraniteEventDefinition<undefined,
|
|
|
237
237
|
listener(_: undefined): void;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
declare class HomeIconButtonClickHandleEvent extends GraniteEventDefinition<undefined, undefined> {
|
|
241
|
-
name: "homeIconButtonClickEvent";
|
|
242
|
-
remove(): void;
|
|
243
|
-
listener(_: undefined): void;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
240
|
interface StartUpdateLocationOptions {
|
|
247
241
|
/**
|
|
248
242
|
* 위치 정확도를 설정해요.
|
|
@@ -292,7 +286,7 @@ declare class VisibilityChangedByTransparentServiceWebEvent extends GraniteEvent
|
|
|
292
286
|
private isVisibilityChangedByTransparentServiceWebResult;
|
|
293
287
|
}
|
|
294
288
|
|
|
295
|
-
declare const appsInTossEvent: GraniteEvent<EntryMessageExitedEvent |
|
|
289
|
+
declare const appsInTossEvent: GraniteEvent<EntryMessageExitedEvent | UpdateLocationEvent | AppBridgeCallbackEvent | VisibilityChangedByTransparentServiceWebEvent>;
|
|
296
290
|
|
|
297
291
|
declare function onVisibilityChangedByTransparentServiceWeb(eventParams: {
|
|
298
292
|
options: {
|
package/dist/index.d.ts
CHANGED
|
@@ -237,12 +237,6 @@ declare class EntryMessageExitedEvent extends GraniteEventDefinition<undefined,
|
|
|
237
237
|
listener(_: undefined): void;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
declare class HomeIconButtonClickHandleEvent extends GraniteEventDefinition<undefined, undefined> {
|
|
241
|
-
name: "homeIconButtonClickEvent";
|
|
242
|
-
remove(): void;
|
|
243
|
-
listener(_: undefined): void;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
240
|
interface StartUpdateLocationOptions {
|
|
247
241
|
/**
|
|
248
242
|
* 위치 정확도를 설정해요.
|
|
@@ -292,7 +286,7 @@ declare class VisibilityChangedByTransparentServiceWebEvent extends GraniteEvent
|
|
|
292
286
|
private isVisibilityChangedByTransparentServiceWebResult;
|
|
293
287
|
}
|
|
294
288
|
|
|
295
|
-
declare const appsInTossEvent: GraniteEvent<EntryMessageExitedEvent |
|
|
289
|
+
declare const appsInTossEvent: GraniteEvent<EntryMessageExitedEvent | UpdateLocationEvent | AppBridgeCallbackEvent | VisibilityChangedByTransparentServiceWebEvent>;
|
|
296
290
|
|
|
297
291
|
declare function onVisibilityChangedByTransparentServiceWeb(eventParams: {
|
|
298
292
|
options: {
|
package/dist/index.js
CHANGED
|
@@ -12,20 +12,9 @@ var EntryMessageExitedEvent = class extends GraniteEventDefinition {
|
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/HomeIconButtonClickHandleEvent.ts
|
|
16
|
-
import { GraniteEventDefinition as GraniteEventDefinition2 } from "@granite-js/react-native";
|
|
17
|
-
var HomeIconButtonClickHandleEvent = class extends GraniteEventDefinition2 {
|
|
18
|
-
name = "homeIconButtonClickEvent";
|
|
19
|
-
remove() {
|
|
20
|
-
}
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
|
-
listener(_) {
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
15
|
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
27
16
|
import { GetCurrentLocationPermissionError } from "@apps-in-toss/types";
|
|
28
|
-
import { GraniteEventDefinition as
|
|
17
|
+
import { GraniteEventDefinition as GraniteEventDefinition2 } from "@granite-js/react-native";
|
|
29
18
|
|
|
30
19
|
// src/AppsInTossModule/native-modules/AppsInTossModule.ts
|
|
31
20
|
import { TurboModuleRegistry } from "react-native";
|
|
@@ -60,7 +49,7 @@ import { NativeEventEmitter } from "react-native";
|
|
|
60
49
|
var nativeEventEmitter = new NativeEventEmitter(AppsInTossModuleInstance);
|
|
61
50
|
|
|
62
51
|
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
63
|
-
var UpdateLocationEvent = class extends
|
|
52
|
+
var UpdateLocationEvent = class extends GraniteEventDefinition2 {
|
|
64
53
|
name = "updateLocationEvent";
|
|
65
54
|
subscriptionCount = 0;
|
|
66
55
|
ref = {
|
|
@@ -90,7 +79,7 @@ var UpdateLocationEvent = class extends GraniteEventDefinition3 {
|
|
|
90
79
|
};
|
|
91
80
|
|
|
92
81
|
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
93
|
-
import { GraniteEventDefinition as
|
|
82
|
+
import { GraniteEventDefinition as GraniteEventDefinition3 } from "@granite-js/react-native";
|
|
94
83
|
|
|
95
84
|
// src/utils/generateUUID.ts
|
|
96
85
|
function generateUUID(placeholder) {
|
|
@@ -152,7 +141,7 @@ var INTERNAL__appBridgeHandler = {
|
|
|
152
141
|
|
|
153
142
|
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
154
143
|
var UNSAFE__nativeEventEmitter = nativeEventEmitter;
|
|
155
|
-
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends
|
|
144
|
+
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends GraniteEventDefinition3 {
|
|
156
145
|
static INTERNAL__appBridgeSubscription;
|
|
157
146
|
name = "appBridgeCallbackEvent";
|
|
158
147
|
constructor() {
|
|
@@ -182,8 +171,8 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends GraniteEventD
|
|
|
182
171
|
};
|
|
183
172
|
|
|
184
173
|
// src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
185
|
-
import { GraniteEventDefinition as
|
|
186
|
-
var VisibilityChangedByTransparentServiceWebEvent = class extends
|
|
174
|
+
import { GraniteEventDefinition as GraniteEventDefinition4 } from "@granite-js/react-native";
|
|
175
|
+
var VisibilityChangedByTransparentServiceWebEvent = class extends GraniteEventDefinition4 {
|
|
187
176
|
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
188
177
|
subscription = null;
|
|
189
178
|
remove() {
|
|
@@ -211,7 +200,6 @@ var VisibilityChangedByTransparentServiceWebEvent = class extends GraniteEventDe
|
|
|
211
200
|
var appsInTossEvent = new GraniteEvent([
|
|
212
201
|
new UpdateLocationEvent(),
|
|
213
202
|
new EntryMessageExitedEvent(),
|
|
214
|
-
new HomeIconButtonClickHandleEvent(),
|
|
215
203
|
// Internal events
|
|
216
204
|
new AppBridgeCallbackEvent(),
|
|
217
205
|
new VisibilityChangedByTransparentServiceWebEvent()
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apps-in-toss/native-modules",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-dev.
|
|
4
|
+
"version": "0.0.0-dev.1758103372343",
|
|
5
5
|
"description": "Native Modules for Apps In Toss",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
],
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/runtime": "^7",
|
|
33
|
-
"@granite-js/native": "0.1.
|
|
34
|
-
"@granite-js/react-native": "0.1.
|
|
33
|
+
"@granite-js/native": "0.1.22",
|
|
34
|
+
"@granite-js/react-native": "0.1.22",
|
|
35
35
|
"@types/react": "18.3.3",
|
|
36
36
|
"dts-bundle-generator": "^9.5.1",
|
|
37
37
|
"esbuild": "0.25.5",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"vitest": "^3.2.4"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@apps-in-toss/types": "^0.0.0-dev.
|
|
46
|
+
"@apps-in-toss/types": "^0.0.0-dev.1758103372343",
|
|
47
47
|
"es-toolkit": "^1.39.3"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "dd32f2c8028913b7f866a3a099728410d783dcd6"
|
|
58
58
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GraniteEvent } from '@granite-js/react-native';
|
|
2
2
|
import { EntryMessageExitedEvent } from './event-plugins/EntryMessageExitedEvent';
|
|
3
|
-
import { HomeIconButtonClickHandleEvent } from './event-plugins/HomeIconButtonClickHandleEvent';
|
|
4
3
|
import { UpdateLocationEvent } from './event-plugins/UpdateLocationEvent';
|
|
5
4
|
import { AppBridgeCallbackEvent } from './internal/AppBridgeCallbackEvent';
|
|
6
5
|
import { VisibilityChangedByTransparentServiceWebEvent } from './internal/VisibilityChangedByTransparentServiceWebEvent';
|
|
@@ -8,7 +7,7 @@ import { VisibilityChangedByTransparentServiceWebEvent } from './internal/Visibi
|
|
|
8
7
|
export const appsInTossEvent = new GraniteEvent([
|
|
9
8
|
new UpdateLocationEvent(),
|
|
10
9
|
new EntryMessageExitedEvent(),
|
|
11
|
-
|
|
10
|
+
|
|
12
11
|
// Internal events
|
|
13
12
|
new AppBridgeCallbackEvent(),
|
|
14
13
|
new VisibilityChangedByTransparentServiceWebEvent(),
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { GraniteEventDefinition } from '@granite-js/react-native';
|
|
2
|
-
import { EmitterSubscription } from 'react-native';
|
|
3
|
-
|
|
4
|
-
interface EventEmitterSchema<K extends string, P extends unknown[]> {
|
|
5
|
-
name: K;
|
|
6
|
-
params: P;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface VisibilityChangedByTransparentServiceWebOptions {
|
|
10
|
-
callbackId: string;
|
|
11
|
-
}
|
|
12
|
-
declare class VisibilityChangedByTransparentServiceWebEvent extends GraniteEventDefinition<VisibilityChangedByTransparentServiceWebOptions, boolean> {
|
|
13
|
-
name: "onVisibilityChangedByTransparentServiceWeb";
|
|
14
|
-
subscription: EmitterSubscription | null;
|
|
15
|
-
remove(): void;
|
|
16
|
-
listener(options: VisibilityChangedByTransparentServiceWebOptions, onEvent: (isVisible: boolean) => void, onError: (error: unknown) => void): void;
|
|
17
|
-
private isVisibilityChangedByTransparentServiceWebResult;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { type EventEmitterSchema as E, VisibilityChangedByTransparentServiceWebEvent as V, type VisibilityChangedByTransparentServiceWebOptions as a };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { GraniteEventDefinition } from '@granite-js/react-native';
|
|
2
|
-
import { EmitterSubscription } from 'react-native';
|
|
3
|
-
|
|
4
|
-
interface EventEmitterSchema<K extends string, P extends unknown[]> {
|
|
5
|
-
name: K;
|
|
6
|
-
params: P;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface VisibilityChangedByTransparentServiceWebOptions {
|
|
10
|
-
callbackId: string;
|
|
11
|
-
}
|
|
12
|
-
declare class VisibilityChangedByTransparentServiceWebEvent extends GraniteEventDefinition<VisibilityChangedByTransparentServiceWebOptions, boolean> {
|
|
13
|
-
name: "onVisibilityChangedByTransparentServiceWeb";
|
|
14
|
-
subscription: EmitterSubscription | null;
|
|
15
|
-
remove(): void;
|
|
16
|
-
listener(options: VisibilityChangedByTransparentServiceWebOptions, onEvent: (isVisible: boolean) => void, onError: (error: unknown) => void): void;
|
|
17
|
-
private isVisibilityChangedByTransparentServiceWebResult;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { type EventEmitterSchema as E, VisibilityChangedByTransparentServiceWebEvent as V, type VisibilityChangedByTransparentServiceWebOptions as a };
|
package/dist/chunk-YS54L7RG.js
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
// src/AppsInTossModule/native-modules/AppsInTossModule.ts
|
|
2
|
-
import { TurboModuleRegistry } from "react-native";
|
|
3
|
-
var Module = TurboModuleRegistry.getEnforcing("AppsInTossModule");
|
|
4
|
-
var AppsInTossModuleInstance = Module;
|
|
5
|
-
var AppsInTossModule = Module;
|
|
6
|
-
|
|
7
|
-
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
8
|
-
import { GraniteEvent } from "@granite-js/react-native";
|
|
9
|
-
|
|
10
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
|
|
11
|
-
import { GraniteEventDefinition } from "@granite-js/react-native";
|
|
12
|
-
var EntryMessageExitedEvent = class extends GraniteEventDefinition {
|
|
13
|
-
name = "entryMessageExited";
|
|
14
|
-
remove() {
|
|
15
|
-
}
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
17
|
-
listener(_) {
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
22
|
-
import { GraniteEventDefinition as GraniteEventDefinition2 } from "@granite-js/react-native";
|
|
23
|
-
|
|
24
|
-
// src/AppsInTossModule/native-modules/getPermission.ts
|
|
25
|
-
function getPermission(permission) {
|
|
26
|
-
return AppsInTossModule.getPermission(permission);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// src/AppsInTossModule/native-modules/openPermissionDialog.ts
|
|
30
|
-
function openPermissionDialog(permission) {
|
|
31
|
-
return AppsInTossModule.openPermissionDialog(permission);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// src/AppsInTossModule/native-modules/requestPermission.ts
|
|
35
|
-
async function requestPermission(permission) {
|
|
36
|
-
const permissionStatus = await getPermission(permission);
|
|
37
|
-
switch (permissionStatus) {
|
|
38
|
-
case "allowed":
|
|
39
|
-
case "denied":
|
|
40
|
-
return permissionStatus;
|
|
41
|
-
default:
|
|
42
|
-
return openPermissionDialog(permission);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts
|
|
47
|
-
import { NativeEventEmitter } from "react-native";
|
|
48
|
-
var nativeEventEmitter = new NativeEventEmitter(AppsInTossModuleInstance);
|
|
49
|
-
|
|
50
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
51
|
-
var UpdateLocationEvent = class extends GraniteEventDefinition2 {
|
|
52
|
-
name = "updateLocationEvent";
|
|
53
|
-
subscriptionCount = 0;
|
|
54
|
-
ref = {
|
|
55
|
-
remove: () => {
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
remove() {
|
|
59
|
-
if (--this.subscriptionCount === 0) {
|
|
60
|
-
AppsInTossModuleInstance.stopUpdateLocation({});
|
|
61
|
-
}
|
|
62
|
-
this.ref.remove();
|
|
63
|
-
}
|
|
64
|
-
listener(options, onEvent, onError) {
|
|
65
|
-
requestPermission({ name: "geolocation", access: "access" }).then((permissionStatus) => {
|
|
66
|
-
if (permissionStatus === "denied") {
|
|
67
|
-
onError(new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694."));
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
void AppsInTossModuleInstance.startUpdateLocation(options).catch(onError);
|
|
71
|
-
const subscription = nativeEventEmitter.addListener("updateLocation", onEvent);
|
|
72
|
-
this.ref = {
|
|
73
|
-
remove: () => subscription?.remove()
|
|
74
|
-
};
|
|
75
|
-
this.subscriptionCount++;
|
|
76
|
-
}).catch(onError);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
81
|
-
import { GraniteEventDefinition as GraniteEventDefinition3 } from "@granite-js/react-native";
|
|
82
|
-
|
|
83
|
-
// src/utils/generateUUID.ts
|
|
84
|
-
function generateUUID(placeholder) {
|
|
85
|
-
return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// src/AppsInTossModule/native-event-emitter/internal/appBridge.ts
|
|
89
|
-
var INTERNAL__callbacks = /* @__PURE__ */ new Map();
|
|
90
|
-
function invokeAppBridgeCallback(id, ...args) {
|
|
91
|
-
const callback = INTERNAL__callbacks.get(id);
|
|
92
|
-
callback?.call(null, ...args);
|
|
93
|
-
return Boolean(callback);
|
|
94
|
-
}
|
|
95
|
-
function invokeAppBridgeMethod(methodName, params, callbacks) {
|
|
96
|
-
const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
|
|
97
|
-
const { callbackMap, unregisterAll } = registerCallbacks(appBridgeCallbacks);
|
|
98
|
-
const promise = AppsInTossModuleInstance[methodName]({
|
|
99
|
-
params,
|
|
100
|
-
callbacks: callbackMap
|
|
101
|
-
});
|
|
102
|
-
void promise.then(onSuccess).catch(onError);
|
|
103
|
-
return unregisterAll;
|
|
104
|
-
}
|
|
105
|
-
function registerCallbacks(callbacks) {
|
|
106
|
-
const callbackMap = {};
|
|
107
|
-
for (const [callbackName, callback] of Object.entries(callbacks)) {
|
|
108
|
-
const id = registerCallback(callback, callbackName);
|
|
109
|
-
callbackMap[callbackName] = id;
|
|
110
|
-
}
|
|
111
|
-
const unregisterAll = () => {
|
|
112
|
-
Object.values(callbackMap).forEach(unregisterCallback);
|
|
113
|
-
};
|
|
114
|
-
return { callbackMap, unregisterAll };
|
|
115
|
-
}
|
|
116
|
-
function registerCallback(callback, name = "unnamed") {
|
|
117
|
-
const uniqueId = generateUUID();
|
|
118
|
-
const callbackId = `${uniqueId}__${name}`;
|
|
119
|
-
INTERNAL__callbacks.set(callbackId, callback);
|
|
120
|
-
return callbackId;
|
|
121
|
-
}
|
|
122
|
-
function unregisterCallback(id) {
|
|
123
|
-
INTERNAL__callbacks.delete(id);
|
|
124
|
-
}
|
|
125
|
-
function getCallbackIds() {
|
|
126
|
-
return Array.from(INTERNAL__callbacks.keys());
|
|
127
|
-
}
|
|
128
|
-
var INTERNAL__appBridgeHandler = {
|
|
129
|
-
invokeAppBridgeCallback,
|
|
130
|
-
invokeAppBridgeMethod,
|
|
131
|
-
registerCallback,
|
|
132
|
-
unregisterCallback,
|
|
133
|
-
getCallbackIds
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
137
|
-
var UNSAFE__nativeEventEmitter = nativeEventEmitter;
|
|
138
|
-
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends GraniteEventDefinition3 {
|
|
139
|
-
static INTERNAL__appBridgeSubscription;
|
|
140
|
-
name = "appBridgeCallbackEvent";
|
|
141
|
-
constructor() {
|
|
142
|
-
super();
|
|
143
|
-
this.registerAppBridgeCallbackEventListener();
|
|
144
|
-
}
|
|
145
|
-
remove() {
|
|
146
|
-
}
|
|
147
|
-
listener() {
|
|
148
|
-
}
|
|
149
|
-
registerAppBridgeCallbackEventListener() {
|
|
150
|
-
if (_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription != null) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription = UNSAFE__nativeEventEmitter.addListener(
|
|
154
|
-
"appBridgeCallback",
|
|
155
|
-
this.ensureInvokeAppBridgeCallback
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
ensureInvokeAppBridgeCallback(result) {
|
|
159
|
-
if (typeof result === "object" && typeof result.name === "string") {
|
|
160
|
-
INTERNAL__appBridgeHandler.invokeAppBridgeCallback(result.name, result.params);
|
|
161
|
-
} else {
|
|
162
|
-
console.warn("Invalid app bridge callback result:", result);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
// src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
168
|
-
import { GraniteEventDefinition as GraniteEventDefinition4 } from "@granite-js/react-native";
|
|
169
|
-
var VisibilityChangedByTransparentServiceWebEvent = class extends GraniteEventDefinition4 {
|
|
170
|
-
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
171
|
-
subscription = null;
|
|
172
|
-
remove() {
|
|
173
|
-
this.subscription?.remove();
|
|
174
|
-
this.subscription = null;
|
|
175
|
-
}
|
|
176
|
-
listener(options, onEvent, onError) {
|
|
177
|
-
const subscription = nativeEventEmitter.addListener("visibilityChangedByTransparentServiceWeb", (params) => {
|
|
178
|
-
if (this.isVisibilityChangedByTransparentServiceWebResult(params)) {
|
|
179
|
-
if (params.callbackId === options.callbackId) {
|
|
180
|
-
onEvent(params.isVisible);
|
|
181
|
-
}
|
|
182
|
-
} else {
|
|
183
|
-
onError(new Error("Invalid visibility changed by transparent service web result"));
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
this.subscription = subscription;
|
|
187
|
-
}
|
|
188
|
-
isVisibilityChangedByTransparentServiceWebResult(params) {
|
|
189
|
-
return typeof params === "object" && typeof params.callbackId === "string" && typeof params.isVisible === "boolean";
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
194
|
-
var appsInTossEvent = new GraniteEvent([
|
|
195
|
-
new AppBridgeCallbackEvent(),
|
|
196
|
-
new UpdateLocationEvent(),
|
|
197
|
-
new EntryMessageExitedEvent(),
|
|
198
|
-
// Internal events
|
|
199
|
-
new AppBridgeCallbackEvent(),
|
|
200
|
-
new VisibilityChangedByTransparentServiceWebEvent()
|
|
201
|
-
]);
|
|
202
|
-
|
|
203
|
-
export {
|
|
204
|
-
AppsInTossModuleInstance,
|
|
205
|
-
AppsInTossModule,
|
|
206
|
-
requestPermission,
|
|
207
|
-
INTERNAL__appBridgeHandler,
|
|
208
|
-
appsInTossEvent
|
|
209
|
-
};
|
package/dist/private.cjs
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/private.ts
|
|
21
|
-
var private_exports = {};
|
|
22
|
-
__export(private_exports, {
|
|
23
|
-
onVisibilityChangedByTransparentServiceWeb: () => onVisibilityChangedByTransparentServiceWeb
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(private_exports);
|
|
26
|
-
|
|
27
|
-
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
28
|
-
var import_react_native7 = require("@granite-js/react-native");
|
|
29
|
-
|
|
30
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
|
|
31
|
-
var import_react_native = require("@granite-js/react-native");
|
|
32
|
-
var EntryMessageExitedEvent = class extends import_react_native.GraniteEventDefinition {
|
|
33
|
-
name = "entryMessageExited";
|
|
34
|
-
remove() {
|
|
35
|
-
}
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
37
|
-
listener(_) {
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
42
|
-
var import_react_native4 = require("@granite-js/react-native");
|
|
43
|
-
|
|
44
|
-
// src/AppsInTossModule/native-modules/AppsInTossModule.ts
|
|
45
|
-
var import_react_native2 = require("react-native");
|
|
46
|
-
var Module = import_react_native2.TurboModuleRegistry.getEnforcing("AppsInTossModule");
|
|
47
|
-
var AppsInTossModuleInstance = Module;
|
|
48
|
-
var AppsInTossModule = Module;
|
|
49
|
-
|
|
50
|
-
// src/AppsInTossModule/native-modules/getPermission.ts
|
|
51
|
-
function getPermission(permission) {
|
|
52
|
-
return AppsInTossModule.getPermission(permission);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// src/AppsInTossModule/native-modules/openPermissionDialog.ts
|
|
56
|
-
function openPermissionDialog(permission) {
|
|
57
|
-
return AppsInTossModule.openPermissionDialog(permission);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// src/AppsInTossModule/native-modules/requestPermission.ts
|
|
61
|
-
async function requestPermission(permission) {
|
|
62
|
-
const permissionStatus = await getPermission(permission);
|
|
63
|
-
switch (permissionStatus) {
|
|
64
|
-
case "allowed":
|
|
65
|
-
case "denied":
|
|
66
|
-
return permissionStatus;
|
|
67
|
-
default:
|
|
68
|
-
return openPermissionDialog(permission);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts
|
|
73
|
-
var import_react_native3 = require("react-native");
|
|
74
|
-
var nativeEventEmitter = new import_react_native3.NativeEventEmitter(AppsInTossModuleInstance);
|
|
75
|
-
|
|
76
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
77
|
-
var UpdateLocationEvent = class extends import_react_native4.GraniteEventDefinition {
|
|
78
|
-
name = "updateLocationEvent";
|
|
79
|
-
subscriptionCount = 0;
|
|
80
|
-
ref = {
|
|
81
|
-
remove: () => {
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
remove() {
|
|
85
|
-
if (--this.subscriptionCount === 0) {
|
|
86
|
-
AppsInTossModuleInstance.stopUpdateLocation({});
|
|
87
|
-
}
|
|
88
|
-
this.ref.remove();
|
|
89
|
-
}
|
|
90
|
-
listener(options, onEvent, onError) {
|
|
91
|
-
requestPermission({ name: "geolocation", access: "access" }).then((permissionStatus) => {
|
|
92
|
-
if (permissionStatus === "denied") {
|
|
93
|
-
onError(new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694."));
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
void AppsInTossModuleInstance.startUpdateLocation(options).catch(onError);
|
|
97
|
-
const subscription = nativeEventEmitter.addListener("updateLocation", onEvent);
|
|
98
|
-
this.ref = {
|
|
99
|
-
remove: () => subscription?.remove()
|
|
100
|
-
};
|
|
101
|
-
this.subscriptionCount++;
|
|
102
|
-
}).catch(onError);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
107
|
-
var import_react_native5 = require("@granite-js/react-native");
|
|
108
|
-
|
|
109
|
-
// src/utils/generateUUID.ts
|
|
110
|
-
function generateUUID(placeholder) {
|
|
111
|
-
return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// src/AppsInTossModule/native-event-emitter/internal/appBridge.ts
|
|
115
|
-
var INTERNAL__callbacks = /* @__PURE__ */ new Map();
|
|
116
|
-
function invokeAppBridgeCallback(id, ...args) {
|
|
117
|
-
const callback = INTERNAL__callbacks.get(id);
|
|
118
|
-
callback?.call(null, ...args);
|
|
119
|
-
return Boolean(callback);
|
|
120
|
-
}
|
|
121
|
-
function invokeAppBridgeMethod(methodName, params, callbacks) {
|
|
122
|
-
const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
|
|
123
|
-
const { callbackMap, unregisterAll } = registerCallbacks(appBridgeCallbacks);
|
|
124
|
-
const promise = AppsInTossModuleInstance[methodName]({
|
|
125
|
-
params,
|
|
126
|
-
callbacks: callbackMap
|
|
127
|
-
});
|
|
128
|
-
void promise.then(onSuccess).catch(onError);
|
|
129
|
-
return unregisterAll;
|
|
130
|
-
}
|
|
131
|
-
function registerCallbacks(callbacks) {
|
|
132
|
-
const callbackMap = {};
|
|
133
|
-
for (const [callbackName, callback] of Object.entries(callbacks)) {
|
|
134
|
-
const id = registerCallback(callback, callbackName);
|
|
135
|
-
callbackMap[callbackName] = id;
|
|
136
|
-
}
|
|
137
|
-
const unregisterAll = () => {
|
|
138
|
-
Object.values(callbackMap).forEach(unregisterCallback);
|
|
139
|
-
};
|
|
140
|
-
return { callbackMap, unregisterAll };
|
|
141
|
-
}
|
|
142
|
-
function registerCallback(callback, name = "unnamed") {
|
|
143
|
-
const uniqueId = generateUUID();
|
|
144
|
-
const callbackId = `${uniqueId}__${name}`;
|
|
145
|
-
INTERNAL__callbacks.set(callbackId, callback);
|
|
146
|
-
return callbackId;
|
|
147
|
-
}
|
|
148
|
-
function unregisterCallback(id) {
|
|
149
|
-
INTERNAL__callbacks.delete(id);
|
|
150
|
-
}
|
|
151
|
-
function getCallbackIds() {
|
|
152
|
-
return Array.from(INTERNAL__callbacks.keys());
|
|
153
|
-
}
|
|
154
|
-
var INTERNAL__appBridgeHandler = {
|
|
155
|
-
invokeAppBridgeCallback,
|
|
156
|
-
invokeAppBridgeMethod,
|
|
157
|
-
registerCallback,
|
|
158
|
-
unregisterCallback,
|
|
159
|
-
getCallbackIds
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
163
|
-
var UNSAFE__nativeEventEmitter = nativeEventEmitter;
|
|
164
|
-
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_native5.GraniteEventDefinition {
|
|
165
|
-
static INTERNAL__appBridgeSubscription;
|
|
166
|
-
name = "appBridgeCallbackEvent";
|
|
167
|
-
constructor() {
|
|
168
|
-
super();
|
|
169
|
-
this.registerAppBridgeCallbackEventListener();
|
|
170
|
-
}
|
|
171
|
-
remove() {
|
|
172
|
-
}
|
|
173
|
-
listener() {
|
|
174
|
-
}
|
|
175
|
-
registerAppBridgeCallbackEventListener() {
|
|
176
|
-
if (_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription != null) {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription = UNSAFE__nativeEventEmitter.addListener(
|
|
180
|
-
"appBridgeCallback",
|
|
181
|
-
this.ensureInvokeAppBridgeCallback
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
ensureInvokeAppBridgeCallback(result) {
|
|
185
|
-
if (typeof result === "object" && typeof result.name === "string") {
|
|
186
|
-
INTERNAL__appBridgeHandler.invokeAppBridgeCallback(result.name, result.params);
|
|
187
|
-
} else {
|
|
188
|
-
console.warn("Invalid app bridge callback result:", result);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
// src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
194
|
-
var import_react_native6 = require("@granite-js/react-native");
|
|
195
|
-
var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_native6.GraniteEventDefinition {
|
|
196
|
-
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
197
|
-
subscription = null;
|
|
198
|
-
remove() {
|
|
199
|
-
this.subscription?.remove();
|
|
200
|
-
this.subscription = null;
|
|
201
|
-
}
|
|
202
|
-
listener(options, onEvent, onError) {
|
|
203
|
-
const subscription = nativeEventEmitter.addListener("visibilityChangedByTransparentServiceWeb", (params) => {
|
|
204
|
-
if (this.isVisibilityChangedByTransparentServiceWebResult(params)) {
|
|
205
|
-
if (params.callbackId === options.callbackId) {
|
|
206
|
-
onEvent(params.isVisible);
|
|
207
|
-
}
|
|
208
|
-
} else {
|
|
209
|
-
onError(new Error("Invalid visibility changed by transparent service web result"));
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
this.subscription = subscription;
|
|
213
|
-
}
|
|
214
|
-
isVisibilityChangedByTransparentServiceWebResult(params) {
|
|
215
|
-
return typeof params === "object" && typeof params.callbackId === "string" && typeof params.isVisible === "boolean";
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
220
|
-
var appsInTossEvent = new import_react_native7.GraniteEvent([
|
|
221
|
-
new AppBridgeCallbackEvent(),
|
|
222
|
-
new UpdateLocationEvent(),
|
|
223
|
-
new EntryMessageExitedEvent(),
|
|
224
|
-
// Internal events
|
|
225
|
-
new AppBridgeCallbackEvent(),
|
|
226
|
-
new VisibilityChangedByTransparentServiceWebEvent()
|
|
227
|
-
]);
|
|
228
|
-
|
|
229
|
-
// src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
|
|
230
|
-
function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
231
|
-
return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
|
|
232
|
-
}
|
|
233
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
234
|
-
0 && (module.exports = {
|
|
235
|
-
onVisibilityChangedByTransparentServiceWeb
|
|
236
|
-
});
|
package/dist/private.d.cts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { EmitterSubscription } from 'react-native';
|
|
2
|
-
import { E as EventEmitterSchema, a as VisibilityChangedByTransparentServiceWebOptions } from './VisibilityChangedByTransparentServiceWebEvent-D6XJvPVh.cjs';
|
|
3
|
-
import '@granite-js/react-native';
|
|
4
|
-
|
|
5
|
-
interface OnVisibilityChangedByTransparentServiceWebSubscription extends EmitterSubscription {
|
|
6
|
-
remove: () => void;
|
|
7
|
-
}
|
|
8
|
-
type OnVisibilityChangedByTransparentServiceWebEventEmitter = EventEmitterSchema<'visibilityChangedByTransparentServiceWeb', [
|
|
9
|
-
boolean
|
|
10
|
-
]>;
|
|
11
|
-
declare function onVisibilityChangedByTransparentServiceWeb(eventParams: {
|
|
12
|
-
options: VisibilityChangedByTransparentServiceWebOptions;
|
|
13
|
-
onEvent: (isVisible: boolean) => void;
|
|
14
|
-
onError: (error: unknown) => void;
|
|
15
|
-
}): () => void;
|
|
16
|
-
|
|
17
|
-
export { type OnVisibilityChangedByTransparentServiceWebEventEmitter, type OnVisibilityChangedByTransparentServiceWebSubscription, onVisibilityChangedByTransparentServiceWeb };
|
package/dist/private.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { EmitterSubscription } from 'react-native';
|
|
2
|
-
import { E as EventEmitterSchema, a as VisibilityChangedByTransparentServiceWebOptions } from './VisibilityChangedByTransparentServiceWebEvent-D6XJvPVh.js';
|
|
3
|
-
import '@granite-js/react-native';
|
|
4
|
-
|
|
5
|
-
interface OnVisibilityChangedByTransparentServiceWebSubscription extends EmitterSubscription {
|
|
6
|
-
remove: () => void;
|
|
7
|
-
}
|
|
8
|
-
type OnVisibilityChangedByTransparentServiceWebEventEmitter = EventEmitterSchema<'visibilityChangedByTransparentServiceWeb', [
|
|
9
|
-
boolean
|
|
10
|
-
]>;
|
|
11
|
-
declare function onVisibilityChangedByTransparentServiceWeb(eventParams: {
|
|
12
|
-
options: VisibilityChangedByTransparentServiceWebOptions;
|
|
13
|
-
onEvent: (isVisible: boolean) => void;
|
|
14
|
-
onError: (error: unknown) => void;
|
|
15
|
-
}): () => void;
|
|
16
|
-
|
|
17
|
-
export { type OnVisibilityChangedByTransparentServiceWebEventEmitter, type OnVisibilityChangedByTransparentServiceWebSubscription, onVisibilityChangedByTransparentServiceWeb };
|
package/dist/private.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
appsInTossEvent
|
|
3
|
-
} from "./chunk-YS54L7RG.js";
|
|
4
|
-
|
|
5
|
-
// src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
|
|
6
|
-
function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
7
|
-
return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
onVisibilityChangedByTransparentServiceWeb
|
|
11
|
-
};
|
package/src/AppsInTossModule/native-event-emitter/event-plugins/HomeIconButtonClickHandleEvent.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { GraniteEventDefinition } from '@granite-js/react-native';
|
|
2
|
-
|
|
3
|
-
export class HomeIconButtonClickHandleEvent extends GraniteEventDefinition<undefined, undefined> {
|
|
4
|
-
name = 'homeIconButtonClickEvent' as const;
|
|
5
|
-
|
|
6
|
-
remove() {}
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
|
-
listener(_: undefined) {}
|
|
10
|
-
}
|