@apps-in-toss/framework 0.0.8 → 0.0.10

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/README.md CHANGED
@@ -4,21 +4,20 @@ Hub package for Apps In Toss
4
4
 
5
5
  ## License
6
6
 
7
- This software is licensed under the [Apache 2 license](LICENSE), quoted below.
7
+ This software is licensed under the [GPL, Version 3.0](LICENSE), quoted below.
8
8
 
9
9
  ```
10
- Copyright 2025 Viva Republica, Inc
10
+ Copyright 2025 Viva Republica, Inc.
11
11
 
12
- Licensed under the Apache License, Version 2.0 (the "License");
12
+ Licensed under the GPL, Version 3.0 (the "License");
13
13
  you may not use this file except in compliance with the License.
14
14
  You may obtain a copy of the License at:
15
15
 
16
- http://www.apache.org/licenses/LICENSE-2.0
16
+ https://www.gnu.org/licenses/gpl-3.0.html
17
17
 
18
18
  Unless required by applicable law or agreed to in writing, software
19
19
  distributed under the License is distributed on an "AS IS" BASIS,
20
20
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
21
  See the License for the specific language governing permissions and
22
22
  limitations under the License.
23
-
24
23
  ```
@@ -1,4 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import { initialize } from '@apps-in-toss/cli';
3
-
4
3
  initialize();
@@ -0,0 +1,24 @@
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 __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+
17
+ // src/cli-presets.ts
18
+ var cli_presets_exports = {};
19
+ module.exports = __toCommonJS(cli_presets_exports);
20
+ __reExport(cli_presets_exports, require("@apps-in-toss/cli-presets"), module.exports);
21
+ // Annotate the CommonJS export names for ESM import in node:
22
+ 0 && (module.exports = {
23
+ ...require("@apps-in-toss/cli-presets")
24
+ });
@@ -0,0 +1 @@
1
+ export * from '@apps-in-toss/cli-presets';
@@ -0,0 +1 @@
1
+ export * from '@apps-in-toss/cli-presets';
@@ -0,0 +1,2 @@
1
+ // src/cli-presets.ts
2
+ export * from "@apps-in-toss/cli-presets";
package/dist/index.cjs CHANGED
@@ -31,12 +31,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
33
  Accuracy: () => Accuracy2,
34
+ AppsInToss: () => AppsInToss,
34
35
  WebView: () => WebView,
36
+ appLogin: () => appLogin,
35
37
  env: () => env,
36
38
  fetchAlbumPhotos: () => fetchAlbumPhotos,
37
39
  fetchContacts: () => fetchContacts,
38
40
  getClipboardText: () => getClipboardText,
39
41
  getCurrentLocation: () => getCurrentLocation,
42
+ getOperationalEnvironment: () => getOperationalEnvironment,
40
43
  openCamera: () => openCamera,
41
44
  setClipboardText: () => setClipboardText,
42
45
  startUpdateLocation: () => startUpdateLocation,
@@ -44,6 +47,32 @@ __export(src_exports, {
44
47
  });
45
48
  module.exports = __toCommonJS(src_exports);
46
49
 
50
+ // src/core/registerApp.tsx
51
+ var import_react_native_bedrock = require("react-native-bedrock");
52
+ var import_jsx_runtime = require("react/jsx-runtime");
53
+ function AppsInTossContainer(Container, { children, ...initialProps }) {
54
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Container, { ...initialProps, children });
55
+ }
56
+ function registerApp(container, { context }) {
57
+ return import_react_native_bedrock.Bedrock.registerApp(AppsInTossContainer.bind(null, container), {
58
+ appName: getAppName(),
59
+ context
60
+ });
61
+ }
62
+ function getAppName() {
63
+ try {
64
+ return global.__bedrock.app.name;
65
+ } catch (error) {
66
+ console.error("unexpected error occurred while getting app name");
67
+ throw error;
68
+ }
69
+ }
70
+
71
+ // src/core/index.ts
72
+ var AppsInToss = {
73
+ registerApp
74
+ };
75
+
47
76
  // src/native-event-emitter/index.ts
48
77
  var native_event_emitter_exports = {};
49
78
  __export(native_event_emitter_exports, {
@@ -51,10 +80,10 @@ __export(native_event_emitter_exports, {
51
80
  });
52
81
 
53
82
  // src/native-event-emitter/bedrock-event.ts
54
- var import_react_native_bedrock2 = require("react-native-bedrock");
83
+ var import_react_native_bedrock3 = require("react-native-bedrock");
55
84
 
56
85
  // src/native-event-emitter/event-plugins/UpdateLocationEvent.ts
57
- var import_react_native_bedrock = require("react-native-bedrock");
86
+ var import_react_native_bedrock2 = require("react-native-bedrock");
58
87
 
59
88
  // src/native-modules/AppsInTossModule.ts
60
89
  var import_react_native = require("react-native");
@@ -88,7 +117,7 @@ var import_react_native2 = require("react-native");
88
117
  var nativeEventEmitter = new import_react_native2.NativeEventEmitter(AppsInTossModuleInstance);
89
118
 
90
119
  // src/native-event-emitter/event-plugins/UpdateLocationEvent.ts
91
- var UpdateLocationEvent = class extends import_react_native_bedrock.BedrockEventDefinition {
120
+ var UpdateLocationEvent = class extends import_react_native_bedrock2.BedrockEventDefinition {
92
121
  name = "updateLocationEvent";
93
122
  subscriptionCount = 0;
94
123
  ref = {
@@ -116,7 +145,7 @@ var UpdateLocationEvent = class extends import_react_native_bedrock.BedrockEvent
116
145
  };
117
146
 
118
147
  // src/native-event-emitter/bedrock-event.ts
119
- var appsInTossEvent = new import_react_native_bedrock2.BedrockEvent([new UpdateLocationEvent()]);
148
+ var appsInTossEvent = new import_react_native_bedrock3.BedrockEvent([new UpdateLocationEvent()]);
120
149
 
121
150
  // src/native-event-emitter/startUpdateLocation.ts
122
151
  function startUpdateLocation(eventParams) {
@@ -126,10 +155,12 @@ function startUpdateLocation(eventParams) {
126
155
  // src/native-modules/index.ts
127
156
  var native_modules_exports = {};
128
157
  __export(native_modules_exports, {
158
+ appLogin: () => appLogin,
129
159
  fetchAlbumPhotos: () => fetchAlbumPhotos,
130
160
  fetchContacts: () => fetchContacts,
131
161
  getClipboardText: () => getClipboardText,
132
162
  getCurrentLocation: () => getCurrentLocation,
163
+ getOperationalEnvironment: () => getOperationalEnvironment,
133
164
  openCamera: () => openCamera,
134
165
  setClipboardText: () => setClipboardText
135
166
  });
@@ -187,6 +218,14 @@ async function fetchAlbumPhotos(options) {
187
218
  maxCount: options.maxCount ?? DEFAULT_MAX_COUNT,
188
219
  maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH
189
220
  });
221
+ if (options.base64) {
222
+ return albumPhotos.map((photo) => {
223
+ return {
224
+ ...photo,
225
+ dataUri: `data:image/jpeg;base64,${photo.dataUri}`
226
+ };
227
+ });
228
+ }
190
229
  return albumPhotos;
191
230
  }
192
231
 
@@ -210,21 +249,31 @@ async function openCamera(options) {
210
249
  return photo;
211
250
  }
212
251
 
252
+ // src/native-modules/appLogin.ts
253
+ async function appLogin() {
254
+ return AppsInTossModule.appLogin({});
255
+ }
256
+
257
+ // src/native-modules/getOperationalEnvironment.ts
258
+ function getOperationalEnvironment() {
259
+ return AppsInTossModule.operationalEnvironment;
260
+ }
261
+
213
262
  // src/components/WebView.tsx
214
263
  var import_react_native_webview = require("@react-native-bedrock/native/react-native-webview");
215
264
  var import_react = require("react");
216
- var import_react_native_bedrock3 = require("react-native-bedrock");
265
+ var import_react_native_bedrock4 = require("react-native-bedrock");
217
266
  var bridges = __toESM(require("react-native-bedrock/bridges"), 1);
218
267
  var constantBridges = __toESM(require("react-native-bedrock/constants"), 1);
219
- var import_jsx_runtime = require("react/jsx-runtime");
220
- function WebView({ localhostPort = 5173, onMessage, ...props }) {
268
+ var import_jsx_runtime2 = require("react/jsx-runtime");
269
+ function WebView({ local, onMessage, ...props }) {
221
270
  const uri = (0, import_react.useMemo)(() => {
222
271
  if (__DEV__) {
223
- return `http://localhost:${localhostPort}`;
272
+ return `http://${local.host}:${local.port}`;
224
273
  }
225
274
  return AppsInTossModule.getWebBundleURL({}).url;
226
- }, [localhostPort]);
227
- const handler = (0, import_react_native_bedrock3.useBridgeHandler)({
275
+ }, [local]);
276
+ const handler = (0, import_react_native_bedrock4.useBridgeHandler)({
228
277
  onMessage,
229
278
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
230
279
  eventListenerMap: native_event_emitter_exports,
@@ -238,7 +287,7 @@ function WebView({ localhostPort = 5173, onMessage, ...props }) {
238
287
  ...native_modules_exports
239
288
  }
240
289
  });
241
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
290
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
242
291
  import_react_native_webview.WebView,
243
292
  {
244
293
  ref: handler.ref,
@@ -255,9 +304,9 @@ function WebView({ localhostPort = 5173, onMessage, ...props }) {
255
304
 
256
305
  // src/hooks/useGeolocation.ts
257
306
  var import_react2 = require("react");
258
- var import_react_native_bedrock4 = require("react-native-bedrock");
307
+ var import_react_native_bedrock5 = require("react-native-bedrock");
259
308
  function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
260
- const isVisible = (0, import_react_native_bedrock4.useVisibility)();
309
+ const isVisible = (0, import_react_native_bedrock5.useVisibility)();
261
310
  const [location, setLocation] = (0, import_react2.useState)(null);
262
311
  (0, import_react2.useEffect)(() => {
263
312
  if (!isVisible) {
@@ -294,12 +343,15 @@ var Accuracy2 = /* @__PURE__ */ ((Accuracy3) => {
294
343
  // Annotate the CommonJS export names for ESM import in node:
295
344
  0 && (module.exports = {
296
345
  Accuracy,
346
+ AppsInToss,
297
347
  WebView,
348
+ appLogin,
298
349
  env,
299
350
  fetchAlbumPhotos,
300
351
  fetchContacts,
301
352
  getClipboardText,
302
353
  getCurrentLocation,
354
+ getOperationalEnvironment,
303
355
  openCamera,
304
356
  setClipboardText,
305
357
  startUpdateLocation,
package/dist/index.d.cts CHANGED
@@ -1,14 +1,26 @@
1
+ import { ComponentType, PropsWithChildren } from 'react';
2
+ import { InitialProps, BedrockProps } from 'react-native-bedrock';
1
3
  import { EmitterSubscription } from 'react-native';
2
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
5
  import { WebViewProps as WebViewProps$1 } from '@react-native-bedrock/native/react-native-webview';
4
6
 
7
+ type AppsInTossProps = Pick<BedrockProps, 'context'>;
8
+ declare function registerApp(container: ComponentType<PropsWithChildren<InitialProps>>, { context }: AppsInTossProps): (initialProps: InitialProps) => JSX.Element;
9
+
10
+ declare const AppsInToss: {
11
+ registerApp: typeof registerApp;
12
+ };
13
+
5
14
  interface EventEmitterSchema<K extends string, P extends unknown[]> {
6
15
  name: K;
7
16
  params: P;
8
17
  }
9
18
 
10
19
  /**
11
- * 위치 정확도 옵션이에요.
20
+ * @public
21
+ * @category 위치 정보
22
+ * @name Accuracy
23
+ * @description 위치 정확도 옵션이에요.
12
24
  */
13
25
  declare enum Accuracy {
14
26
  /**
@@ -36,6 +48,12 @@ declare enum Accuracy {
36
48
  */
37
49
  BestForNavigation = 6
38
50
  }
51
+ /**
52
+ * @public
53
+ * @category 위치 정보
54
+ * @name Location
55
+ * @description 위치 정보를 나타내는 객체예요.
56
+ */
39
57
  interface Location {
40
58
  /**
41
59
  * Android에서만 지원하는 옵션이에요.
@@ -50,14 +68,42 @@ interface Location {
50
68
  * 위치가 업데이트된 시점의 유닉스 타임스탬프예요.
51
69
  */
52
70
  timestamp: number;
53
- coords: {
54
- latitude: number;
55
- longitude: number;
56
- altitude: number;
57
- accuracy: number;
58
- altitudeAccuracy: number;
59
- heading: number;
60
- };
71
+ /**
72
+ * @description 위치 정보를 나타내는 객체예요. 자세한 내용은 [LocationCoords](/reference/framework/Types/LocationCoords.html)을 참고해주세요.
73
+ */
74
+ coords: LocationCoords;
75
+ }
76
+ /**
77
+ * @public
78
+ * @category 위치 정보
79
+ * @name LocationCoords
80
+ * @description 세부 위치 정보를 나타내는 객체예요.
81
+ */
82
+ interface LocationCoords {
83
+ /**
84
+ * 위도
85
+ */
86
+ latitude: number;
87
+ /**
88
+ * 경도
89
+ */
90
+ longitude: number;
91
+ /**
92
+ * 높이
93
+ */
94
+ altitude: number;
95
+ /**
96
+ * 위치 정확도
97
+ */
98
+ accuracy: number;
99
+ /**
100
+ * 고도 정확도
101
+ */
102
+ altitudeAccuracy: number;
103
+ /**
104
+ * 방향
105
+ */
106
+ heading: number;
61
107
  }
62
108
  /**
63
109
  * 사진 조회 결과를 나타내는 타입이에요.
@@ -97,9 +143,7 @@ interface UpdateLocationEventEmitter extends EventEmitterSchema<'updateLocation'
97
143
  }
98
144
  /**
99
145
  * @public
100
- * @tag AppsInTossModule
101
- * @category AppsInTossModules
102
- * @kind function
146
+ * @category 위치 정보
103
147
  * @name startUpdateLocation
104
148
  * @description 디바이스의 위치 정보를 지속적으로 감지하고, 위치가 변경되면 콜백을 실행하는 함수예요. 콜백 함수를 등록하면 위치가 변경될 때마다 자동으로 호출돼요.
105
149
  * 실시간 위치 추적이 필요한 기능을 구현할 때 사용할 수 있어요. 예를 들어 지도 앱에서 사용자의 현재 위치를 실시간으로 업데이트할 때, 운동 앱에서 사용자의 이동 거리를 기록할 때 등이에요.
@@ -109,7 +153,7 @@ interface UpdateLocationEventEmitter extends EventEmitterSchema<'updateLocation'
109
153
  * @param {number} [options.accuracy] 위치 정확도를 설정해요.
110
154
  * @param {number} [options.timeInterval] 위치 정보를 업데이트하는 최소 주기로, 단위는 밀리초(ms)예요. 이 값은 위치 업데이트가 발생하는 가장 짧은 간격을 설정하지만, 시스템이나 환경의 영향을 받아 지정한 주기보다 더 긴 간격으로 업데이트될 수 있어요.
111
155
  * @param {number} [options.distanceInterval] 위치 변경 거리를 미터(m) 단위로 설정해요.
112
- * @param {(location: Location) => void} [options.callback] 위치 정보가 변경될 때 호출되는 콜백 함수예요.
156
+ * @param {(location: Location) => void} [options.callback] 위치 정보가 변경될 때 호출되는 콜백 함수예요. 자세한 내용은 [Location](/reference/framework/Types/Location.html)을 참고해주세요.
113
157
  *
114
158
  * @example
115
159
  * ### 위치 정보 변경 감지하기
@@ -126,7 +170,7 @@ interface UpdateLocationEventEmitter extends EventEmitterSchema<'updateLocation'
126
170
  * useEffect(() => {
127
171
  * return startUpdateLocation({
128
172
  * options: {
129
- * accuracy: Accuracy.Default,
173
+ * accuracy: Accuracy.Balanced,
130
174
  * timeInterval: 3000,
131
175
  * distanceInterval: 10,
132
176
  * },
@@ -164,9 +208,7 @@ declare function startUpdateLocation(eventParams: {
164
208
 
165
209
  /**
166
210
  * @public
167
- * @tag AppsInTossModule
168
- * @category AppsInTossModules
169
- * @kind function
211
+ * @category 클립보드
170
212
  * @name setClipboardText
171
213
  * @description 텍스트를 클립보드에 복사해서 사용자가 다른 곳에 붙여 넣기 할 수 있어요.
172
214
  * @param {Promise<void>} text - 클립보드에 복사할 텍스트예요. 문자열 형식으로 입력해요.
@@ -197,9 +239,7 @@ declare function setClipboardText(text: string): Promise<void>;
197
239
 
198
240
  /**
199
241
  * @public
200
- * @tag AppsInTossModule
201
- * @category AppsInTossModules
202
- * @kind function
242
+ * @category 클립보드
203
243
  * @name getClipboardText
204
244
  * @description 클립보드에 저장된 텍스트를 가져오는 함수예요. 복사된 텍스트를 읽어서 다른 작업에 활용할 수 있어요.
205
245
  * @returns {Promise<string>} - 클립보드에 저장된 텍스트를 반환해요. 클립보드에 텍스트가 없으면 빈 문자열을 반환해요.
@@ -247,9 +287,7 @@ interface ContactEntity {
247
287
  }
248
288
  /**
249
289
  * @public
250
- * @tag AppsInTossModule
251
- * @category AppsInTossModules
252
- * @kind function
290
+ * @category 연락처
253
291
  * @name fetchContacts
254
292
  * @description 사용자의 연락처 목록을 페이지 단위로 가져오는 함수예요.
255
293
  * @param size - 한 번에 가져올 연락처 개수예요. 예를 들어, 10을 전달하면 최대 10개의 연락처를 가져와요.
@@ -340,9 +378,7 @@ interface FetchAlbumPhotosOptions {
340
378
  }
341
379
  /**
342
380
  * @public
343
- * @tag AppsInTossModule
344
- * @category AppsInTossModules
345
- * @kind function
381
+ * @category 사진
346
382
  * @name fetchAlbumPhotos
347
383
  * @description
348
384
  * 사용자의 앨범에서 사진 목록을 불러오는 함수예요.
@@ -352,7 +388,7 @@ interface FetchAlbumPhotosOptions {
352
388
  * @param {number} [options.maxCount=10] 가져올 사진의 최대 개수를 설정해요. 숫자로 입력하며 기본값은 10이에요.
353
389
  * @param {number} [options.maxWidth=1024] 사진의 최대 폭을 제한해요. 단위는 픽셀이며 기본값은 `1024`이에요.
354
390
  * @param {boolean} [options.base64=false] 이미지를 base64 형식으로 반환할지 설정해요. 기본값은 `false`예요.
355
- * @returns {Promise<AlbumResponse[]>}
391
+ * @returns {Promise<ImageResponse[]>}
356
392
  * 앨범 사진의 고유 ID와 데이터 URI를 포함한 배열을 반환해요.
357
393
  *
358
394
  * @example
@@ -400,9 +436,7 @@ interface GetCurrentLocationOptions {
400
436
  }
401
437
  /**
402
438
  * @public
403
- * @tag AppsInTossModule
404
- * @category AppsInTossModules
405
- * @kind function
439
+ * @category 위치 정보
406
440
  * @name getCurrentLocation
407
441
  * @description 디바이스의 현재 위치 정보를 가져오는 함수예요.
408
442
  * 위치 기반 서비스를 구현할 때 사용되고, 한 번만 호출되어 현재 위치를 즉시 반환해요.
@@ -410,7 +444,7 @@ interface GetCurrentLocationOptions {
410
444
  *
411
445
  * @param {GetCurrentLocationOptions} options 위치 정보를 가져올 때 사용하는 옵션 객체예요.
412
446
  * @param {Accuracy} [options.accuracy] 위치 정보의 정확도 수준이에요. 정확도는 `Accuracy` 타입으로 설정돼요.
413
- * @returns {Promise<Location>} 디바이스의 위치 정보가 담긴 객체를 반환해요.
447
+ * @returns {Promise<Location>} 디바이스의 위치 정보가 담긴 객체를 반환해요. 자세한 내용은 [Location](/reference/framework/Types/Location.html)을 참고해주세요.
414
448
  *
415
449
  * @example
416
450
  * ### 디바이스의 현재 위치 정보 가져오기
@@ -464,9 +498,7 @@ interface OpenCameraOptions {
464
498
  }
465
499
  /**
466
500
  * @public
467
- * @tag AppsInTossModule
468
- * @category AppsInTossModules
469
- * @kind function
501
+ * @category 카메라
470
502
  * @name openCamera
471
503
  * @description 카메라를 실행해서 촬영된 이미지를 반환하는 함수예요.
472
504
  * @param {OpenCameraOptions} options - 카메라 실행 시 사용되는 옵션 객체예요.
@@ -513,17 +545,81 @@ interface OpenCameraOptions {
513
545
  */
514
546
  declare function openCamera(options?: OpenCameraOptions): Promise<ImageResponse>;
515
547
 
548
+ /**
549
+ * @public
550
+ * @category 로그인
551
+ * @name appLogin
552
+ * @description 토스 인증으로 로그인해요. 로그인이 완료되면 다시 토스 앱으로 이동해요.
553
+ * @example
554
+ *
555
+ * ### 토스 인증을 통해 로그인을 하는 예제
556
+ *
557
+ * ```tsx
558
+ * import { Button } from 'react-native';
559
+ * import { appLogin } from '@apps-in-toss/framework';
560
+ *
561
+ * function Page() {
562
+ * const handleLogin = async () => {
563
+ * const { authorizationCode, referrer } = await appLogin();
564
+ *
565
+ * // 획득한 인가 코드(`authorizationCode`)와 `referrer`를 서버로 전달해요.
566
+ * }
567
+ *
568
+ * return <Button title="로그인" onPress={handleLogin} />;
569
+ * }
570
+ * ```
571
+ */
572
+ declare function appLogin(): Promise<{
573
+ authorizationCode: string;
574
+ referrer: "DEFAULT" | "SANDBOX";
575
+ }>;
576
+
577
+ /**
578
+ * @public
579
+ * @category 환경 확인
580
+ * @kind function
581
+ * @name getOperationalEnvironment
582
+ * @description
583
+ * 현재 실행 중인 앱의 운영 환경을 확인해요.
584
+ * 토스 앱에서 실행 중이라면 `'toss'`, 샌드박스 환경에서 실행 중이라면 `'sandbox'`를 반환해요.
585
+ *
586
+ * 운영 환경은 앱이 실행되는 컨텍스트를 의미하며, 특정 기능의 사용 가능 여부를 판단하는 데 활용할 수 있어요.
587
+ *
588
+ * @returns {'toss' | 'sandbox'}
589
+ * 현재 운영 환경을 나타내는 문자열이에요.
590
+ * - `'toss'`: 토스 앱에서 실행 중이에요.
591
+ * - `'sandbox'`: 샌드박스 환경에서 실행 중이에요.
592
+ *
593
+ * @example
594
+ * ### 현재 운영 환경 확인하기
595
+ *
596
+ * ```tsx
597
+ * import { getOperationalEnvironment } from '@apps-in-toss/framework';
598
+ * import { Text } from 'react-native';
599
+ *
600
+ * function EnvironmentInfo() {
601
+ * const environment = getOperationalEnvironment();
602
+ *
603
+ * return (
604
+ * <Text>현재 운영 환경: {environment}</Text>
605
+ * );
606
+ * }
607
+ * ```
608
+ */
609
+ declare function getOperationalEnvironment(): 'toss' | 'sandbox';
610
+
516
611
  interface WebViewProps extends Omit<WebViewProps$1, 'source' | 'sharedCookiesEnabled' | 'thirdPartyCookiesEnabled' | 'injectedJavaScriptBeforeContentLoaded'> {
517
- localhostPort?: number;
612
+ local: {
613
+ port: number;
614
+ host: number;
615
+ };
518
616
  }
519
- declare function WebView({ localhostPort, onMessage, ...props }: WebViewProps): react_jsx_runtime.JSX.Element;
617
+ declare function WebView({ local, onMessage, ...props }: WebViewProps): react_jsx_runtime.JSX.Element;
520
618
 
521
619
  type UseGeolocationOptions = Omit<StartUpdateLocationOptions, 'callback'>;
522
620
  /**
523
621
  * @public
524
- * @tag AppsInTossModule
525
- * @category AppsInTossModules
526
- * @kind function
622
+ * @category 위치 정보
527
623
  * @name useGeolocation
528
624
  * @description 디바이스의 위치 정보를 반환하는 훅이에요. 위치가 변경되면 값도 변경돼요.
529
625
  * GPS 정보를 활용해 현재 위치를 감지하고, 사용자의 이동에 따라 자동으로 업데이트돼요.
@@ -534,6 +630,7 @@ type UseGeolocationOptions = Omit<StartUpdateLocationOptions, 'callback'>;
534
630
  * @param {Accuracy} [options.accuracy] 위치 정확도를 설정해요. `Accuracy.Lowest`: 오차범위 3KM 이내, `Accuracy.Low`: 오차범위 1KM 이내, `Accuracy.Balanced`: 오차범위 몇 백미터 이내, `Accuracy.High`: 오차범위 10M 이내, `Accuracy.Highest`: 가장 높은 정확도, `Accuracy.BestForNavigation`: 네비게이션을 위한 최고 정확도
535
631
  * @param {number} [options.timeInterval] 위치 정보를 업데이트하는 최소 주기로, 단위는 밀리초(ms)예요. 이 값은 위치 업데이트가 발생하는 가장 짧은 간격을 설정하지만, 시스템이나 환경의 영향을 받아 지정한 주기보다 더 긴 간격으로 업데이트될 수 있어요.
536
632
  * @param {number} [options.distanceInterval] 위치 변경 거리를 미터(m) 단위로 설정해요.
633
+ * @returns {Location | null} 디바이스의 위치 정보가 담긴 객체를 반환해요. 자세한 내용은 [Location](/reference/framework/Types/Location.html)을 참고해주세요.
537
634
  *
538
635
  * @example
539
636
  * ### 위치 정보 변경 감지하기
@@ -569,4 +666,4 @@ declare const env: {
569
666
  getDeploymentId: () => string | undefined;
570
667
  };
571
668
 
572
- export { Accuracy, type ContactEntity, type FetchAlbumPhotosOptions, type GetCurrentLocationOptions, type ImageResponse, type Location, type OpenCameraOptions, type StartUpdateLocationOptions, type StartUpdateLocationSubscription, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, env, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, openCamera, setClipboardText, startUpdateLocation, useGeolocation };
669
+ export { Accuracy, AppsInToss, type ContactEntity, type FetchAlbumPhotosOptions, type GetCurrentLocationOptions, type ImageResponse, type Location, type LocationCoords, type OpenCameraOptions, type StartUpdateLocationOptions, type StartUpdateLocationSubscription, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, appLogin, env, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, getOperationalEnvironment, openCamera, setClipboardText, startUpdateLocation, useGeolocation };