@apps-in-toss/web-framework 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
1
  [
2
2
  {
3
3
  "platform": "ios",
4
- "totalModuleCount": 359,
5
- "duration": 387.9813330000002,
6
- "size": 130265
4
+ "totalModuleCount": 360,
5
+ "duration": 406.73562500000025,
6
+ "size": 130489
7
7
  },
8
8
  {
9
9
  "platform": "android",
10
- "totalModuleCount": 359,
11
- "duration": 388.65312500000005,
12
- "size": 130011
10
+ "totalModuleCount": 360,
11
+ "duration": 407.8052090000001,
12
+ "size": 130235
13
13
  }
14
14
  ]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apps-in-toss/web-framework",
3
3
  "type": "module",
4
- "version": "0.0.9",
4
+ "version": "0.0.11",
5
5
  "description": "Web Framework for Apps In Toss",
6
6
  "scripts": {
7
7
  "prepack": "yarn build",
@@ -50,7 +50,7 @@
50
50
  "config.d.ts"
51
51
  ],
52
52
  "devDependencies": {
53
- "@apps-in-toss/framework": "0.0.9",
53
+ "@apps-in-toss/framework": "0.0.11",
54
54
  "@babel/plugin-proposal-class-properties": "^7.16.7",
55
55
  "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
56
56
  "@babel/plugin-proposal-numeric-separator": "^7.16.7",
@@ -66,10 +66,10 @@
66
66
  "@babel/types": "^7.26.9",
67
67
  "@clack/prompts": "^0.10.0",
68
68
  "@hono/node-server": "^1.13.8",
69
- "@react-native-bedrock/bridgepack": "0.0.12",
70
- "@react-native-bedrock/cli": "0.0.12",
71
- "@react-native-bedrock/mpack-next": "0.0.12",
72
- "@react-native-bedrock/native": "0.0.12",
69
+ "@react-native-bedrock/bridgepack": "0.0.13",
70
+ "@react-native-bedrock/cli": "0.0.13",
71
+ "@react-native-bedrock/mpack-next": "0.0.13",
72
+ "@react-native-bedrock/native": "0.0.13",
73
73
  "@toss-design-system/react-native": "^0",
74
74
  "@types/babel__core": "^7.20.5",
75
75
  "@types/babel__traverse": "^7",
@@ -87,7 +87,7 @@
87
87
  "picocolors": "^1.1.1",
88
88
  "react": "18.2.0",
89
89
  "react-native": "0.72.6",
90
- "react-native-bedrock": "0.0.12",
90
+ "react-native-bedrock": "0.0.13",
91
91
  "tsup": "^8.3.5",
92
92
  "typescript": "4.9.5",
93
93
  "uuidv7": "^1.0.2",
@@ -95,11 +95,11 @@
95
95
  "zod": "^3.24.1"
96
96
  },
97
97
  "dependencies": {
98
- "@apps-in-toss/cli": "0.0.9",
98
+ "@apps-in-toss/cli": "0.0.11",
99
99
  "@babel/core": "7.23.9"
100
100
  },
101
101
  "publishConfig": {
102
102
  "access": "public"
103
103
  },
104
- "gitHead": "98757e13199b7802d8d2a31ce2249d6727c12dcd"
104
+ "gitHead": "d0dfa84af3118a71ea3705c440e639fb5b1a010b"
105
105
  }
@@ -1,8 +1,6 @@
1
1
  /**
2
2
  * @public
3
- * @tag AppsInTossModule
4
- * @category AppsInTossModules
5
- * @kind function
3
+ * @category 로그인
6
4
  * @name appLogin
7
5
  * @description 토스 인증으로 로그인해요. 로그인이 완료되면 다시 토스 앱으로 이동해요.
8
6
  * @example
@@ -15,9 +13,9 @@
15
13
  *
16
14
  * function Page() {
17
15
  * const handleLogin = async () => {
18
- * const { authorizationCode } = await appLogin();
16
+ * const { authorizationCode, referrer } = await appLogin();
19
17
  *
20
- * // 획득한 인가 코드(`authorizationCode`) 서버로 전달해요.
18
+ * // 획득한 인가 코드(`authorizationCode`) `referrer`를 서버로 전달해요.
21
19
  * }
22
20
  *
23
21
  * return <input type="button" value="로그인" onClick={handleLogin} />;
@@ -26,6 +24,7 @@
26
24
  */
27
25
  export declare function appLogin(): Promise<{
28
26
  authorizationCode: string;
27
+ referrer: "DEFAULT" | "SANDBOX";
29
28
  }>;
30
29
 
31
30
  export {};
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * @public
3
- * @tag BedrockModule
4
- * @category BedrockModules
3
+ * @category 화면 제어
5
4
  * @kind function
6
5
  * @name closeView
7
6
  * @description 현재 화면을 닫는 함수에요. 예를 들어, "닫기" 버튼을 눌러서 서비스를 종료할 때 사용할 수 있어요.
@@ -20,9 +20,7 @@ export interface FetchAlbumPhotosOptions {
20
20
  }
21
21
  /**
22
22
  * @public
23
- * @tag AppsInTossModule
24
- * @category AppsInTossModules
25
- * @kind function
23
+ * @category 사진
26
24
  * @name fetchAlbumPhotos
27
25
  * @description
28
26
  * 사용자의 앨범에서 사진 목록을 불러오는 함수예요.
@@ -9,9 +9,7 @@ export interface ContactEntity {
9
9
  }
10
10
  /**
11
11
  * @public
12
- * @tag AppsInTossModule
13
- * @category AppsInTossModules
14
- * @kind function
12
+ * @category 연락처
15
13
  * @name fetchContacts
16
14
  * @description 사용자의 연락처 목록을 페이지 단위로 가져오는 함수예요.
17
15
  * @param size - 한 번에 가져올 연락처 개수예요. 예를 들어, 10을 전달하면 최대 10개의 연락처를 가져와요.
@@ -1,38 +1,35 @@
1
1
  export type HapticFeedbackType = "tickWeak" | "tap" | "tickMedium" | "softMedium" | "basicWeak" | "basicMedium" | "success" | "error" | "wiggle" | "confetti";
2
2
  /**
3
- * @public
4
- * @tag HapticFeedbackType
5
- * @category Types
6
- * @name HapticFeedbackOptions
7
- * @description
8
- * generateHapticFeedback 함수에 전달할 햅틱진동의 타입을 나타내요. 진동타입의 종류는 다음과 같아요.
9
- * ```typescript
10
- * type HapticFeedbackType =
11
- * | "tickWeak"
12
- * | "tap"
13
- * | "tickMedium"
14
- * | "softMedium"
15
- * | "basicWeak"
16
- * | "basicMedium"
17
- * | "success"
18
- * | "error"
19
- * | "wiggle"
20
- * | "confetti";
21
- * ```
22
- * @typedef { type: HapticFeedbackType } HapticFeedbackOptions
23
- * @typedef { "tickWeak" | "tap" | "tickMedium" | "softMedium" | "basicWeak" | "basicMedium" | "success" | "error" | "wiggle" | "confetti" } HapticFeedbackType
24
- *
25
- */
3
+ * @public
4
+ * @category 인터렉션
5
+ * @name HapticFeedbackOptions
6
+ * @description
7
+ * generateHapticFeedback 함수에 전달할 햅틱진동의 타입을 나타내요. 진동타입의 종류는 다음과 같아요.
8
+ * ```typescript
9
+ * type HapticFeedbackType =
10
+ * | "tickWeak"
11
+ * | "tap"
12
+ * | "tickMedium"
13
+ * | "softMedium"
14
+ * | "basicWeak"
15
+ * | "basicMedium"
16
+ * | "success"
17
+ * | "error"
18
+ * | "wiggle"
19
+ * | "confetti";
20
+ * ```
21
+ * @typedef { type: HapticFeedbackType } HapticFeedbackOptions
22
+ * @typedef { "tickWeak" | "tap" | "tickMedium" | "softMedium" | "basicWeak" | "basicMedium" | "success" | "error" | "wiggle" | "confetti" } HapticFeedbackType
23
+ *
24
+ */
26
25
  export interface HapticFeedbackOptions {
27
26
  type: HapticFeedbackType;
28
27
  }
29
28
  /**
30
29
  * @public
31
- * @tag BedrockModule
32
- * @category BedrockModules
33
- * @kind function
30
+ * @category 인터렉션
34
31
  * @name generateHapticFeedback
35
- * @description 디바이스에 햅틱 진동을 일으키는 함수예요. 예를 들어, 버튼 터치나 화면전환에 드라마틱한 효과를 주고 싶을 때 사용할 수 있어요. [HapticFeedbackOptions](../Types/HapticFeedbackOptions.html)에서 진동타입을 확인해 보세요.
32
+ * @description 디바이스에 햅틱 진동을 일으키는 함수예요. 예를 들어, 버튼 터치나 화면전환에 드라마틱한 효과를 주고 싶을 때 사용할 수 있어요. [HapticFeedbackOptions](/reference/@apps-in-toss/web-framework/인터렉션/HapticFeedbackOptions.html)에서 진동타입을 확인해 보세요.
36
33
  * @returns {void}
37
34
  *
38
35
  * @example
@@ -1,8 +1,6 @@
1
1
  /**
2
2
  * @public
3
- * @tag AppsInTossModule
4
- * @category AppsInTossModules
5
- * @kind function
3
+ * @category 클립보드
6
4
  * @name getClipboardText
7
5
  * @description 클립보드에 저장된 텍스트를 가져오는 함수예요. 복사된 텍스트를 읽어서 다른 작업에 활용할 수 있어요.
8
6
  * @returns {Promise<string>} - 클립보드에 저장된 텍스트를 반환해요. 클립보드에 텍스트가 없으면 빈 문자열을 반환해요.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @public
3
- * @category Types
3
+ * @category 위치 정보
4
4
  * @name Accuracy
5
5
  * @description 위치 정확도 옵션이에요.
6
6
  */
@@ -32,7 +32,7 @@ export enum Accuracy {
32
32
  }
33
33
  /**
34
34
  * @public
35
- * @category Types
35
+ * @category 위치 정보
36
36
  * @name Location
37
37
  * @description 위치 정보를 나타내는 객체예요.
38
38
  */
@@ -57,7 +57,7 @@ export interface Location {
57
57
  }
58
58
  /**
59
59
  * @public
60
- * @category Types
60
+ * @category 위치 정보
61
61
  * @name LocationCoords
62
62
  * @description 세부 위치 정보를 나타내는 객체예요.
63
63
  */
@@ -95,9 +95,7 @@ export interface GetCurrentLocationOptions {
95
95
  }
96
96
  /**
97
97
  * @public
98
- * @tag AppsInTossModule
99
- * @category AppsInTossModules
100
- * @kind function
98
+ * @category 위치 정보
101
99
  * @name getCurrentLocation
102
100
  * @description 디바이스의 현재 위치 정보를 가져오는 함수예요.
103
101
  * 위치 기반 서비스를 구현할 때 사용되고, 한 번만 호출되어 현재 위치를 즉시 반환해요.
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * @public
3
- * @tag BedrockModule
4
- * @category BedrockModules
3
+ * @category 환경 확인
5
4
  * @kind function
6
5
  * @name getDeviceId
7
6
  * @description
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * @public
3
- * @tag BedrockModule
4
- * @category BedrockModules
3
+ * @category 언어
5
4
  * @kind function
6
5
  * @name getLocale
7
6
  * @description
@@ -1,8 +1,7 @@
1
1
  export type NetworkStatus = "OFFLINE" | "WIFI" | "2G" | "3G" | "4G" | "5G" | "WWAN" | "UNKNOWN";
2
2
  /**
3
3
  * @public
4
- * @tag BedrockModule
5
- * @category BedrockModules
4
+ * @category 네트워크
6
5
  * @kind function
7
6
  * @name getNetworkStatus
8
7
  * @description
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @public
3
+ * @category 환경 확인
4
+ * @kind function
5
+ * @name getOperationalEnvironment
6
+ * @description
7
+ * 현재 실행 중인 앱의 운영 환경을 확인해요.
8
+ * 토스 앱에서 실행 중이라면 `'toss'`, 샌드박스 환경에서 실행 중이라면 `'sandbox'`를 반환해요.
9
+ *
10
+ * 운영 환경은 앱이 실행되는 컨텍스트를 의미하며, 특정 기능의 사용 가능 여부를 판단하는 데 활용할 수 있어요.
11
+ *
12
+ * @returns {'toss' | 'sandbox'}
13
+ * 현재 운영 환경을 나타내는 문자열이에요.
14
+ * - `'toss'`: 토스 앱에서 실행 중이에요.
15
+ * - `'sandbox'`: 샌드박스 환경에서 실행 중이에요.
16
+ *
17
+ * @example
18
+ * ### 현재 운영 환경 확인하기
19
+ *
20
+ * ```tsx
21
+ * import { getOperationalEnvironment } from '@apps-in-toss/web-framework';
22
+ *
23
+ *
24
+ * function EnvironmentInfo() {
25
+ * const environment = getOperationalEnvironment();
26
+ *
27
+ * return (
28
+ * <span>현재 운영 환경: {environment}</span>
29
+ * );
30
+ * }
31
+ * ```
32
+ */
33
+ export declare function getOperationalEnvironment(): "toss" | "sandbox";
34
+
35
+ export {};
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @public
3
+ * @kind function
4
+ * @category 환경 확인
5
+ *
6
+ * @name getPlatformOS
7
+ * @signature
8
+ * ```typescript
9
+ * function getPlatformOS(): 'ios' | 'android';
10
+ * ```
11
+ *
12
+ * @description
13
+ * 현재 실행 중인 플랫폼을 확인하는 함수예요.
14
+ * 이 함수는 `react-native`의 [`Platform.OS`](https://reactnative.dev/docs/0.72/platform#os) 값을 기반으로 동작하며, `ios` 또는 `android` 중 하나의 문자열을 반환해요.
15
+ *
16
+ * @returns {'ios' | 'android'} 현재 실행 중인 플랫폼
17
+ *
18
+ * @example
19
+ *
20
+ * ### 현재 실행중인 OS 플랫폼 확인하기
21
+ *
22
+ * ```tsx
23
+ * import { getPlatformOS } from '@apps-in-toss/web-framework';
24
+ * import { Text } 'react-native';
25
+ *
26
+ * function Page() {
27
+ * const platform = getPlatformOS();
28
+ *
29
+ * return <span>현재 플랫폼: {platform}</span>;
30
+ * }
31
+ * ```
32
+ */
33
+ export declare function getPlatformOS(): "ios" | "android";
34
+
35
+ export {};
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * @public
3
3
  * @name getSchemeUri
4
- * @tag BedrockModule
5
- * @category BedrockModules
4
+ * @category 환경 확인
6
5
  * @kind function
7
6
  * @description 처음에 화면에 진입한 스킴 값이에요. 페이지 이동으로 인한 URI 변경은 반영되지 않아요.
8
7
  * @returns {string} 처음에 화면에 진입한 스킴 값을 반환해요.
@@ -7,6 +7,7 @@ export * from './getNetworkStatus';
7
7
  export * from './getLocale';
8
8
  export * from './getSchemeUri';
9
9
  export * from './getDeviceId';
10
+ export * from './getPlatformOS';
10
11
  export * from './setClipboardText';
11
12
  export * from './getClipboardText';
12
13
  export * from './fetchContacts';
@@ -14,4 +15,5 @@ export * from './fetchAlbumPhotos';
14
15
  export * from './getCurrentLocation';
15
16
  export * from './openCamera';
16
17
  export * from './appLogin';
18
+ export * from './getOperationalEnvironment';
17
19
  export * from './startUpdateLocation';
package/src-web/index.js CHANGED
@@ -1 +1 @@
1
- export const createEvents=()=>({emit(event,args){for(let callbacks=this.events[event]||[],i=0,length=callbacks.length;i<length;i++){callbacks[i](args)}},events:{},on(event,cb){var _this_events,_event;((_this_events=this.events)[_event=event]||(_this_events[_event]=[])).push(cb);return()=>{var _this_events_event;this.events[event]=(_this_events_event=this.events[event])===null||_this_events_event===void 0?void 0:_this_events_event.filter(i=>cb!==i)}}});const createEventId=()=>Math.random().toString(36).substring(2,15);const deserializeError=value=>{if(value&&value.__isError){const err=new Error(value.message);err.name=value.name;err.stack=value.stack;return err}return value};window.__BEDROCK_NATIVE_EMITTER=createEvents();export function closeView(...args){if(!window.ReactNativeWebView){throw new Error("This closeView is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`closeView/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`closeView/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"closeView",eventId,args}))})}export function generateHapticFeedback(...args){if(!window.ReactNativeWebView){throw new Error("This generateHapticFeedback is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`generateHapticFeedback/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`generateHapticFeedback/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"generateHapticFeedback",eventId,args}))})}export function share(...args){if(!window.ReactNativeWebView){throw new Error("This share is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`share/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`share/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"share",eventId,args}))})}export function setSecureScreen(...args){if(!window.ReactNativeWebView){throw new Error("This setSecureScreen is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setSecureScreen/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setSecureScreen/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"setSecureScreen",eventId,args}))})}export function setScreenAwakeMode(...args){if(!window.ReactNativeWebView){throw new Error("This setScreenAwakeMode is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setScreenAwakeMode/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setScreenAwakeMode/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"setScreenAwakeMode",eventId,args}))})}export function getNetworkStatus(...args){if(!window.ReactNativeWebView){throw new Error("This getNetworkStatus is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getNetworkStatus/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getNetworkStatus/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"getNetworkStatus",eventId,args}))})}export function getLocale(){if(!window.ReactNativeWebView){throw new Error("This getLocale is not available in browser environment")}if("getLocale"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getLocale"]}throw new Error("getLocale is not a constant handler")}export function getSchemeUri(){if(!window.ReactNativeWebView){throw new Error("This getSchemeUri is not available in browser environment")}if("getSchemeUri"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getSchemeUri"]}throw new Error("getSchemeUri is not a constant handler")}export function getDeviceId(){if(!window.ReactNativeWebView){throw new Error("This getDeviceId is not available in browser environment")}if("getDeviceId"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getDeviceId"]}throw new Error("getDeviceId is not a constant handler")}export function setClipboardText(...args){if(!window.ReactNativeWebView){throw new Error("This setClipboardText is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setClipboardText/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setClipboardText/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"setClipboardText",eventId,args}))})}export function getClipboardText(...args){if(!window.ReactNativeWebView){throw new Error("This getClipboardText is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getClipboardText/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getClipboardText/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"getClipboardText",eventId,args}))})}export function fetchContacts(...args){if(!window.ReactNativeWebView){throw new Error("This fetchContacts is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchContacts/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchContacts/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"fetchContacts",eventId,args}))})}export function fetchAlbumPhotos(...args){if(!window.ReactNativeWebView){throw new Error("This fetchAlbumPhotos is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchAlbumPhotos/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchAlbumPhotos/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"fetchAlbumPhotos",eventId,args}))})}export var Accuracy=function(Accuracy){Accuracy[Accuracy["Lowest"]=1]="Lowest";Accuracy[Accuracy["Low"]=2]="Low";Accuracy[Accuracy["Balanced"]=3]="Balanced";Accuracy[Accuracy["High"]=4]="High";Accuracy[Accuracy["Highest"]=5]="Highest";Accuracy[Accuracy["BestForNavigation"]=6]="BestForNavigation";return Accuracy}({});export function getCurrentLocation(...args){if(!window.ReactNativeWebView){throw new Error("This getCurrentLocation is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getCurrentLocation/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getCurrentLocation/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"getCurrentLocation",eventId,args}))})}export function openCamera(...args){if(!window.ReactNativeWebView){throw new Error("This openCamera is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`openCamera/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`openCamera/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"openCamera",eventId,args}))})}export function appLogin(...args){if(!window.ReactNativeWebView){throw new Error("This appLogin is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`appLogin/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`appLogin/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"appLogin",eventId,args}))})}export function startUpdateLocation({onEvent,onError,options}){if(!window.ReactNativeWebView){onError(new Error("This startUpdateLocation is not available in browser environment"));return()=>{}}const eventId=createEventId();const removes=[window.__BEDROCK_NATIVE_EMITTER.on(`startUpdateLocation/onEvent/${eventId}`,response=>{onEvent(response)}),window.__BEDROCK_NATIVE_EMITTER.on(`startUpdateLocation/onError/${eventId}`,error=>{onError(deserializeError(error))})];window.ReactNativeWebView.postMessage(JSON.stringify({type:"addEventListener",functionName:"startUpdateLocation",eventId,args:options}));return()=>{window.ReactNativeWebView.postMessage(JSON.stringify({type:"removeEventListener",functionName:"startUpdateLocation",eventId}));for(const remove of removes){remove()}}}
1
+ export const createEvents=()=>({emit(event,args){for(let callbacks=this.events[event]||[],i=0,length=callbacks.length;i<length;i++){callbacks[i](args)}},events:{},on(event,cb){var _this_events,_event;((_this_events=this.events)[_event=event]||(_this_events[_event]=[])).push(cb);return()=>{var _this_events_event;this.events[event]=(_this_events_event=this.events[event])===null||_this_events_event===void 0?void 0:_this_events_event.filter(i=>cb!==i)}}});const createEventId=()=>Math.random().toString(36).substring(2,15);const deserializeError=value=>{if(value&&value.__isError){const err=new Error(value.message);err.name=value.name;err.stack=value.stack;return err}return value};window.__BEDROCK_NATIVE_EMITTER=createEvents();export function closeView(...args){if(!window.ReactNativeWebView){throw new Error("This closeView is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`closeView/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`closeView/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"closeView",eventId,args}))})}export function generateHapticFeedback(...args){if(!window.ReactNativeWebView){throw new Error("This generateHapticFeedback is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`generateHapticFeedback/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`generateHapticFeedback/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"generateHapticFeedback",eventId,args}))})}export function share(...args){if(!window.ReactNativeWebView){throw new Error("This share is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`share/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`share/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"share",eventId,args}))})}export function setSecureScreen(...args){if(!window.ReactNativeWebView){throw new Error("This setSecureScreen is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setSecureScreen/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setSecureScreen/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"setSecureScreen",eventId,args}))})}export function setScreenAwakeMode(...args){if(!window.ReactNativeWebView){throw new Error("This setScreenAwakeMode is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setScreenAwakeMode/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setScreenAwakeMode/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"setScreenAwakeMode",eventId,args}))})}export function getNetworkStatus(...args){if(!window.ReactNativeWebView){throw new Error("This getNetworkStatus is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getNetworkStatus/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getNetworkStatus/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"getNetworkStatus",eventId,args}))})}export function getLocale(){if(!window.ReactNativeWebView){throw new Error("This getLocale is not available in browser environment")}if("getLocale"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getLocale"]}throw new Error("getLocale is not a constant handler")}export function getSchemeUri(){if(!window.ReactNativeWebView){throw new Error("This getSchemeUri is not available in browser environment")}if("getSchemeUri"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getSchemeUri"]}throw new Error("getSchemeUri is not a constant handler")}export function getDeviceId(){if(!window.ReactNativeWebView){throw new Error("This getDeviceId is not available in browser environment")}if("getDeviceId"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getDeviceId"]}throw new Error("getDeviceId is not a constant handler")}export function getPlatformOS(){if(!window.ReactNativeWebView){throw new Error("This getPlatformOS is not available in browser environment")}if("getPlatformOS"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getPlatformOS"]}throw new Error("getPlatformOS is not a constant handler")}export function setClipboardText(...args){if(!window.ReactNativeWebView){throw new Error("This setClipboardText is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setClipboardText/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setClipboardText/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"setClipboardText",eventId,args}))})}export function getClipboardText(...args){if(!window.ReactNativeWebView){throw new Error("This getClipboardText is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getClipboardText/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getClipboardText/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"getClipboardText",eventId,args}))})}export function fetchContacts(...args){if(!window.ReactNativeWebView){throw new Error("This fetchContacts is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchContacts/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchContacts/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"fetchContacts",eventId,args}))})}export function fetchAlbumPhotos(...args){if(!window.ReactNativeWebView){throw new Error("This fetchAlbumPhotos is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchAlbumPhotos/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchAlbumPhotos/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"fetchAlbumPhotos",eventId,args}))})}export var Accuracy=function(Accuracy){Accuracy[Accuracy["Lowest"]=1]="Lowest";Accuracy[Accuracy["Low"]=2]="Low";Accuracy[Accuracy["Balanced"]=3]="Balanced";Accuracy[Accuracy["High"]=4]="High";Accuracy[Accuracy["Highest"]=5]="Highest";Accuracy[Accuracy["BestForNavigation"]=6]="BestForNavigation";return Accuracy}({});export function getCurrentLocation(...args){if(!window.ReactNativeWebView){throw new Error("This getCurrentLocation is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getCurrentLocation/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getCurrentLocation/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"getCurrentLocation",eventId,args}))})}export function openCamera(...args){if(!window.ReactNativeWebView){throw new Error("This openCamera is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`openCamera/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`openCamera/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"openCamera",eventId,args}))})}export function appLogin(...args){if(!window.ReactNativeWebView){throw new Error("This appLogin is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`appLogin/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`appLogin/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"appLogin",eventId,args}))})}export function getOperationalEnvironment(){if(!window.ReactNativeWebView){throw new Error("This getOperationalEnvironment is not available in browser environment")}if("getOperationalEnvironment"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getOperationalEnvironment"]}throw new Error("getOperationalEnvironment is not a constant handler")}export function startUpdateLocation({onEvent,onError,options}){if(!window.ReactNativeWebView){onError(new Error("This startUpdateLocation is not available in browser environment"));return()=>{}}const eventId=createEventId();const removes=[window.__BEDROCK_NATIVE_EMITTER.on(`startUpdateLocation/onEvent/${eventId}`,response=>{onEvent(response)}),window.__BEDROCK_NATIVE_EMITTER.on(`startUpdateLocation/onError/${eventId}`,error=>{onError(deserializeError(error))})];window.ReactNativeWebView.postMessage(JSON.stringify({type:"addEventListener",functionName:"startUpdateLocation",eventId,args:options}));return()=>{window.ReactNativeWebView.postMessage(JSON.stringify({type:"removeEventListener",functionName:"startUpdateLocation",eventId}));for(const remove of removes){remove()}}}
@@ -23,9 +23,7 @@ export interface OpenCameraOptions {
23
23
  }
24
24
  /**
25
25
  * @public
26
- * @tag AppsInTossModule
27
- * @category AppsInTossModules
28
- * @kind function
26
+ * @category 카메라
29
27
  * @name openCamera
30
28
  * @description 카메라를 실행해서 촬영된 이미지를 반환하는 함수예요.
31
29
  * @param {OpenCameraOptions} options - 카메라 실행 시 사용되는 옵션 객체예요.
@@ -1,8 +1,6 @@
1
1
  /**
2
2
  * @public
3
- * @tag AppsInTossModule
4
- * @category AppsInTossModules
5
- * @kind function
3
+ * @category 클립보드
6
4
  * @name setClipboardText
7
5
  * @description 텍스트를 클립보드에 복사해서 사용자가 다른 곳에 붙여 넣기 할 수 있어요.
8
6
  * @param {Promise<void>} text - 클립보드에 복사할 텍스트예요. 문자열 형식으로 입력해요.
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * @public
3
- * @tag BedrockModule
4
- * @category BedrockModules
3
+ * @category 화면 제어
5
4
  * @kind function
6
5
  * @name setScreenAwakeMode
7
6
  * @description
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * @public
3
3
  * @name setSecureScreen
4
- * @tag BedrockModule
5
- * @category BedrockModules
4
+ * @category 화면 제어
6
5
  * @kind function
7
6
  * @description
8
7
  * 화면 캡쳐를 차단해서 민감한 정보가 유출되지 않도록 보호하거나, 필요할 경우 캡쳐를 허용하도록 설정해요. 예를 들어 보안이 중요한 화면에서 사용할 수 있어요.
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * @public
3
- * @tag BedrockModule
4
- * @category BedrockModules
3
+ * @category 공유
5
4
  * @kind function
6
5
  * @name share
7
6
  * @description
@@ -32,7 +32,7 @@ declare enum Accuracy {
32
32
  }
33
33
  /**
34
34
  * @public
35
- * @category Types
35
+ * @category 위치 정보
36
36
  * @name Location
37
37
  * @description 위치 정보를 나타내는 객체예요.
38
38
  */
@@ -57,7 +57,7 @@ export interface Location {
57
57
  }
58
58
  /**
59
59
  * @public
60
- * @category Types
60
+ * @category 위치 정보
61
61
  * @name LocationCoords
62
62
  * @description 세부 위치 정보를 나타내는 객체예요.
63
63
  */
@@ -117,9 +117,7 @@ export interface UpdateLocationEventEmitter extends EventEmitterSchema<"updateLo
117
117
  }
118
118
  /**
119
119
  * @public
120
- * @tag AppsInTossModule
121
- * @category AppsInTossModules
122
- * @kind function
120
+ * @category 위치 정보
123
121
  * @name startUpdateLocation
124
122
  * @description 디바이스의 위치 정보를 지속적으로 감지하고, 위치가 변경되면 콜백을 실행하는 함수예요. 콜백 함수를 등록하면 위치가 변경될 때마다 자동으로 호출돼요.
125
123
  * 실시간 위치 추적이 필요한 기능을 구현할 때 사용할 수 있어요. 예를 들어 지도 앱에서 사용자의 현재 위치를 실시간으로 업데이트할 때, 운동 앱에서 사용자의 이동 거리를 기록할 때 등이에요.