@apps-in-toss/framework 0.0.9 → 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.
@@ -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
@@ -39,6 +39,7 @@ __export(src_exports, {
39
39
  fetchContacts: () => fetchContacts,
40
40
  getClipboardText: () => getClipboardText,
41
41
  getCurrentLocation: () => getCurrentLocation,
42
+ getOperationalEnvironment: () => getOperationalEnvironment,
42
43
  openCamera: () => openCamera,
43
44
  setClipboardText: () => setClipboardText,
44
45
  startUpdateLocation: () => startUpdateLocation,
@@ -159,6 +160,7 @@ __export(native_modules_exports, {
159
160
  fetchContacts: () => fetchContacts,
160
161
  getClipboardText: () => getClipboardText,
161
162
  getCurrentLocation: () => getCurrentLocation,
163
+ getOperationalEnvironment: () => getOperationalEnvironment,
162
164
  openCamera: () => openCamera,
163
165
  setClipboardText: () => setClipboardText
164
166
  });
@@ -252,6 +254,11 @@ async function appLogin() {
252
254
  return AppsInTossModule.appLogin({});
253
255
  }
254
256
 
257
+ // src/native-modules/getOperationalEnvironment.ts
258
+ function getOperationalEnvironment() {
259
+ return AppsInTossModule.operationalEnvironment;
260
+ }
261
+
255
262
  // src/components/WebView.tsx
256
263
  var import_react_native_webview = require("@react-native-bedrock/native/react-native-webview");
257
264
  var import_react = require("react");
@@ -259,13 +266,13 @@ var import_react_native_bedrock4 = require("react-native-bedrock");
259
266
  var bridges = __toESM(require("react-native-bedrock/bridges"), 1);
260
267
  var constantBridges = __toESM(require("react-native-bedrock/constants"), 1);
261
268
  var import_jsx_runtime2 = require("react/jsx-runtime");
262
- function WebView({ localhostPort = 5173, onMessage, ...props }) {
269
+ function WebView({ local, onMessage, ...props }) {
263
270
  const uri = (0, import_react.useMemo)(() => {
264
271
  if (__DEV__) {
265
- return `http://localhost:${localhostPort}`;
272
+ return `http://${local.host}:${local.port}`;
266
273
  }
267
274
  return AppsInTossModule.getWebBundleURL({}).url;
268
- }, [localhostPort]);
275
+ }, [local]);
269
276
  const handler = (0, import_react_native_bedrock4.useBridgeHandler)({
270
277
  onMessage,
271
278
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -344,6 +351,7 @@ var Accuracy2 = /* @__PURE__ */ ((Accuracy3) => {
344
351
  fetchContacts,
345
352
  getClipboardText,
346
353
  getCurrentLocation,
354
+ getOperationalEnvironment,
347
355
  openCamera,
348
356
  setClipboardText,
349
357
  startUpdateLocation,
package/dist/index.d.cts CHANGED
@@ -18,7 +18,7 @@ interface EventEmitterSchema<K extends string, P extends unknown[]> {
18
18
 
19
19
  /**
20
20
  * @public
21
- * @category Types
21
+ * @category 위치 정보
22
22
  * @name Accuracy
23
23
  * @description 위치 정확도 옵션이에요.
24
24
  */
@@ -50,7 +50,7 @@ declare enum Accuracy {
50
50
  }
51
51
  /**
52
52
  * @public
53
- * @category Types
53
+ * @category 위치 정보
54
54
  * @name Location
55
55
  * @description 위치 정보를 나타내는 객체예요.
56
56
  */
@@ -75,7 +75,7 @@ interface Location {
75
75
  }
76
76
  /**
77
77
  * @public
78
- * @category Types
78
+ * @category 위치 정보
79
79
  * @name LocationCoords
80
80
  * @description 세부 위치 정보를 나타내는 객체예요.
81
81
  */
@@ -143,9 +143,7 @@ interface UpdateLocationEventEmitter extends EventEmitterSchema<'updateLocation'
143
143
  }
144
144
  /**
145
145
  * @public
146
- * @tag AppsInTossModule
147
- * @category AppsInTossModules
148
- * @kind function
146
+ * @category 위치 정보
149
147
  * @name startUpdateLocation
150
148
  * @description 디바이스의 위치 정보를 지속적으로 감지하고, 위치가 변경되면 콜백을 실행하는 함수예요. 콜백 함수를 등록하면 위치가 변경될 때마다 자동으로 호출돼요.
151
149
  * 실시간 위치 추적이 필요한 기능을 구현할 때 사용할 수 있어요. 예를 들어 지도 앱에서 사용자의 현재 위치를 실시간으로 업데이트할 때, 운동 앱에서 사용자의 이동 거리를 기록할 때 등이에요.
@@ -210,9 +208,7 @@ declare function startUpdateLocation(eventParams: {
210
208
 
211
209
  /**
212
210
  * @public
213
- * @tag AppsInTossModule
214
- * @category AppsInTossModules
215
- * @kind function
211
+ * @category 클립보드
216
212
  * @name setClipboardText
217
213
  * @description 텍스트를 클립보드에 복사해서 사용자가 다른 곳에 붙여 넣기 할 수 있어요.
218
214
  * @param {Promise<void>} text - 클립보드에 복사할 텍스트예요. 문자열 형식으로 입력해요.
@@ -243,9 +239,7 @@ declare function setClipboardText(text: string): Promise<void>;
243
239
 
244
240
  /**
245
241
  * @public
246
- * @tag AppsInTossModule
247
- * @category AppsInTossModules
248
- * @kind function
242
+ * @category 클립보드
249
243
  * @name getClipboardText
250
244
  * @description 클립보드에 저장된 텍스트를 가져오는 함수예요. 복사된 텍스트를 읽어서 다른 작업에 활용할 수 있어요.
251
245
  * @returns {Promise<string>} - 클립보드에 저장된 텍스트를 반환해요. 클립보드에 텍스트가 없으면 빈 문자열을 반환해요.
@@ -293,9 +287,7 @@ interface ContactEntity {
293
287
  }
294
288
  /**
295
289
  * @public
296
- * @tag AppsInTossModule
297
- * @category AppsInTossModules
298
- * @kind function
290
+ * @category 연락처
299
291
  * @name fetchContacts
300
292
  * @description 사용자의 연락처 목록을 페이지 단위로 가져오는 함수예요.
301
293
  * @param size - 한 번에 가져올 연락처 개수예요. 예를 들어, 10을 전달하면 최대 10개의 연락처를 가져와요.
@@ -386,9 +378,7 @@ interface FetchAlbumPhotosOptions {
386
378
  }
387
379
  /**
388
380
  * @public
389
- * @tag AppsInTossModule
390
- * @category AppsInTossModules
391
- * @kind function
381
+ * @category 사진
392
382
  * @name fetchAlbumPhotos
393
383
  * @description
394
384
  * 사용자의 앨범에서 사진 목록을 불러오는 함수예요.
@@ -446,9 +436,7 @@ interface GetCurrentLocationOptions {
446
436
  }
447
437
  /**
448
438
  * @public
449
- * @tag AppsInTossModule
450
- * @category AppsInTossModules
451
- * @kind function
439
+ * @category 위치 정보
452
440
  * @name getCurrentLocation
453
441
  * @description 디바이스의 현재 위치 정보를 가져오는 함수예요.
454
442
  * 위치 기반 서비스를 구현할 때 사용되고, 한 번만 호출되어 현재 위치를 즉시 반환해요.
@@ -510,9 +498,7 @@ interface OpenCameraOptions {
510
498
  }
511
499
  /**
512
500
  * @public
513
- * @tag AppsInTossModule
514
- * @category AppsInTossModules
515
- * @kind function
501
+ * @category 카메라
516
502
  * @name openCamera
517
503
  * @description 카메라를 실행해서 촬영된 이미지를 반환하는 함수예요.
518
504
  * @param {OpenCameraOptions} options - 카메라 실행 시 사용되는 옵션 객체예요.
@@ -561,9 +547,7 @@ declare function openCamera(options?: OpenCameraOptions): Promise<ImageResponse>
561
547
 
562
548
  /**
563
549
  * @public
564
- * @tag AppsInTossModule
565
- * @category AppsInTossModules
566
- * @kind function
550
+ * @category 로그인
567
551
  * @name appLogin
568
552
  * @description 토스 인증으로 로그인해요. 로그인이 완료되면 다시 토스 앱으로 이동해요.
569
553
  * @example
@@ -576,9 +560,9 @@ declare function openCamera(options?: OpenCameraOptions): Promise<ImageResponse>
576
560
  *
577
561
  * function Page() {
578
562
  * const handleLogin = async () => {
579
- * const { authorizationCode } = await appLogin();
563
+ * const { authorizationCode, referrer } = await appLogin();
580
564
  *
581
- * // 획득한 인가 코드(`authorizationCode`) 서버로 전달해요.
565
+ * // 획득한 인가 코드(`authorizationCode`) `referrer`를 서버로 전달해요.
582
566
  * }
583
567
  *
584
568
  * return <Button title="로그인" onPress={handleLogin} />;
@@ -587,19 +571,55 @@ declare function openCamera(options?: OpenCameraOptions): Promise<ImageResponse>
587
571
  */
588
572
  declare function appLogin(): Promise<{
589
573
  authorizationCode: string;
574
+ referrer: "DEFAULT" | "SANDBOX";
590
575
  }>;
591
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
+
592
611
  interface WebViewProps extends Omit<WebViewProps$1, 'source' | 'sharedCookiesEnabled' | 'thirdPartyCookiesEnabled' | 'injectedJavaScriptBeforeContentLoaded'> {
593
- localhostPort?: number;
612
+ local: {
613
+ port: number;
614
+ host: number;
615
+ };
594
616
  }
595
- 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;
596
618
 
597
619
  type UseGeolocationOptions = Omit<StartUpdateLocationOptions, 'callback'>;
598
620
  /**
599
621
  * @public
600
- * @tag AppsInTossModule
601
- * @category AppsInTossModules
602
- * @kind function
622
+ * @category 위치 정보
603
623
  * @name useGeolocation
604
624
  * @description 디바이스의 위치 정보를 반환하는 훅이에요. 위치가 변경되면 값도 변경돼요.
605
625
  * GPS 정보를 활용해 현재 위치를 감지하고, 사용자의 이동에 따라 자동으로 업데이트돼요.
@@ -646,4 +666,4 @@ declare const env: {
646
666
  getDeploymentId: () => string | undefined;
647
667
  };
648
668
 
649
- 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, 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 };
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@ interface EventEmitterSchema<K extends string, P extends unknown[]> {
18
18
 
19
19
  /**
20
20
  * @public
21
- * @category Types
21
+ * @category 위치 정보
22
22
  * @name Accuracy
23
23
  * @description 위치 정확도 옵션이에요.
24
24
  */
@@ -50,7 +50,7 @@ declare enum Accuracy {
50
50
  }
51
51
  /**
52
52
  * @public
53
- * @category Types
53
+ * @category 위치 정보
54
54
  * @name Location
55
55
  * @description 위치 정보를 나타내는 객체예요.
56
56
  */
@@ -75,7 +75,7 @@ interface Location {
75
75
  }
76
76
  /**
77
77
  * @public
78
- * @category Types
78
+ * @category 위치 정보
79
79
  * @name LocationCoords
80
80
  * @description 세부 위치 정보를 나타내는 객체예요.
81
81
  */
@@ -143,9 +143,7 @@ interface UpdateLocationEventEmitter extends EventEmitterSchema<'updateLocation'
143
143
  }
144
144
  /**
145
145
  * @public
146
- * @tag AppsInTossModule
147
- * @category AppsInTossModules
148
- * @kind function
146
+ * @category 위치 정보
149
147
  * @name startUpdateLocation
150
148
  * @description 디바이스의 위치 정보를 지속적으로 감지하고, 위치가 변경되면 콜백을 실행하는 함수예요. 콜백 함수를 등록하면 위치가 변경될 때마다 자동으로 호출돼요.
151
149
  * 실시간 위치 추적이 필요한 기능을 구현할 때 사용할 수 있어요. 예를 들어 지도 앱에서 사용자의 현재 위치를 실시간으로 업데이트할 때, 운동 앱에서 사용자의 이동 거리를 기록할 때 등이에요.
@@ -210,9 +208,7 @@ declare function startUpdateLocation(eventParams: {
210
208
 
211
209
  /**
212
210
  * @public
213
- * @tag AppsInTossModule
214
- * @category AppsInTossModules
215
- * @kind function
211
+ * @category 클립보드
216
212
  * @name setClipboardText
217
213
  * @description 텍스트를 클립보드에 복사해서 사용자가 다른 곳에 붙여 넣기 할 수 있어요.
218
214
  * @param {Promise<void>} text - 클립보드에 복사할 텍스트예요. 문자열 형식으로 입력해요.
@@ -243,9 +239,7 @@ declare function setClipboardText(text: string): Promise<void>;
243
239
 
244
240
  /**
245
241
  * @public
246
- * @tag AppsInTossModule
247
- * @category AppsInTossModules
248
- * @kind function
242
+ * @category 클립보드
249
243
  * @name getClipboardText
250
244
  * @description 클립보드에 저장된 텍스트를 가져오는 함수예요. 복사된 텍스트를 읽어서 다른 작업에 활용할 수 있어요.
251
245
  * @returns {Promise<string>} - 클립보드에 저장된 텍스트를 반환해요. 클립보드에 텍스트가 없으면 빈 문자열을 반환해요.
@@ -293,9 +287,7 @@ interface ContactEntity {
293
287
  }
294
288
  /**
295
289
  * @public
296
- * @tag AppsInTossModule
297
- * @category AppsInTossModules
298
- * @kind function
290
+ * @category 연락처
299
291
  * @name fetchContacts
300
292
  * @description 사용자의 연락처 목록을 페이지 단위로 가져오는 함수예요.
301
293
  * @param size - 한 번에 가져올 연락처 개수예요. 예를 들어, 10을 전달하면 최대 10개의 연락처를 가져와요.
@@ -386,9 +378,7 @@ interface FetchAlbumPhotosOptions {
386
378
  }
387
379
  /**
388
380
  * @public
389
- * @tag AppsInTossModule
390
- * @category AppsInTossModules
391
- * @kind function
381
+ * @category 사진
392
382
  * @name fetchAlbumPhotos
393
383
  * @description
394
384
  * 사용자의 앨범에서 사진 목록을 불러오는 함수예요.
@@ -446,9 +436,7 @@ interface GetCurrentLocationOptions {
446
436
  }
447
437
  /**
448
438
  * @public
449
- * @tag AppsInTossModule
450
- * @category AppsInTossModules
451
- * @kind function
439
+ * @category 위치 정보
452
440
  * @name getCurrentLocation
453
441
  * @description 디바이스의 현재 위치 정보를 가져오는 함수예요.
454
442
  * 위치 기반 서비스를 구현할 때 사용되고, 한 번만 호출되어 현재 위치를 즉시 반환해요.
@@ -510,9 +498,7 @@ interface OpenCameraOptions {
510
498
  }
511
499
  /**
512
500
  * @public
513
- * @tag AppsInTossModule
514
- * @category AppsInTossModules
515
- * @kind function
501
+ * @category 카메라
516
502
  * @name openCamera
517
503
  * @description 카메라를 실행해서 촬영된 이미지를 반환하는 함수예요.
518
504
  * @param {OpenCameraOptions} options - 카메라 실행 시 사용되는 옵션 객체예요.
@@ -561,9 +547,7 @@ declare function openCamera(options?: OpenCameraOptions): Promise<ImageResponse>
561
547
 
562
548
  /**
563
549
  * @public
564
- * @tag AppsInTossModule
565
- * @category AppsInTossModules
566
- * @kind function
550
+ * @category 로그인
567
551
  * @name appLogin
568
552
  * @description 토스 인증으로 로그인해요. 로그인이 완료되면 다시 토스 앱으로 이동해요.
569
553
  * @example
@@ -576,9 +560,9 @@ declare function openCamera(options?: OpenCameraOptions): Promise<ImageResponse>
576
560
  *
577
561
  * function Page() {
578
562
  * const handleLogin = async () => {
579
- * const { authorizationCode } = await appLogin();
563
+ * const { authorizationCode, referrer } = await appLogin();
580
564
  *
581
- * // 획득한 인가 코드(`authorizationCode`) 서버로 전달해요.
565
+ * // 획득한 인가 코드(`authorizationCode`) `referrer`를 서버로 전달해요.
582
566
  * }
583
567
  *
584
568
  * return <Button title="로그인" onPress={handleLogin} />;
@@ -587,19 +571,55 @@ declare function openCamera(options?: OpenCameraOptions): Promise<ImageResponse>
587
571
  */
588
572
  declare function appLogin(): Promise<{
589
573
  authorizationCode: string;
574
+ referrer: "DEFAULT" | "SANDBOX";
590
575
  }>;
591
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
+
592
611
  interface WebViewProps extends Omit<WebViewProps$1, 'source' | 'sharedCookiesEnabled' | 'thirdPartyCookiesEnabled' | 'injectedJavaScriptBeforeContentLoaded'> {
593
- localhostPort?: number;
612
+ local: {
613
+ port: number;
614
+ host: number;
615
+ };
594
616
  }
595
- 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;
596
618
 
597
619
  type UseGeolocationOptions = Omit<StartUpdateLocationOptions, 'callback'>;
598
620
  /**
599
621
  * @public
600
- * @tag AppsInTossModule
601
- * @category AppsInTossModules
602
- * @kind function
622
+ * @category 위치 정보
603
623
  * @name useGeolocation
604
624
  * @description 디바이스의 위치 정보를 반환하는 훅이에요. 위치가 변경되면 값도 변경돼요.
605
625
  * GPS 정보를 활용해 현재 위치를 감지하고, 사용자의 이동에 따라 자동으로 업데이트돼요.
@@ -646,4 +666,4 @@ declare const env: {
646
666
  getDeploymentId: () => string | undefined;
647
667
  };
648
668
 
649
- 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, 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 };
package/dist/index.js CHANGED
@@ -117,6 +117,7 @@ __export(native_modules_exports, {
117
117
  fetchContacts: () => fetchContacts,
118
118
  getClipboardText: () => getClipboardText,
119
119
  getCurrentLocation: () => getCurrentLocation,
120
+ getOperationalEnvironment: () => getOperationalEnvironment,
120
121
  openCamera: () => openCamera,
121
122
  setClipboardText: () => setClipboardText
122
123
  });
@@ -210,6 +211,11 @@ async function appLogin() {
210
211
  return AppsInTossModule.appLogin({});
211
212
  }
212
213
 
214
+ // src/native-modules/getOperationalEnvironment.ts
215
+ function getOperationalEnvironment() {
216
+ return AppsInTossModule.operationalEnvironment;
217
+ }
218
+
213
219
  // src/components/WebView.tsx
214
220
  import {
215
221
  WebView as OriginalWebView
@@ -219,13 +225,13 @@ import { useBridgeHandler } from "react-native-bedrock";
219
225
  import * as bridges from "react-native-bedrock/bridges";
220
226
  import * as constantBridges from "react-native-bedrock/constants";
221
227
  import { jsx as jsx2 } from "react/jsx-runtime";
222
- function WebView({ localhostPort = 5173, onMessage, ...props }) {
228
+ function WebView({ local, onMessage, ...props }) {
223
229
  const uri = useMemo(() => {
224
230
  if (__DEV__) {
225
- return `http://localhost:${localhostPort}`;
231
+ return `http://${local.host}:${local.port}`;
226
232
  }
227
233
  return AppsInTossModule.getWebBundleURL({}).url;
228
- }, [localhostPort]);
234
+ }, [local]);
229
235
  const handler = useBridgeHandler({
230
236
  onMessage,
231
237
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -303,6 +309,7 @@ export {
303
309
  fetchContacts,
304
310
  getClipboardText,
305
311
  getCurrentLocation,
312
+ getOperationalEnvironment,
306
313
  openCamera,
307
314
  setClipboardText,
308
315
  startUpdateLocation,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apps-in-toss/framework",
3
3
  "type": "module",
4
- "version": "0.0.9",
4
+ "version": "0.0.10",
5
5
  "description": "The framework for Apps In Toss",
6
6
  "scripts": {
7
7
  "prepack": "yarn build",
@@ -45,7 +45,7 @@
45
45
  "ait": "./bin/ait.js"
46
46
  },
47
47
  "dependencies": {
48
- "@apps-in-toss/cli": "0.0.9"
48
+ "@apps-in-toss/cli": "0.0.10"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@react-native-bedrock/mpack-next": "0.0.12",
@@ -80,5 +80,5 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "98757e13199b7802d8d2a31ce2249d6727c12dcd"
83
+ "gitHead": "b5d671eb92caf922f31f73836dbb4b409a563e8a"
84
84
  }