@apps-in-toss/native-modules 0.0.0-dev.1752115036458 → 1.0.0
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/bridges-meta.json +36 -13
- package/dist/index.cjs +256 -120
- package/dist/index.d.cts +697 -229
- package/dist/index.d.ts +697 -229
- package/dist/index.js +233 -103
- package/package.json +7 -8
- package/src/AppsInTossModule/constants.ts +6 -0
- package/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts +13 -0
- package/src/AppsInTossModule/native-event-emitter/contactsViral.ts +140 -0
- package/src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts +10 -0
- package/src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts +60 -0
- package/src/AppsInTossModule/native-event-emitter/index.ts +5 -0
- package/src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts +45 -0
- package/src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts +50 -0
- package/src/AppsInTossModule/native-event-emitter/internal/appBridge.spec.ts +135 -0
- package/src/AppsInTossModule/native-event-emitter/internal/appBridge.ts +79 -0
- package/src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts +20 -0
- package/src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts +35 -0
- package/src/AppsInTossModule/native-event-emitter/startUpdateLocation.ts +98 -0
- package/src/AppsInTossModule/native-event-emitter/types.ts +4 -0
- package/src/AppsInTossModule/native-modules/AppsInTossModule.ts +89 -0
- package/src/AppsInTossModule/native-modules/ads/googleAdMob.ts +690 -0
- package/src/AppsInTossModule/native-modules/ads/types.ts +106 -0
- package/src/AppsInTossModule/native-modules/appLogin.ts +29 -0
- package/src/AppsInTossModule/native-modules/checkoutPayment.ts +80 -0
- package/src/AppsInTossModule/native-modules/eventLog.spec.ts +300 -0
- package/src/AppsInTossModule/native-modules/eventLog.ts +77 -0
- package/src/AppsInTossModule/native-modules/fetchAlbumPhotos.ts +88 -0
- package/src/AppsInTossModule/native-modules/fetchContacts.ts +121 -0
- package/src/AppsInTossModule/native-modules/getClipboardText.ts +47 -0
- package/src/AppsInTossModule/native-modules/getCurrentLocation.ts +65 -0
- package/src/AppsInTossModule/native-modules/getDeviceId.ts +33 -0
- package/src/AppsInTossModule/native-modules/getGameCenterGameProfile.ts +68 -0
- package/src/AppsInTossModule/native-modules/getOperationalEnvironment.ts +37 -0
- package/src/AppsInTossModule/native-modules/getPermission.ts +58 -0
- package/src/AppsInTossModule/native-modules/getTossAppVersion.ts +33 -0
- package/src/AppsInTossModule/native-modules/getTossShareLink.ts +39 -0
- package/src/AppsInTossModule/native-modules/iap.ts +213 -0
- package/src/AppsInTossModule/native-modules/index.ts +86 -0
- package/src/AppsInTossModule/native-modules/isMinVersionSupported.spec.ts +190 -0
- package/src/AppsInTossModule/native-modules/isMinVersionSupported.ts +68 -0
- package/src/AppsInTossModule/native-modules/openCamera.ts +81 -0
- package/src/AppsInTossModule/native-modules/openGameCenterLeaderboard.ts +44 -0
- package/src/AppsInTossModule/native-modules/openPermissionDialog.ts +54 -0
- package/src/AppsInTossModule/native-modules/requestPermission.ts +63 -0
- package/src/AppsInTossModule/native-modules/saveBase64Data.ts +57 -0
- package/src/AppsInTossModule/native-modules/setClipboardText.ts +39 -0
- package/src/AppsInTossModule/native-modules/setDeviceOrientation.ts +74 -0
- package/src/AppsInTossModule/native-modules/storage.ts +100 -0
- package/src/AppsInTossModule/native-modules/submitGameCenterLeaderBoardScore.ts +74 -0
- package/src/AppsInTossModule/native-modules/tossCore.ts +29 -0
- package/src/BedrockModule/native-modules/core/BedrockCoreModule.ts +8 -0
- package/src/BedrockModule/native-modules/index.ts +4 -0
- package/src/BedrockModule/native-modules/natives/BedrockModule.ts +20 -0
- package/src/BedrockModule/native-modules/natives/closeView.ts +25 -0
- package/src/BedrockModule/native-modules/natives/generateHapticFeedback/index.ts +27 -0
- package/src/BedrockModule/native-modules/natives/generateHapticFeedback/types.ts +38 -0
- package/src/BedrockModule/native-modules/natives/getLocale.ts +46 -0
- package/src/BedrockModule/native-modules/natives/getNetworkStatus/index.ts +59 -0
- package/src/BedrockModule/native-modules/natives/getNetworkStatus/types.ts +1 -0
- package/src/BedrockModule/native-modules/natives/getPlatformOS.ts +37 -0
- package/src/BedrockModule/native-modules/natives/getSchemeUri.ts +27 -0
- package/src/BedrockModule/native-modules/natives/index.ts +11 -0
- package/src/BedrockModule/native-modules/natives/openURL.ts +40 -0
- package/src/BedrockModule/native-modules/natives/setIosSwipeGestureEnabled.ts +43 -0
- package/src/BedrockModule/native-modules/natives/setScreenAwakeMode.ts +66 -0
- package/src/BedrockModule/native-modules/natives/setSecureScreen.ts +31 -0
- package/src/BedrockModule/native-modules/natives/share.ts +36 -0
- package/src/async-bridges.ts +3 -0
- package/src/event-bridges.ts +2 -0
- package/src/index.ts +16 -0
- package/src/types.ts +108 -0
- package/src/utils/compareVersion.spec.ts +176 -0
- package/src/utils/compareVersion.ts +104 -0
- package/src/utils/generateUUID.ts +5 -0
package/dist/bridges-meta.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"identifier": "closeView",
|
|
4
|
-
"dts": "/**\n * @public\n * @category 화면 제어\n * @kind function\n * @name closeView\n * @description 현재 화면을 닫는 함수에요. 예를 들어, \"닫기\" 버튼을 눌러서 서비스를 종료할 때 사용할 수 있어요.\n * @returns {Promise<void>}\n *\n * @example\n * ### 닫기 버튼을 눌러 화면 닫기\n *\n * ```tsx\n * import { Button } from 'react-native';\n * import { closeView } from '
|
|
4
|
+
"dts": "/**\n * @public\n * @category 화면 제어\n * @kind function\n * @name closeView\n * @description 현재 화면을 닫는 함수에요. 예를 들어, \"닫기\" 버튼을 눌러서 서비스를 종료할 때 사용할 수 있어요.\n * @returns {Promise<void>}\n *\n * @example\n * ### 닫기 버튼을 눌러 화면 닫기\n *\n * ```tsx\n * import { Button } from 'react-native';\n * import { closeView } from '@apps-in-toss/native-modules';\n *\n * function CloseButton() {\n * return <Button title=\"닫기\" onPress={closeView} />;\n * }\n * ```\n */\nexport declare function closeView(): Promise<void>;\n\nexport {};\n"
|
|
5
5
|
},
|
|
6
6
|
{
|
|
7
7
|
"identifier": "generateHapticFeedback",
|
|
8
|
-
"dts": "export type HapticFeedbackType = \"tickWeak\" | \"tap\" | \"tickMedium\" | \"softMedium\" | \"basicWeak\" | \"basicMedium\" | \"success\" | \"error\" | \"wiggle\" | \"confetti\";\n/**\n * @public\n * @category 인터렉션\n * @name HapticFeedbackOptions\n * @description\n * generateHapticFeedback 함수에 전달할 햅틱진동의 타입을 나타내요. 진동타입의 종류는 다음과 같아요.\n * ```typescript\n * type HapticFeedbackType =\n * | \"tickWeak\"\n * | \"tap\"\n * | \"tickMedium\"\n * | \"softMedium\"\n * | \"basicWeak\"\n * | \"basicMedium\"\n * | \"success\"\n * | \"error\"\n * | \"wiggle\"\n * | \"confetti\";\n * ```\n * @typedef { type: HapticFeedbackType } HapticFeedbackOptions\n * @typedef { \"tickWeak\" | \"tap\" | \"tickMedium\" | \"softMedium\" | \"basicWeak\" | \"basicMedium\" | \"success\" | \"error\" | \"wiggle\" | \"confetti\" } HapticFeedbackType\n *\n */\nexport interface HapticFeedbackOptions {\n\ttype: HapticFeedbackType;\n}\n/**\n * @public\n * @category 인터렉션\n * @name generateHapticFeedback\n * @description 디바이스에 햅틱 진동을 일으키는 함수예요. 예를 들어, 버튼 터치나 화면전환에 드라마틱한 효과를 주고 싶을 때 사용할 수 있어요. [HapticFeedbackOptions](/react-native/reference/native-modules/인터렉션/HapticFeedbackOptions.html)에서 진동타입을 확인해 보세요.\n * @returns {void}\n *\n * @example\n * ### 버튼을 눌러 햅틱 일으키기\n *\n * ```tsx\n * import { Button } from 'react-native';\n * import { generateHapticFeedback } from '
|
|
8
|
+
"dts": "export type HapticFeedbackType = \"tickWeak\" | \"tap\" | \"tickMedium\" | \"softMedium\" | \"basicWeak\" | \"basicMedium\" | \"success\" | \"error\" | \"wiggle\" | \"confetti\";\n/**\n * @public\n * @category 인터렉션\n * @name HapticFeedbackOptions\n * @description\n * generateHapticFeedback 함수에 전달할 햅틱진동의 타입을 나타내요. 진동타입의 종류는 다음과 같아요.\n * ```typescript\n * type HapticFeedbackType =\n * | \"tickWeak\"\n * | \"tap\"\n * | \"tickMedium\"\n * | \"softMedium\"\n * | \"basicWeak\"\n * | \"basicMedium\"\n * | \"success\"\n * | \"error\"\n * | \"wiggle\"\n * | \"confetti\";\n * ```\n * @typedef { type: HapticFeedbackType } HapticFeedbackOptions\n * @typedef { \"tickWeak\" | \"tap\" | \"tickMedium\" | \"softMedium\" | \"basicWeak\" | \"basicMedium\" | \"success\" | \"error\" | \"wiggle\" | \"confetti\" } HapticFeedbackType\n *\n */\nexport interface HapticFeedbackOptions {\n\ttype: HapticFeedbackType;\n}\n/**\n * @public\n * @category 인터렉션\n * @name generateHapticFeedback\n * @description 디바이스에 햅틱 진동을 일으키는 함수예요. 예를 들어, 버튼 터치나 화면전환에 드라마틱한 효과를 주고 싶을 때 사용할 수 있어요. [HapticFeedbackOptions](/react-native/reference/native-modules/인터렉션/HapticFeedbackOptions.html)에서 진동타입을 확인해 보세요.\n * @returns {void}\n *\n * @example\n * ### 버튼을 눌러 햅틱 일으키기\n *\n * ```tsx\n * import { Button } from 'react-native';\n * import { generateHapticFeedback } from '@apps-in-toss/native-modules';\n *\n * function GenerateHapticFeedback() {\n * return <Button title=\"햅틱\" onPress={() => { generateHapticFeedback( { type: \"tickWeak\"}) }} />;\n * }\n * ```\n */\nexport declare function generateHapticFeedback(options: HapticFeedbackOptions): Promise<void>;\n\nexport {};\n"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"identifier": "share",
|
|
12
|
-
"dts": "/**\n * @public\n * @category 공유\n * @kind function\n * @name share\n * @description\n * 사용자가 콘텐츠를 다른 사람과 공유할 수 있도록 네이티브 공유 시트를 표시해요.\n * `options.message` 속성에 공유할 메시지를 전달하면, 사용자가 선택할 수 있는 앱 목록이 표시돼요.\n * 예를 들어, 사용자가 텍스트 메시지를 공유하거나 메모 앱에 저장하려고 할 때 유용해요.\n * @param {object} options - 공유할 메시지를 담은 객체예요.\n * @param {string} options.message - 공유할 텍스트 문자열이에요. 예를 들어, \"안녕하세요! 이 내용을 공유합니다.\"\n *\n * @example\n * ### 공유하기 기능 구현하기\n *\n * 아래는 버튼을 클릭하면 메시지를 공유하는 간단한 예제예요.\n *\n * ```tsx\n * import { share } from '
|
|
12
|
+
"dts": "/**\n * @public\n * @category 공유\n * @kind function\n * @name share\n * @description\n * 사용자가 콘텐츠를 다른 사람과 공유할 수 있도록 네이티브 공유 시트를 표시해요.\n * `options.message` 속성에 공유할 메시지를 전달하면, 사용자가 선택할 수 있는 앱 목록이 표시돼요.\n * 예를 들어, 사용자가 텍스트 메시지를 공유하거나 메모 앱에 저장하려고 할 때 유용해요.\n * @param {object} options - 공유할 메시지를 담은 객체예요.\n * @param {string} options.message - 공유할 텍스트 문자열이에요. 예를 들어, \"안녕하세요! 이 내용을 공유합니다.\"\n *\n * @example\n * ### 공유하기 기능 구현하기\n *\n * 아래는 버튼을 클릭하면 메시지를 공유하는 간단한 예제예요.\n *\n * ```tsx\n * import { share } from '@apps-in-toss/native-modules';\n * import { Button } from 'react-native';\n *\n * function MyPage() {\n * return (\n * <Button\n * title=\"공유\"\n * onPress={() => share({ message: '공유할 메시지입니다.' })}\n * />\n * );\n * }\n * ```\n */\nexport declare function share(message: {\n\tmessage: string;\n}): Promise<void>;\n\nexport {};\n"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"identifier": "setSecureScreen",
|
|
16
|
-
"dts": "/**\n * @public\n * @name setSecureScreen\n * @category 화면 제어\n * @kind function\n * @description\n * 화면 캡쳐를 차단해서 민감한 정보가 유출되지 않도록 보호하거나, 필요할 경우 캡쳐를 허용하도록 설정해요. 예를 들어 보안이 중요한 화면에서 사용할 수 있어요.\n *\n * @param {object} options 화면 캡쳐 설정 옵션이에요.\n * @param {boolean} options.enabled 화면 캡쳐를 차단할지 여부를 설정해요. `true`면 캡쳐를 차단하고, `false`면 허용해요.\n * @returns {enabled: boolean} 현재 설정된 캡쳐 차단 상태를 반환해요.\n *\n * @example\n * ### 캡쳐 허용 상태 변경하기\n *\n * ```tsx\n * import { Button } from 'react-native';\n * import { setSecureScreen } from '
|
|
16
|
+
"dts": "/**\n * @public\n * @name setSecureScreen\n * @category 화면 제어\n * @kind function\n * @description\n * 화면 캡쳐를 차단해서 민감한 정보가 유출되지 않도록 보호하거나, 필요할 경우 캡쳐를 허용하도록 설정해요. 예를 들어 보안이 중요한 화면에서 사용할 수 있어요.\n *\n * @param {object} options 화면 캡쳐 설정 옵션이에요.\n * @param {boolean} options.enabled 화면 캡쳐를 차단할지 여부를 설정해요. `true`면 캡쳐를 차단하고, `false`면 허용해요.\n * @returns {enabled: boolean} 현재 설정된 캡쳐 차단 상태를 반환해요.\n *\n * @example\n * ### 캡쳐 허용 상태 변경하기\n *\n * ```tsx\n * import { Button } from 'react-native';\n * import { setSecureScreen } from '@apps-in-toss/native-modules';\n *\n * function SetSecureScreen() {\n * return <Button title=\"캡쳐 막기\" onPress={async () => {\n * await setSecureScreen({ enabled: true });\n * }} />;\n * }\n * ```\n */\nexport declare function setSecureScreen(options: {\n\tenabled: boolean;\n}): Promise<{\n\tenabled: boolean;\n}>;\n\nexport {};\n"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"identifier": "setScreenAwakeMode",
|
|
20
|
-
"dts": "/**\n * @public\n * @category 화면 제어\n * @kind function\n * @name setScreenAwakeMode\n * @description\n * `setScreenAwakeMode` 함수는 화면이 항상 켜져 있도록 설정하거나 해제하는 기능을 제공해요.\n * 이 기능은 웹툰, 동영상, 문서 읽기 등 화면을 지속해서 켜두어야 하는 상황에서 유용해요.\n *\n * `enabled` 옵션을 `true`로 설정하면 화면이 꺼지지 않게 유지하고, `false`로 설정하면 기본 화면 보호기 시간에 따라 화면이 꺼져요. 특히, 이 함수는 앱 전체에 영향을 미치므로 특정 화면에서만 사용하려면 화면을 벗어날 때 이전 상태로 복구하는 추가 작업이 필요해요.\n *\n * 예를 들어, 미디어 콘텐츠 감상 화면에서는 항상 켜짐 모드를 활성화하고, 화면을 떠날 때 설정을 복구해서 불필요한 배터리 소모를 방지할 수 있어요.\n *\n * 다만, 앱에서 벗어나는 상황에서는 항상 켜짐 모드가 비활성화될 수 있으니 주의해야 해요.\n *\n * @param {object} options 화면 항상 켜짐 모드의 설정 값이에요.\n * @param {boolean} options.enabled 화면 항상 켜짐 모드를 켜거나 끄는 옵션이에요.\n * `true`로 설정하면 화면이 항상 켜지고, `false`로 설정하면 화면 보호기 시간에 따라 꺼져요.\n *\n * @returns {object} 현재 화면 항상 켜짐 모드의 설정 상태를 반환해요.\n * @returns {boolean} enabled 화면 항상 켜짐 모드가 켜져 있는지 여부를 나타내는 값이에요.\n *\n * @example\n * ### 화면 항상 켜짐 모드 설정하기\n *\n * ```tsx\n * import { Button } from 'react-native';\n * import { setScreenAwakeMode } from '
|
|
20
|
+
"dts": "/**\n * @public\n * @category 화면 제어\n * @kind function\n * @name setScreenAwakeMode\n * @description\n * `setScreenAwakeMode` 함수는 화면이 항상 켜져 있도록 설정하거나 해제하는 기능을 제공해요.\n * 이 기능은 웹툰, 동영상, 문서 읽기 등 화면을 지속해서 켜두어야 하는 상황에서 유용해요.\n *\n * `enabled` 옵션을 `true`로 설정하면 화면이 꺼지지 않게 유지하고, `false`로 설정하면 기본 화면 보호기 시간에 따라 화면이 꺼져요. 특히, 이 함수는 앱 전체에 영향을 미치므로 특정 화면에서만 사용하려면 화면을 벗어날 때 이전 상태로 복구하는 추가 작업이 필요해요.\n *\n * 예를 들어, 미디어 콘텐츠 감상 화면에서는 항상 켜짐 모드를 활성화하고, 화면을 떠날 때 설정을 복구해서 불필요한 배터리 소모를 방지할 수 있어요.\n *\n * 다만, 앱에서 벗어나는 상황에서는 항상 켜짐 모드가 비활성화될 수 있으니 주의해야 해요.\n *\n * @param {object} options 화면 항상 켜짐 모드의 설정 값이에요.\n * @param {boolean} options.enabled 화면 항상 켜짐 모드를 켜거나 끄는 옵션이에요.\n * `true`로 설정하면 화면이 항상 켜지고, `false`로 설정하면 화면 보호기 시간에 따라 꺼져요.\n *\n * @returns {object} 현재 화면 항상 켜짐 모드의 설정 상태를 반환해요.\n * @returns {boolean} enabled 화면 항상 켜짐 모드가 켜져 있는지 여부를 나타내는 값이에요.\n *\n * @example\n * ### 화면 항상 켜짐 모드 설정하기\n *\n * ```tsx\n * import { Button } from 'react-native';\n * import { setScreenAwakeMode } from '@apps-in-toss/native-modules';\n *\n * function SetScreenAwakeMode() {\n * return (\n * <Button\n * title=\"화면 항상 켜기\"\n * onPress={() => {\n * setScreenAwakeMode({ enabled: true });\n * }}\n * />\n * );\n * }\n * ```\n *\n * ### 화면 항상 켜짐 모드 복구하기\n * 특정 화면을 벗어날 때 이전 상태로 복구하려면 다음과 같이 `useEffect`를 사용하세요.\n *\n * ```tsx\n * import { useEffect } from 'react';\n * import { setScreenAwakeMode, cleanUp } from '@apps-in-toss/native-modules';\n *\n * function MediaScreen() {\n * useEffect(() => {\n * setScreenAwakeMode({ enabled: true });\n *\n * return () => {\n * setScreenAwakeMode({ enabled: false }); // 설정을 이전 상태로 복구해요.\n * };\n * }, []);\n *\n * return <Text>미디어 콘텐츠를 감상하는 화면</Text>;\n * }\n * ```\n */\nexport declare function setScreenAwakeMode(options: {\n\tenabled: boolean;\n}): Promise<{\n\tenabled: boolean;\n}>;\n\nexport {};\n"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"identifier": "getNetworkStatus",
|
|
24
|
-
"dts": "export type NetworkStatus = \"OFFLINE\" | \"WIFI\" | \"2G\" | \"3G\" | \"4G\" | \"5G\" | \"WWAN\" | \"UNKNOWN\";\n/**\n * @public\n * @category 네트워크\n * @kind function\n * @name getNetworkStatus\n * @description\n * 디바이스의 현재 네트워크 연결 상태를 가져오는 함수예요.\n * 반환 값은 `NetworkStatus` 타입으로, 인터넷 연결 여부와 연결 유형(Wi-Fi, 모바일 데이터 등)을 나타내요. 값은 다음 중 하나예요.\n *\n * - `OFFLINE`: 인터넷에 연결되지 않은 상태예요.\n * - `WIFI`: Wi-Fi에 연결된 상태예요.\n * - `2G`: 2G 네트워크에 연결된 상태예요.\n * - `3G`: 3G 네트워크에 연결된 상태예요.\n * - `4G`: 4G 네트워크에 연결된 상태예요.\n * - `5G`: 5G 네트워크에 연결된 상태예요.\n * - `WWAN`: 인터넷은 연결되었지만, 연결 유형(Wi-Fi, 2G~5G)을 알 수 없는 상태예요. 이 상태는 iOS에서만 확인할 수 있어요.\n * - `UNKNOWN`: 인터넷 연결 상태를 알 수 없는 상태예요. 이 상태는 안드로이드에서만 확인할 수 있어요.\n *\n * @returns {Promise<NetworkStatus>} 네트워크 상태를 반환해요.\n *\n * @example\n * ### 현재 네트워크 상태 가져오기\n *\n * 네트워크 연결 상태를 가져와 화면에 표시하는 예제예요.\n *\n * ```tsx\n * import { useState, useEffect } from 'react';\n * import { Text, View } from 'react-native';\n * import { getNetworkStatus, NetworkStatus } from '
|
|
24
|
+
"dts": "export type NetworkStatus = \"OFFLINE\" | \"WIFI\" | \"2G\" | \"3G\" | \"4G\" | \"5G\" | \"WWAN\" | \"UNKNOWN\";\n/**\n * @public\n * @category 네트워크\n * @kind function\n * @name getNetworkStatus\n * @description\n * 디바이스의 현재 네트워크 연결 상태를 가져오는 함수예요.\n * 반환 값은 `NetworkStatus` 타입으로, 인터넷 연결 여부와 연결 유형(Wi-Fi, 모바일 데이터 등)을 나타내요. 값은 다음 중 하나예요.\n *\n * - `OFFLINE`: 인터넷에 연결되지 않은 상태예요.\n * - `WIFI`: Wi-Fi에 연결된 상태예요.\n * - `2G`: 2G 네트워크에 연결된 상태예요.\n * - `3G`: 3G 네트워크에 연결된 상태예요.\n * - `4G`: 4G 네트워크에 연결된 상태예요.\n * - `5G`: 5G 네트워크에 연결된 상태예요.\n * - `WWAN`: 인터넷은 연결되었지만, 연결 유형(Wi-Fi, 2G~5G)을 알 수 없는 상태예요. 이 상태는 iOS에서만 확인할 수 있어요.\n * - `UNKNOWN`: 인터넷 연결 상태를 알 수 없는 상태예요. 이 상태는 안드로이드에서만 확인할 수 있어요.\n *\n * @returns {Promise<NetworkStatus>} 네트워크 상태를 반환해요.\n *\n * @example\n * ### 현재 네트워크 상태 가져오기\n *\n * 네트워크 연결 상태를 가져와 화면에 표시하는 예제예요.\n *\n * ```tsx\n * import { useState, useEffect } from 'react';\n * import { Text, View } from 'react-native';\n * import { getNetworkStatus, NetworkStatus } from '@apps-in-toss/native-modules';\n *\n * function GetNetworkStatus() {\n * const [status, setStatus] = useState<NetworkStatus | ''>('');\n *\n * useEffect(() => {\n * async function fetchStatus() {\n * const networkStatus = await getNetworkStatus();\n * setStatus(networkStatus);\n * }\n *\n * fetchStatus();\n * }, []);\n *\n * return (\n * <View>\n * <Text>현재 네트워크 상태: {status}</Text>\n * </View>\n * );\n * }\n * ```\n */\nexport declare function getNetworkStatus(): Promise<NetworkStatus>;\n\nexport {};\n"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"identifier": "setIosSwipeGestureEnabled",
|
|
28
|
-
"dts": "/**\n * @public\n * @category 화면 제어\n * @name setIosSwipeGestureEnabled\n * @description\n * `setIosSwipeGestureEnabled` 함수는 iOS에서 화면을 스와이프하여 뒤로가기 기능을 활성화하거나 비활성화할 수 있어요.\n *\n * @param {object} options 스와이프하여 뒤로가기 기능을 활성화하거나 비활성화하는 옵션이에요.\n * @param {boolean} options.isEnabled 화면을 스와이프하여 뒤로가기 기능을 활성화하거나 비활성화할 수 있어요. `true`를 설정하면 스와이프로 뒤로갈 수 있고, `false`를 설정하면 스와이프 뒤로가기 기능이 비활성화돼요.\n *\n * @returns {void}\n *\n * @example\n *\n * ### iOS에서 화면 스와이프로 뒤로가기 기능을 활성화하거나 비활성화하기\n *\n * **스와이프 끄기** 버튼을 눌러 화면 스와이프로 뒤로가기 기능을 비활성화하거나, **스와이프 켜기** 버튼을 눌러 화면 스와이프로 뒤로가기 기능을 활성화할 수 있어요.\n *\n *\n * ```tsx\n * import { setIosSwipeGestureEnabled } from '
|
|
28
|
+
"dts": "/**\n * @public\n * @category 화면 제어\n * @name setIosSwipeGestureEnabled\n * @description\n * `setIosSwipeGestureEnabled` 함수는 iOS에서 화면을 스와이프하여 뒤로가기 기능을 활성화하거나 비활성화할 수 있어요.\n *\n * @param {object} options 스와이프하여 뒤로가기 기능을 활성화하거나 비활성화하는 옵션이에요.\n * @param {boolean} options.isEnabled 화면을 스와이프하여 뒤로가기 기능을 활성화하거나 비활성화할 수 있어요. `true`를 설정하면 스와이프로 뒤로갈 수 있고, `false`를 설정하면 스와이프 뒤로가기 기능이 비활성화돼요.\n *\n * @returns {void}\n *\n * @example\n *\n * ### iOS에서 화면 스와이프로 뒤로가기 기능을 활성화하거나 비활성화하기\n *\n * **스와이프 끄기** 버튼을 눌러 화면 스와이프로 뒤로가기 기능을 비활성화하거나, **스와이프 켜기** 버튼을 눌러 화면 스와이프로 뒤로가기 기능을 활성화할 수 있어요.\n *\n *\n * ```tsx\n * import { setIosSwipeGestureEnabled } from '@apps-in-toss/native-modules';\n * import { Button } from 'react-native';\n *\n * function Page() {\n * return (\n * <>\n * <Button title=\"스와이프 끄기\" onPress={() => setIosSwipeGestureEnabled({ isEnabled: false })} />\n * <Button title=\"스와이프 켜기\" onPress={() => setIosSwipeGestureEnabled({ isEnabled: true })} />\n * </>\n * );\n * }\n * ```\n *\n */\nexport declare function setIosSwipeGestureEnabled(options: {\n\tisEnabled: boolean;\n}): Promise<void>;\n\nexport {};\n"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"identifier": "openURL",
|
|
32
|
-
"dts": "/**\n * @public\n * @kind function\n * @category 화면 이동\n *\n * @name openURL\n * @signature\n * ```typescript\n * function openURL(url: string): Promise<any>;\n * ```\n *\n * @description\n * 지정된 URL을 기기의 기본 브라우저나 관련 앱에서 열어요.\n * 이 함수는 `react-native`의 [`Linking.openURL`](https://reactnative.dev/docs/0.72/linking#openurl) 메서드를 사용하여 URL을 열어요.\n *\n * @param {string} url 열고자 하는 URL 주소\n * @returns {Promise<any>} URL이 성공적으로 열렸을 때 해결되는 Promise\n *\n * @example\n *\n * ### 외부 URL 열기\n *\n * ```tsx\n * import { openURL } from '
|
|
32
|
+
"dts": "/**\n * @public\n * @kind function\n * @category 화면 이동\n *\n * @name openURL\n * @signature\n * ```typescript\n * function openURL(url: string): Promise<any>;\n * ```\n *\n * @description\n * 지정된 URL을 기기의 기본 브라우저나 관련 앱에서 열어요.\n * 이 함수는 `react-native`의 [`Linking.openURL`](https://reactnative.dev/docs/0.72/linking#openurl) 메서드를 사용하여 URL을 열어요.\n *\n * @param {string} url 열고자 하는 URL 주소\n * @returns {Promise<any>} URL이 성공적으로 열렸을 때 해결되는 Promise\n *\n * @example\n *\n * ### 외부 URL 열기\n *\n * ```tsx\n * import { openURL } from '@apps-in-toss/native-modules';\n * import { Button } from 'react-native';\n *\n * function Page() {\n * const handlePress = () => {\n * openURL('https://google.com');\n * };\n *\n * return <Button title=\"구글 웹사이트 열기\" onPress={handlePress} />;\n * }\n * ```\n */\nexport declare function openURL(url: string): Promise<any>;\n\nexport {};\n"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"identifier": "setClipboardText",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
"identifier": "getCurrentLocation",
|
|
52
|
-
"dts": "
|
|
52
|
+
"dts": "declare enum Accuracy {\n\t/**\n\t * 오차범위 3KM 이내\n\t */\n\tLowest = 1,\n\t/**\n\t * 오차범위 1KM 이내\n\t */\n\tLow = 2,\n\t/**\n\t * 오차범위 몇 백미터 이내\n\t */\n\tBalanced = 3,\n\t/**\n\t * 오차범위 10M 이내\n\t */\n\tHigh = 4,\n\t/**\n\t * 가장 높은 정확도\n\t */\n\tHighest = 5,\n\t/**\n\t * 네비게이션을 위한 최고 정확도\n\t */\n\tBestForNavigation = 6\n}\ninterface Location$1 {\n\t/**\n\t * Android에서만 지원하는 옵션이에요.\n\t *\n\t * - `FINE`: 정확한 위치\n\t * - `COARSE`: 대략적인 위치\n\t *\n\t * @see https://developer.android.com/codelabs/approximate-location\n\t */\n\taccessLocation?: \"FINE\" | \"COARSE\";\n\t/**\n\t * 위치가 업데이트된 시점의 유닉스 타임스탬프예요.\n\t */\n\ttimestamp: number;\n\t/**\n\t * @description 위치 정보를 나타내는 객체예요. 자세한 내용은 [LocationCoords](/react-native/reference/native-modules/Types/LocationCoords.html)을 참고해주세요.\n\t */\n\tcoords: LocationCoords;\n}\n/**\n * @public\n * @category 위치 정보\n * @name LocationCoords\n * @description 세부 위치 정보를 나타내는 객체예요.\n */\nexport interface LocationCoords {\n\t/**\n\t * 위도\n\t */\n\tlatitude: number;\n\t/**\n\t * 경도\n\t */\n\tlongitude: number;\n\t/**\n\t * 높이\n\t */\n\taltitude: number;\n\t/**\n\t * 위치 정확도\n\t */\n\taccuracy: number;\n\t/**\n\t * 고도 정확도\n\t */\n\taltitudeAccuracy: number;\n\t/**\n\t * 방향\n\t */\n\theading: number;\n}\nexport interface GetCurrentLocationOptions {\n\t/**\n\t * 위치 정보를 가져올 정확도 수준이에요.\n\t */\n\taccuracy: Accuracy;\n}\n/**\n * @public\n * @category 위치 정보\n * @name getCurrentLocation\n * @description 디바이스의 현재 위치 정보를 가져오는 함수예요.\n * 위치 기반 서비스를 구현할 때 사용되고, 한 번만 호출되어 현재 위치를 즉시 반환해요.\n * 예를 들어 지도 앱에서 사용자의 현재 위치를 한 번만 가져올 때, 날씨 앱에서 사용자의 위치를 기반으로 기상 정보를 제공할 때, 매장 찾기 기능에서 사용자의 위치를 기준으로 가까운 매장을 검색할 때 사용하면 유용해요.\n *\n * @param {GetCurrentLocationOptions} options 위치 정보를 가져올 때 사용하는 옵션 객체예요.\n * @param {Accuracy} [options.accuracy] 위치 정보의 정확도 수준이에요. 정확도는 `Accuracy` 타입으로 설정돼요.\n * @returns {Promise<Location>} 디바이스의 위치 정보가 담긴 객체를 반환해요. 자세한 내용은 [Location](/react-native/reference/native-modules/Types/Location.html)을 참고해주세요.\n *\n * @example\n * ### 디바이스의 현재 위치 정보 가져오기\n *\n * ```tsx\n * import React, { useState } from 'react';\n * import { View, Text, Button } from 'react-native';\n * import { getCurrentLocation } from '@apps-in-toss/framework';\n *\n * // 현재 위치 정보를 가져와 화면에 표시하는 컴포넌트\n * function CurrentPosition() {\n * const [position, setPosition] = useState(null);\n *\n * const handlePress = async () => {\n * try {\n * const response = await getCurrentLocation({ accuracy: Accuracy.Balanced });\n * setPosition(response);\n * } catch (error) {\n * console.error('위치 정보를 가져오는 데 실패했어요:', error);\n * }\n * };\n *\n * return (\n * <View>\n * {position ? (\n * <Text>위치: {position.coords.latitude}, {position.coords.longitude}</Text>\n * ) : (\n * <Text>위치 정보를 아직 가져오지 않았어요</Text>\n * )}\n * <Button title=\"현재 위치 정보 가져오기\" onPress={handlePress} />\n * </View>\n * );\n * }\n * ```\n */\nexport declare function getCurrentLocation(options: GetCurrentLocationOptions): Promise<Location$1>;\n\nexport {};\n"
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"identifier": "openCamera",
|
|
@@ -79,17 +79,29 @@
|
|
|
79
79
|
"identifier": "saveBase64Data",
|
|
80
80
|
"dts": "export interface SaveBase64DataParams {\n\tdata: string;\n\tfileName: string;\n\tmimeType: string;\n}\n/**\n * @public\n * @category 데이터\n * @name saveBase64Data\n * @description 문자열로 인코딩된 Base64 데이터를 지정한 파일 이름과 MIME 타입으로 사용자 기기에 저장해요. 이미지, 텍스트, PDF 등 다양한 형식의 데이터를 저장할 수 있어요.\n * @param {SaveBase64DataParams} params - 저장할 데이터와 파일 정보를 담은 객체예요.\n * @param {string} params.data - Base64 형식으로 인코딩된 데이터 문자열이에요.\n * @param {string} params.fileName - 저장할 파일 이름이에요. 확장자도 같이 붙여줘야해요. 예를 들어, 'example.png'로 저장할 수 있어요.\n * @param {string} params.mimeType - 저장할 파일의 MIME 타입이에요. 예를 들어 'image/png' 로 지정하면 이미지, 'application/pdf'는 PDF 파일이에요. 자세한 내용은 [MIME 문서](https://developer.mozilla.org/ko/docs/Web/HTTP/Guides/MIME_types)를 참고해주세요.\n *\n * @example\n * ### Base64 이미지 데이터를 사용자 기기에 저장하기\n *\n * ```tsx\n * import { Button } from 'react-native';\n * import { saveBase64Data } from '@apps-in-toss/framework';\n *\n * // '저장' 버튼을 누르면 이미지가 사용자 기기에 저장돼요.\n * function SaveButton() {\n * const handleSave = async () => {\n * try {\n * await saveBase64Data({\n * data: 'iVBORw0KGgo...',\n * fileName: 'some-photo.png',\n * mimeType: 'image/png',\n * });\n * } catch (error) {\n * console.error('데이터 저장에 실패했어요:', error);\n * }\n * };\n *\n * return <Button title=\"저장\" onPress={handleSave} />;\n * }\n * ```\n */\nexport declare function saveBase64Data(params: SaveBase64DataParams): Promise<void>;\n\nexport {};\n"
|
|
81
81
|
},
|
|
82
|
+
{
|
|
83
|
+
"identifier": "getGameCenterGameProfile",
|
|
84
|
+
"dts": "/**\n * @category 게임센터\n * @name GameCenterGameProfileResponse\n * @description 토스게임센터 프로필을 가져온 결과 타입이에요.\n * 앱에 프로필이 없는 경우, `statusCode`가 `'PROFILE_NOT_FOUND'`이고 다른 정보는 없어요.\n * 프로필이 있는 경우 `statusCode`가 `'SUCCESS'`이고, 닉네임과 프로필 이미지 주소가 함께 제공돼요.\n * @property {string} statusCode 프로필 조회 결과 상태예요. `'SUCCESS'` 또는 `'PROFILE_NOT_FOUND'` 중 하나예요.\n * @property {string} [nickname] 프로필 닉네임이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.\n * @property {string} [profileImageUri] 프로필 이미지 URL이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.\n */\nexport type GameCenterGameProfileResponse = {\n\tstatusCode: \"PROFILE_NOT_FOUND\";\n} | {\n\tstatusCode: \"SUCCESS\";\n\tnickname: string;\n\tprofileImageUri: string;\n};\n/**\n * @category 게임센터\n * @name getGameCenterGameProfile\n * @description 토스게임센터 프로필 정보를 가져와요.\n * 사용자가 프로필을 만들지 않았다면 `statusCode`가 `'PROFILE_NOT_FOUND'`인 응답이 반환돼요.\n * 앱 버전이 최소 지원 버전(안드로이드 5.221.0, iOS 5.221.0)보다 낮으면 `undefined`를 반환해요.\n * @returns {Promise<GameCenterGameProfileResponse | undefined>} 프로필 정보 또는 `undefined`를 반환해요.\n *\n * @example\n * ### 게임센터 프로필 가져오기\n * ```tsx\n * import { getGameCenterGameProfile } from './getGameCenterGameProfile';\n * import { useState } from 'react';\n * import { View, Button } from 'react-native';\n *\n * function GameProfile() {\n * const [profile, setProfile] = useState<GameCenterGameProfileResponse | null>(null);\n *\n * const handlePress = async () => {\n * try {\n * const result = await getGameCenterGameProfile();\n * if (result) {\n * setProfile(result);\n * }\n * } catch (error) {\n * console.error('게임센터 프로필 가져오기에 실패했어요.', error);\n * }\n * };\n *\n * return (\n * <View>\n * <Button title=\"게임센터 프로필 가져오기\" onPress={handlePress} />\n * </View>\n * );\n * }\n * ```\n */\nexport declare function getGameCenterGameProfile(): Promise<GameCenterGameProfileResponse | undefined>;\n\nexport {};\n"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"identifier": "openGameCenterLeaderboard",
|
|
88
|
+
"dts": "/**\n * @public\n * @category 게임센터\n * @name openGameCenterLeaderboard\n * @description 게임센터 리더보드 웹뷰를 열어요.\n * 앱 버전이 최소 지원 버전(`5.221.0`)보다 낮으면 아무 동작도 하지 않고 `undefined`를 반환해요.\n * 게임센터를 사용하는 사용자는 반드시 최소 지원 버전 이상이어야 게임을 실행할 수 있어요.\n * @returns 리더보드 웹뷰를 호출해요. 앱 버전이 낮으면 아무 동작도 하지 않고 `undefined`를 반환해요.\n *\n * @example\n * import { Button } from 'react-native';\n * import { openGameCenterLeaderboard } from '@apps-in-toss/framework';\n *\n * // '리더보드' 버튼을 누르면 게임센터 리더보드 웹뷰가 열려요.\n * function LeaderboardButton() {\n * const onPress = () => {\n * openGameCenterLeaderboard();\n * };\n *\n * return <Button title=\"리더보드 웹뷰 호출\" onPress={onPress} />;\n * }\n */\nexport declare function openGameCenterLeaderboard(): Promise<void>;\n\nexport {};\n"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"identifier": "submitGameCenterLeaderBoardScore",
|
|
92
|
+
"dts": "/**\n * @public\n * @category 게임센터\n * @name SubmitGameCenterLeaderBoardScoreResponse\n * @description\n * 토스게임센터 리더보드에 점수를 제출한 결과 정보를 담아서 반환해요. 반환된 정보를 사용해서 점수 제출 결과에 따라 적절한 에러 처리를 할 수 있어요.\n * @property {'SUCCESS' | 'LEADERBOARD_NOT_FOUND' | 'PROFILE_NOT_FOUND' | 'UNPARSABLE_SCORE'} statusCode\n * 점수 제출 결과를 나타내는 상태 코드예요.\n * - `'SUCCESS'`: 점수 제출이 성공했어요.\n * - `'LEADERBOARD_NOT_FOUND'`: `gameId`에 해당하는 리더보드를 찾을 수 없어요.\n * - `'PROFILE_NOT_FOUND'`: 사용자의 프로필이 없어요.\n * - `'UNPARSABLE_SCORE'`: 점수를 해석할 수 없어요. 점수는 실수(float) 형태의 문자열로 전달해야 해요.\n */\nexport interface SubmitGameCenterLeaderBoardScoreResponse {\n\tstatusCode: \"SUCCESS\" | \"LEADERBOARD_NOT_FOUND\" | \"PROFILE_NOT_FOUND\" | \"UNPARSABLE_SCORE\";\n}\n/**\n * @public\n * @category 게임센터\n * @name submitGameCenterLeaderBoardScore\n * @description\n * 사용자의 게임 점수를 토스게임센터 리더보드에 제출해요. 이 기능으로 사용자의 점수를 공식 리더보드에 기록하고 다른 사용자와 비교할 수 있어요.\n * @param {string} params.score\n * 제출할 게임 점수예요. 실수 형태의 숫자를 문자열로 전달해야 해요. 예를들어 `\"123.45\"` 또는 `\"9999\"` 예요.\n * @returns {Promise<SubmitGameCenterLeaderBoardScoreResponse | undefined>}\n * 점수 제출 결과를 반환해요. 앱 버전이 최소 지원 버전보다 낮으면 아무 동작도 하지 않고 `undefined`를 반환해요.\n *\n * @example\n * ### 게임 점수를 토스게임센터 리더보드에 제출하기\n * ```tsx\n * import { Button } from 'react-native';\n * import { submitGameCenterLeaderBoardScore } from '@apps-in-toss/framework';\n *\n * function GameCenterLeaderBoardScoreSubmitButton() {\n * async function handlePress() {\n * try {\n * const result = await submitGameCenterLeaderBoardScore({ score: '123.45' });\n *\n * if (!result) {\n * console.warn('지원하지 않는 앱 버전이에요.');\n * return;\n * }\n *\n * if (result.statusCode === 'SUCCESS') {\n * console.log('점수 제출 성공!');\n * } else {\n * console.error('점수 제출 실패:', result.statusCode);\n * }\n * } catch (error) {\n * console.error('점수 제출 중 오류가 발생했어요.', error);\n * }\n * }\n *\n * return (\n * <Button onPress={handlePress}>점수 제출하기</Button>\n * );\n * }\n * ```\n */\nexport declare function submitGameCenterLeaderBoardScore(params: {\n\tscore: string;\n}): Promise<SubmitGameCenterLeaderBoardScoreResponse | undefined>;\n\nexport {};\n"
|
|
93
|
+
},
|
|
82
94
|
{
|
|
83
95
|
"identifier": "getLocale",
|
|
84
|
-
"dts": "/**\n * @public\n * @category 언어\n * @kind function\n * @name getLocale\n * @description\n * 사용자의 로케일(locale) 정보를 반환해요. 네이티브 모듈에서 로케일 정보를 가져올 수 없을 때는 기본값으로 'ko-KR'을 반환합니다. 앱의 현지화 및 언어 설정과 관련된 기능을 구현할 때 사용하세요.\n *\n * @returns {string} 사용자의 로케일 정보를 반환해요.\n *\n * @example\n * ### 현재 사용자의 로케일 정보 가져오기\n *\n * ```tsx\n * import { getLocale } from '
|
|
96
|
+
"dts": "/**\n * @public\n * @category 언어\n * @kind function\n * @name getLocale\n * @description\n * 사용자의 로케일(locale) 정보를 반환해요. 네이티브 모듈에서 로케일 정보를 가져올 수 없을 때는 기본값으로 'ko-KR'을 반환합니다. 앱의 현지화 및 언어 설정과 관련된 기능을 구현할 때 사용하세요.\n *\n * @returns {string} 사용자의 로케일 정보를 반환해요.\n *\n * @example\n * ### 현재 사용자의 로케일 정보 가져오기\n *\n * ```tsx\n * import { getLocale } from '@apps-in-toss/native-modules';\n * import { Text } from 'react-native';\n *\n * function MyPage() {\n * const locale = getLocale();\n *\n * return (\n * <Text>사용자의 로케일 정보: {locale}</Text>\n * )\n * }\n *\n * ```\n */\nexport declare function getLocale(): string;\n\nexport {};\n"
|
|
85
97
|
},
|
|
86
98
|
{
|
|
87
99
|
"identifier": "getSchemeUri",
|
|
88
|
-
"dts": "/**\n * @public\n * @name getSchemeUri\n * @category 환경 확인\n * @kind function\n * @description 처음에 화면에 진입한 스킴 값이에요. 페이지 이동으로 인한 URI 변경은 반영되지 않아요.\n * @returns {string} 처음에 화면에 진입한 스킴 값을 반환해요.\n *\n * @example\n * ### 처음 진입한 스킴 값 가져오기\n *\n * ```tsx\n * import { getSchemeUri } from '
|
|
100
|
+
"dts": "/**\n * @public\n * @name getSchemeUri\n * @category 환경 확인\n * @kind function\n * @description 처음에 화면에 진입한 스킴 값이에요. 페이지 이동으로 인한 URI 변경은 반영되지 않아요.\n * @returns {string} 처음에 화면에 진입한 스킴 값을 반환해요.\n *\n * @example\n * ### 처음 진입한 스킴 값 가져오기\n *\n * ```tsx\n * import { getSchemeUri } from '@apps-in-toss/native-modules';\n * import { Text } from 'react-native';\n *\n * function MyPage() {\n * const schemeUri = getSchemeUri();\n *\n * return <Text>처음에 화면에 진입한 스킴 값: {schemeUri}</Text>\n * }\n * ```\n */\nexport declare function getSchemeUri(): string;\n\nexport {};\n"
|
|
89
101
|
},
|
|
90
102
|
{
|
|
91
103
|
"identifier": "getPlatformOS",
|
|
92
|
-
"dts": "/**\n * @public\n * @kind function\n * @category 환경 확인\n *\n * @name getPlatformOS\n * @signature\n * ```typescript\n * function getPlatformOS(): 'ios' | 'android';\n * ```\n *\n * @description\n * 현재 실행 중인 플랫폼을 확인하는 함수예요.\n * 이 함수는 `react-native`의 [`Platform.OS`](https://reactnative.dev/docs/0.72/platform#os) 값을 기반으로 동작하며, `ios` 또는 `android` 중 하나의 문자열을 반환해요.\n *\n * @returns {'ios' | 'android'} 현재 실행 중인 플랫폼\n *\n * @example\n *\n * ### 현재 실행중인 OS 플랫폼 확인하기\n *\n * ```tsx\n * import { getPlatformOS } from '
|
|
104
|
+
"dts": "/**\n * @public\n * @kind function\n * @category 환경 확인\n *\n * @name getPlatformOS\n * @signature\n * ```typescript\n * function getPlatformOS(): 'ios' | 'android';\n * ```\n *\n * @description\n * 현재 실행 중인 플랫폼을 확인하는 함수예요.\n * 이 함수는 `react-native`의 [`Platform.OS`](https://reactnative.dev/docs/0.72/platform#os) 값을 기반으로 동작하며, `ios` 또는 `android` 중 하나의 문자열을 반환해요.\n *\n * @returns {'ios' | 'android'} 현재 실행 중인 플랫폼\n *\n * @example\n *\n * ### 현재 실행중인 OS 플랫폼 확인하기\n *\n * ```tsx\n * import { getPlatformOS } from '@apps-in-toss/native-modules';\n * import { Text } 'react-native';\n *\n * function Page() {\n * const platform = getPlatformOS();\n *\n * return <Text>현재 플랫폼: {platform}</Text>;\n * }\n * ```\n */\nexport declare function getPlatformOS(): \"ios\" | \"android\";\n\nexport {};\n"
|
|
93
105
|
},
|
|
94
106
|
{
|
|
95
107
|
"identifier": "getOperationalEnvironment",
|
|
@@ -105,6 +117,17 @@
|
|
|
105
117
|
},
|
|
106
118
|
{
|
|
107
119
|
"identifier": "startUpdateLocation",
|
|
108
|
-
"dts": "import { EmitterSubscription } from 'react-native';\n\nexport interface EventEmitterSchema<K extends string, P extends unknown[]> {\n\tname: K;\n\tparams: P;\n}\ndeclare enum Accuracy {\n\t/**\n\t * 오차범위 3KM 이내\n\t */\n\tLowest = 1,\n\t/**\n\t * 오차범위 1KM 이내\n\t */\n\tLow = 2,\n\t/**\n\t * 오차범위 몇 백미터 이내\n\t */\n\tBalanced = 3,\n\t/**\n\t * 오차범위 10M 이내\n\t */\n\tHigh = 4,\n\t/**\n\t * 가장 높은 정확도\n\t */\n\tHighest = 5,\n\t/**\n\t * 네비게이션을 위한 최고 정확도\n\t */\n\tBestForNavigation = 6\n}\ninterface Location$1 {\n\t/**\n\t * Android에서만 지원하는 옵션이에요.\n\t *\n\t * - `FINE`: 정확한 위치\n\t * - `COARSE`: 대략적인 위치\n\t *\n\t * @see https://developer.android.com/codelabs/approximate-location\n\t */\n\taccessLocation?: \"FINE\" | \"COARSE\";\n\t/**\n\t * 위치가 업데이트된 시점의 유닉스 타임스탬프예요.\n\t */\n\ttimestamp: number;\n\t/**\n\t * @description 위치 정보를 나타내는 객체예요. 자세한 내용은 [LocationCoords](/react-native/reference/
|
|
120
|
+
"dts": "import { EmitterSubscription } from 'react-native';\n\nexport interface EventEmitterSchema<K extends string, P extends unknown[]> {\n\tname: K;\n\tparams: P;\n}\ndeclare enum Accuracy {\n\t/**\n\t * 오차범위 3KM 이내\n\t */\n\tLowest = 1,\n\t/**\n\t * 오차범위 1KM 이내\n\t */\n\tLow = 2,\n\t/**\n\t * 오차범위 몇 백미터 이내\n\t */\n\tBalanced = 3,\n\t/**\n\t * 오차범위 10M 이내\n\t */\n\tHigh = 4,\n\t/**\n\t * 가장 높은 정확도\n\t */\n\tHighest = 5,\n\t/**\n\t * 네비게이션을 위한 최고 정확도\n\t */\n\tBestForNavigation = 6\n}\ninterface Location$1 {\n\t/**\n\t * Android에서만 지원하는 옵션이에요.\n\t *\n\t * - `FINE`: 정확한 위치\n\t * - `COARSE`: 대략적인 위치\n\t *\n\t * @see https://developer.android.com/codelabs/approximate-location\n\t */\n\taccessLocation?: \"FINE\" | \"COARSE\";\n\t/**\n\t * 위치가 업데이트된 시점의 유닉스 타임스탬프예요.\n\t */\n\ttimestamp: number;\n\t/**\n\t * @description 위치 정보를 나타내는 객체예요. 자세한 내용은 [LocationCoords](/react-native/reference/native-modules/Types/LocationCoords.html)을 참고해주세요.\n\t */\n\tcoords: LocationCoords;\n}\n/**\n * @public\n * @category 위치 정보\n * @name LocationCoords\n * @description 세부 위치 정보를 나타내는 객체예요.\n */\nexport interface LocationCoords {\n\t/**\n\t * 위도\n\t */\n\tlatitude: number;\n\t/**\n\t * 경도\n\t */\n\tlongitude: number;\n\t/**\n\t * 높이\n\t */\n\taltitude: number;\n\t/**\n\t * 위치 정확도\n\t */\n\taccuracy: number;\n\t/**\n\t * 고도 정확도\n\t */\n\taltitudeAccuracy: number;\n\t/**\n\t * 방향\n\t */\n\theading: number;\n}\nexport interface StartUpdateLocationOptions {\n\t/**\n\t * 위치 정확도를 설정해요.\n\t */\n\taccuracy: Accuracy;\n\t/**\n\t * 위치 업데이트 주기를 밀리초(ms) 단위로 설정해요.\n\t */\n\ttimeInterval: number;\n\t/**\n\t * 위치 변경 거리를 미터(m) 단위로 설정해요.\n\t */\n\tdistanceInterval: number;\n}\nexport interface StartUpdateLocationSubscription extends EmitterSubscription {\n\tremove: () => Promise<void>;\n}\n/**\n * @name UpdateLocationEventEmitter\n * @kind typedef\n * @description\n * 디바이스의 위치 정보 변경을 감지해요\n */\nexport type UpdateLocationEventEmitter = EventEmitterSchema<\"updateLocation\", [\n\tLocation$1\n]>;\n/**\n * @public\n * @category 위치 정보\n * @name startUpdateLocation\n * @description 디바이스의 위치 정보를 지속적으로 감지하고, 위치가 변경되면 콜백을 실행하는 함수예요. 콜백 함수를 등록하면 위치가 변경될 때마다 자동으로 호출돼요.\n * 실시간 위치 추적이 필요한 기능을 구현할 때 사용할 수 있어요. 예를 들어 지도 앱에서 사용자의 현재 위치를 실시간으로 업데이트할 때, 운동 앱에서 사용자의 이동 거리를 기록할 때 등이에요.\n * 위치 업데이트 주기와 정확도를 조정해 배터리 소모를 최소화하면서도 필요한 정보를 얻을 수 있어요.\n *\n * @param {StartUpdateLocationOptions} options - 위치 정보 감지에 필요한 설정 객체에요.\n * @param {number} [options.accuracy] 위치 정확도를 설정해요.\n * @param {number} [options.timeInterval] 위치 정보를 업데이트하는 최소 주기로, 단위는 밀리초(ms)예요. 이 값은 위치 업데이트가 발생하는 가장 짧은 간격을 설정하지만, 시스템이나 환경의 영향을 받아 지정한 주기보다 더 긴 간격으로 업데이트될 수 있어요.\n * @param {number} [options.distanceInterval] 위치 변경 거리를 미터(m) 단위로 설정해요.\n * @param {(location: Location) => void} [options.callback] 위치 정보가 변경될 때 호출되는 콜백 함수예요. 자세한 내용은 [Location](/react-native/reference/native-modules/Types/Location.html)을 참고해주세요.\n *\n * @example\n * ### 위치 정보 변경 감지하기\n *\n * ```tsx\n * import React, { useState, useEffect } from 'react';\n * import { View, Text, Button } from 'react-native';\n * import { startUpdateLocation } from '@apps-in-toss/framework';\n *\n * // 위치 정보 변경 감지하기\n * function LocationWatcher() {\n * const [location, setLocation] = useState(null);\n *\n * useEffect(() => {\n * return startUpdateLocation({\n * options: {\n * accuracy: Accuracy.Balanced,\n * timeInterval: 3000,\n * distanceInterval: 10,\n * },\n * onEvent: (location) => {\n * setLocation(location);\n * },\n * onError: (error) => {\n * console.error('위치 정보를 가져오는데 실패했어요:', error);\n * },\n * });\n * }, []);\n *\n * if (location == null) {\n * return <Text>위치 정보를 가져오는 중이에요...</Text>;\n * }\n *\n * return (\n * <View>\n * <Text>위도: {location.coords.latitude}</Text>\n * <Text>경도: {location.coords.longitude}</Text>\n * <Text>위치 정확도: {location.coords.accuracy}m</Text>\n * <Text>높이: {location.coords.altitude}m</Text>\n * <Text>고도 정확도: {location.coords.altitudeAccuracy}m</Text>\n * <Text>방향: {location.coords.heading}°</Text>\n * </View>\n * );\n * }\n * ```\n */\nexport declare function startUpdateLocation(eventParams: {\n\tonEvent: (response: Location$1) => void;\n\tonError: (error: unknown) => void;\n\toptions: StartUpdateLocationOptions;\n}): () => void;\n\nexport {};\n"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"identifier": "onVisibilityChangedByTransparentServiceWeb",
|
|
124
|
+
"dts": "import { EmitterSubscription } from 'react-native';\n\nexport interface EventEmitterSchema<K extends string, P extends unknown[]> {\n\tname: K;\n\tparams: P;\n}\nexport interface OnVisibilityChangedByTransparentServiceWebSubscription extends EmitterSubscription {\n\tremove: () => void;\n}\nexport type OnVisibilityChangedByTransparentServiceWebEventEmitter = EventEmitterSchema<\"visibilityChangedByTransparentServiceWeb\", [\n\tboolean\n]>;\nexport declare function onVisibilityChangedByTransparentServiceWeb(eventParams: {\n\toptions: {\n\t\tcallbackId: string;\n\t};\n\tonEvent: (isVisible: boolean) => void;\n\tonError: (error: unknown) => void;\n}): () => void;\n\nexport {};\n"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"identifier": "contactsViral",
|
|
128
|
+
"dts": "/**\n * @public\n * @category 친구초대\n * @name RewardFromContactsViralEvent\n * @description 친구에게 공유하기를 완료했을 때 지급할 리워드 정보를 담는 타입이에요. 이 타입을 사용하면 공유가 완료됐을 때 지급할 리워드 정보를 확인할 수 있어요.\n * @property {'sendViral'} type - 이벤트의 타입이에요. `'sendViral'`은 사용자가 친구에게 공유를 완료했을 때 돌아와요.\n * @property {Object} data - 지급할 리워드 관련 정보를 담고 있어요.\n * @property {number} data.rewardAmount - 지급할 리워드 수량이에요. 앱인토스 콘솔에서 설정한 수량 및 금액 값이에요.\n * @property {string} data.rewardUnit - 리워드의 단위예요. 앱인토스 콘솔에 설정된 리워드 이름인 '하트', '보석' 등이 리워드 단위예요.\n */\nexport type RewardFromContactsViralEvent = {\n\ttype: \"sendViral\";\n\tdata: {\n\t\trewardAmount: number;\n\t\trewardUnit: string;\n\t};\n};\n/**\n * @public\n * @category 친구초대\n * @name ContactsViralSuccessEvent\n * @description 연락처 공유 모듈이 정상적으로 종료됐을 때 전달되는 이벤트 객체예요. 종료 이유와 함께 리워드 상태 및 남은 친구 수 등 관련 정보를 제공해요.\n * @property {'close'} type - 이벤트의 타입이에요. `'close'`는 공유 모듈이 종료됐을 때 돌아와요.\n * @property {Object} data - 모듈 종료와 관련된 세부 정보를 담고 있어요.\n * @property {'clickBackButton' | 'noReward'} data.closeReason - 모듈이 종료된 이유예요. `'clickBackButton'`은 사용자가 뒤로 가기 버튼을 눌러 종료한 경우이고, `'noReward'`는 받을 수 있는 리워드가 없어서 종료된 경우예요.\n * @property {number} data.sentRewardAmount - 사용자가 받은 전체 리워드 수량이에요.\n * @property {number} data.sendableRewardsCount - 아직 공유할 수 있는 친구 수예요.\n * @property {number} data.sentRewardsCount - 사용자가 공유를 완료한 친구 수예요.\n * @property {string} data.rewardUnit - 리워드의 단위예요. 앱인토스 콘솔에 설정된 리워드 이름인 '하트', '보석' 등이 리워드 단위예요.\n */\nexport type ContactsViralSuccessEvent = {\n\ttype: \"close\";\n\tdata: {\n\t\tcloseReason: \"clickBackButton\" | \"noReward\";\n\t\tsentRewardAmount?: number;\n\t\tsendableRewardsCount?: number;\n\t\tsentRewardsCount: number;\n\t\trewardUnit?: string;\n\t};\n};\nexport type ContactsViralEvent = RewardFromContactsViralEvent | ContactsViralSuccessEvent;\n/**\n * @public\n * @category 친구초대\n * @name ContactsViralOption\n * @description [연락처 공유 기능](/react-native/reference/native-modules/친구초대/contactsViral.html)을 사용할 때 필요한 옵션이에요.\n * @property {string} moduleId - 공유 리워드를 구분하는 UUID 형식의 고유 ID예요. 앱인토스 콘솔의 미니앱 > 공유 리워드 메뉴에서 확인할 수 있어요.\n */\nexport type ContactsViralOption = {\n\tmoduleId: string;\n};\n/**\n * @public\n * @category 친구초대\n * @name ContactsViralParams\n * @description `ContactsViralParams`는 연락처 공유 기능을 사용할 때 전달해야 하는 파라미터 타입이에요. 옵션을 설정하고, 이벤트 및 에러 처리 콜백을 지정할 수 있어요.\n * @property {ContactsViralOption} options - 공유 기능에 사용할 옵션 객체예요.\n * @property {(event: ContactsViralEvent) => void} onEvent - 공유 이벤트가 발생했을 때 실행되는 함수예요. [`RewardFromContactsViralEvent`](/bedrock/reference/native-modules/친구초대/RewardFromContactsViralEvent.html) 또는 [`ContactsViralSuccessEvent`](/react-native/reference/native-modules/친구초대/ContactsViralSuccessEvent.html) 타입의 이벤트 객체가 전달돼요.\n * @property {(error: unknown) => void} onError - 예기치 않은 에러가 발생했을 때 실행되는 함수예요.\n */\nexport interface ContactsViralParams {\n\toptions: ContactsViralOption;\n\tonEvent: (event: ContactsViralEvent) => void;\n\tonError: (error: unknown) => void;\n}\n/**\n * @public\n * @category 친구초대\n * @name contactsViral\n * @description 친구에게 공유하고 리워드를 받을 수 있는 기능을 제공해요. 사용자가 친구에게 공유를 완료하면 앱브릿지가 이벤트를 통해 리워드 정보를 전달해요.\n * @param {ContactsViralParams} params - 연락처 공유 기능을 실행할 때 사용하는 파라미터예요. 옵션 설정과 이벤트 핸들러를 포함해요. 자세한 내용은 [ContactsViralParams](/bedrock/reference/native-modules/친구초대/ContactsViralParams.html) 문서를 참고하세요.\n * @returns {() => void} 앱브릿지 cleanup 함수를 반환해요. 공유 기능이 끝나면 반드시 이 함수를 호출해서 리소스를 해제해야 해요.\n *\n * @example\n * ### 친구에게 공유하고 리워드 받기\n *\n * ```tsx\n * import { useCallback } from 'react';\n * import { Button } from 'react-native';\n * import { contactsViral } from '@apps-in-toss/framework';\n *\n * function ContactsViralButton({ moduleId }: { moduleId: string }) {\n * const handleContactsViral = useCallback(() => {\n * try {\n * const cleanup = contactsViral({\n * options: { moduleId: moduleId.trim() },\n * onEvent: (event) => {\n * if (event.type === 'sendViral') {\n * console.log('리워드 지급:', event.data.rewardAmount, event.data.rewardUnit);\n * } else if (event.type === 'close') {\n * console.log('모듈 종료:', event.data.closeReason);\n * }\n * },\n * onError: (error) => {\n * console.error('에러 발생:', error);\n * },\n * });\n *\n * return cleanup;\n * } catch (error) {\n * console.error('실행 중 에러:', error);\n * }\n * }, [moduleId]);\n *\n * return <Button title=\"친구에게 공유하고 리워드 받기\" onPress={handleContactsViral} />;\n * }\n * ```\n */\nexport declare function contactsViral(params: ContactsViralParams): () => void;\n\nexport {};\n"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"dts": "type PermissionStatus$1 = \"notDetermined\" | \"denied\" | \"allowed\";\nexport type PermissionAccess = \"read\" | \"write\" | \"access\";\ntype PermissionName$1 = \"clipboard\" | \"contacts\" | \"photos\" | \"geolocation\" | \"camera\";\nexport type Primitive = string | number | boolean | null | undefined | symbol;\n/**\n * @public\n * @category 위치 정보\n * @name Accuracy\n * @description 위치 정확도 옵션이에요.\n */\nexport declare enum Accuracy {\n\t/**\n\t * 오차범위 3KM 이내\n\t */\n\tLowest = 1,\n\t/**\n\t * 오차범위 1KM 이내\n\t */\n\tLow = 2,\n\t/**\n\t * 오차범위 몇 백미터 이내\n\t */\n\tBalanced = 3,\n\t/**\n\t * 오차범위 10M 이내\n\t */\n\tHigh = 4,\n\t/**\n\t * 가장 높은 정확도\n\t */\n\tHighest = 5,\n\t/**\n\t * 네비게이션을 위한 최고 정확도\n\t */\n\tBestForNavigation = 6\n}\n/**\n * @public\n * @category 위치 정보\n * @name Location\n * @description 위치 정보를 나타내는 객체예요.\n */\ninterface Location$1 {\n\t/**\n\t * Android에서만 지원하는 옵션이에요.\n\t *\n\t * - `FINE`: 정확한 위치\n\t * - `COARSE`: 대략적인 위치\n\t *\n\t * @see https://developer.android.com/codelabs/approximate-location\n\t */\n\taccessLocation?: \"FINE\" | \"COARSE\";\n\t/**\n\t * 위치가 업데이트된 시점의 유닉스 타임스탬프예요.\n\t */\n\ttimestamp: number;\n\t/**\n\t * @description 위치 정보를 나타내는 객체예요. 자세한 내용은 [LocationCoords](/react-native/reference/native-modules/Types/LocationCoords.html)을 참고해주세요.\n\t */\n\tcoords: LocationCoords;\n}\n/**\n * @public\n * @category 위치 정보\n * @name LocationCoords\n * @description 세부 위치 정보를 나타내는 객체예요.\n */\nexport interface LocationCoords {\n\t/**\n\t * 위도\n\t */\n\tlatitude: number;\n\t/**\n\t * 경도\n\t */\n\tlongitude: number;\n\t/**\n\t * 높이\n\t */\n\taltitude: number;\n\t/**\n\t * 위치 정확도\n\t */\n\taccuracy: number;\n\t/**\n\t * 고도 정확도\n\t */\n\taltitudeAccuracy: number;\n\t/**\n\t * 방향\n\t */\n\theading: number;\n}\n/**\n * 사진 조회 결과를 나타내는 타입이에요.\n */\nexport interface ImageResponse {\n\t/** 가져온 사진의 고유 ID예요. */\n\tid: string;\n\t/** 사진의 데이터 URI예요. `base64` 옵션이 `true`인 경우 Base64 문자열로 반환돼요. */\n\tdataUri: string;\n}\n\nexport {\n\tLocation$1 as Location,\n\tPermissionName$1 as PermissionName,\n\tPermissionStatus$1 as PermissionStatus,\n};\n\nexport {};\n"
|
|
109
132
|
}
|
|
110
133
|
]
|