@apps-in-toss/web-bridge 0.0.0-dev.1747216176095 → 0.0.0-dev.1752049503789

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.
Files changed (34) hide show
  1. package/built/bridge.d.ts +27 -0
  2. package/built/bridge.js +1 -0
  3. package/{build → built}/closeView.d.ts +1 -1
  4. package/{build → built}/fetchContacts.d.ts +20 -22
  5. package/{build → built}/generateHapticFeedback.d.ts +2 -2
  6. package/{build → built}/getCurrentLocation.d.ts +2 -8
  7. package/{build → built}/getLocale.d.ts +1 -1
  8. package/{build → built}/getNetworkStatus.d.ts +1 -1
  9. package/{build → built}/getPlatformOS.d.ts +1 -1
  10. package/{build → built}/getSchemeUri.d.ts +1 -1
  11. package/{build → built}/index.d.ts +12 -12
  12. package/{build → built}/index.js +16 -10
  13. package/{build → built}/openURL.d.ts +1 -1
  14. package/built/saveBase64Data.d.ts +43 -0
  15. package/built/setDeviceOrientation.d.ts +65 -0
  16. package/{build → built}/setIosSwipeGestureEnabled.d.ts +1 -1
  17. package/{build → built}/setScreenAwakeMode.d.ts +2 -2
  18. package/{build → built}/setSecureScreen.d.ts +1 -1
  19. package/{build → built}/share.d.ts +1 -1
  20. package/{build → built}/startUpdateLocation.d.ts +3 -9
  21. package/package.json +15 -15
  22. package/build/bridge.d.ts +0 -25
  23. package/build/bridge.js +0 -1
  24. /package/{build → built}/appLogin.d.ts +0 -0
  25. /package/{build → built}/checkoutPayment.d.ts +0 -0
  26. /package/{build → built}/eventLog.d.ts +0 -0
  27. /package/{build → built}/fetchAlbumPhotos.d.ts +0 -0
  28. /package/{build → built}/getClipboardText.d.ts +0 -0
  29. /package/{build → built}/getDeviceId.d.ts +0 -0
  30. /package/{build → built}/getOperationalEnvironment.d.ts +0 -0
  31. /package/{build → built}/getTossAppVersion.d.ts +0 -0
  32. /package/{build → built}/getTossShareLink.d.ts +0 -0
  33. /package/{build → built}/openCamera.d.ts +0 -0
  34. /package/{build → built}/setClipboardText.d.ts +0 -0
@@ -0,0 +1,27 @@
1
+ export * from './closeView';
2
+ export * from './generateHapticFeedback';
3
+ export * from './share';
4
+ export * from './setSecureScreen';
5
+ export * from './setScreenAwakeMode';
6
+ export * from './getNetworkStatus';
7
+ export * from './setIosSwipeGestureEnabled';
8
+ export * from './openURL';
9
+ export * from './setClipboardText';
10
+ export * from './getClipboardText';
11
+ export * from './fetchContacts';
12
+ export * from './fetchAlbumPhotos';
13
+ export * from './getCurrentLocation';
14
+ export * from './openCamera';
15
+ export * from './appLogin';
16
+ export * from './eventLog';
17
+ export * from './getTossShareLink';
18
+ export * from './setDeviceOrientation';
19
+ export * from './checkoutPayment';
20
+ export * from './saveBase64Data';
21
+ export * from './getLocale';
22
+ export * from './getSchemeUri';
23
+ export * from './getPlatformOS';
24
+ export * from './getOperationalEnvironment';
25
+ export * from './getTossAppVersion';
26
+ export * from './getDeviceId';
27
+ export * from './startUpdateLocation';
@@ -0,0 +1 @@
1
+ import{createAsyncBridge,createConstantBridge,createEventBridge}from"@apps-in-toss/bridge-core";var createEvents=function(){return{emit:function emit(event,args){for(var callbacks=this.events[event]||[],i=0,length=callbacks.length;i<length;i++){callbacks[i](args)}},events:{},on:function on(event,cb){var _this=this;var _this_events,_event;((_this_events=this.events)[_event=event]||(_this_events[_event]=[])).push(cb);return function(){var _this_events_event;_this.events[event]=(_this_events_event=_this.events[event])===null||_this_events_event===void 0?void 0:_this_events_event.filter(function(i){return cb!==i})}}}};if(typeof window!=="undefined"){window.__GRANITE_NATIVE_EMITTER=createEvents()}export var closeView=createAsyncBridge("closeView");export var generateHapticFeedback=createAsyncBridge("generateHapticFeedback");export var share=createAsyncBridge("share");export var setSecureScreen=createAsyncBridge("setSecureScreen");export var setScreenAwakeMode=createAsyncBridge("setScreenAwakeMode");export var getNetworkStatus=createAsyncBridge("getNetworkStatus");export var setIosSwipeGestureEnabled=createAsyncBridge("setIosSwipeGestureEnabled");export var openURL=createAsyncBridge("openURL");export var setClipboardText=createAsyncBridge("setClipboardText");export var getClipboardText=createAsyncBridge("getClipboardText");export var fetchContacts=createAsyncBridge("fetchContacts");export var fetchAlbumPhotos=createAsyncBridge("fetchAlbumPhotos");export var Accuracy=function(Accuracy){Accuracy[Accuracy["Lowest"]=1]="Lowest";Accuracy[Accuracy["Low"]=2]="Low";Accuracy[Accuracy["Balanced"]=3]="Balanced";Accuracy[Accuracy["High"]=4]="High";Accuracy[Accuracy["Highest"]=5]="Highest";Accuracy[Accuracy["BestForNavigation"]=6]="BestForNavigation";return Accuracy}({});export var getCurrentLocation=createAsyncBridge("getCurrentLocation");export var openCamera=createAsyncBridge("openCamera");export var appLogin=createAsyncBridge("appLogin");export var eventLog=createAsyncBridge("eventLog");export var getTossShareLink=createAsyncBridge("getTossShareLink");export var setDeviceOrientation=createAsyncBridge("setDeviceOrientation");export var checkoutPayment=createAsyncBridge("checkoutPayment");export var saveBase64Data=createAsyncBridge("saveBase64Data");export var getLocale=createConstantBridge("getLocale");export var getSchemeUri=createConstantBridge("getSchemeUri");export var getPlatformOS=createConstantBridge("getPlatformOS");export var getOperationalEnvironment=createConstantBridge("getOperationalEnvironment");export var getTossAppVersion=createConstantBridge("getTossAppVersion");export var getDeviceId=createConstantBridge("getDeviceId");export var startUpdateLocation=createEventBridge("startUpdateLocation");
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * ```tsx
13
13
  *
14
- * import { closeView } from '@apps-in-toss/web-framework';
14
+ * import { closeView } from 'react-native-bedrock';
15
15
  *
16
16
  * function CloseButton() {
17
17
  * return <input type="button" value="닫기" onClick={closeView} />;
@@ -7,16 +7,22 @@ export interface ContactEntity {
7
7
  /** 연락처 전화번호로, 문자열 형식이에요. */
8
8
  phoneNumber: string;
9
9
  }
10
+ export interface ContactResult {
11
+ result: ContactEntity[];
12
+ nextOffset: number | null;
13
+ done: boolean;
14
+ }
10
15
  /**
11
16
  * @public
12
17
  * @category 연락처
13
18
  * @name fetchContacts
14
19
  * @description 사용자의 연락처 목록을 페이지 단위로 가져오는 함수예요.
15
- * @param size - 번에 가져올 연락처 개수예요. 예를 들어, 10을 전달하면 최대 10개의 연락처를 가져와요.
16
- * @param offset - 가져올 연락처의 시작 지점이에요. 처음 호출할 때는 `0`을 전달해야 해요. 이후에는 이전 호출에서 반환된 `nextOffset` 값을 사용해요.
17
- * @param query - 추가적인 필터링 옵션이에요.
18
- * @param query.contains - 이름에 특정 문자열이 포함된 연락처만 가져오고 싶을 때 사용해요. 이 값을 전달하지 않으면 모든 연락처를 가져와요.
19
- * @returns {Promise<{result: { name: string; phoneNumber: string }[]; nextOffset: number | null; done: boolean}>}
20
+ * @param options - 연락처를 가져올 지정하는 옵션 객체예요.
21
+ * @param options.size - 번에 가져올 연락처 개수예요. 예를 들어, 10을 전달하면 최대 10개의 연락처를 가져와요.
22
+ * @param options.offset - 가져올 연락처의 시작 지점이에요. 처음 호출할 때는 `0`을 전달해야 해요. 이후에는 이전 호출에서 반환된 `nextOffset` 값을 사용해요.
23
+ * @param options.query - 추가적인 필터링 옵션이에요.
24
+ * @param options.query.contains - 이름에 특정 문자열이 포함된 연락처만 가져오고 싶을 사용해요. 값을 전달하지 않으면 모든 연락처를 가져와요.
25
+ * @returns {Promise<ContactResult>}
20
26
  * 연락처 목록과 페이지네이션 정보를 포함한 객체를 반환해요.
21
27
  * - `result`: 가져온 연락처 목록이에요.
22
28
  * - `nextOffset`: 다음 호출에 사용할 오프셋 값이에요. 더 가져올 연락처가 없으면 `null`이에요.
@@ -24,17 +30,13 @@ export interface ContactEntity {
24
30
  *
25
31
  * @signature
26
32
  * ```typescript
27
- * function fetchContacts({ size, offset, query }: {
28
- * size: number;
29
- * offset: number;
30
- * query?: {
31
- * contains?: string;
32
- * };
33
- * }): Promise<{
34
- * result: ContactEntity[];
35
- * nextOffset: number | null;
36
- * done: boolean;
37
- * }>;
33
+ * function fetchContacts(options: {
34
+ * size: number;
35
+ * offset: number;
36
+ * query?: {
37
+ * contains?: string;
38
+ * };
39
+ * }): Promise<ContactResult>;
38
40
  * ```
39
41
  *
40
42
  * @example
@@ -94,16 +96,12 @@ export interface ContactEntity {
94
96
  * }
95
97
  * ```
96
98
  */
97
- export declare function fetchContacts({ size, offset, query, }: {
99
+ export declare function fetchContacts(options: {
98
100
  size: number;
99
101
  offset: number;
100
102
  query?: {
101
103
  contains?: string;
102
104
  };
103
- }): Promise<{
104
- result: ContactEntity[];
105
- nextOffset: number | null;
106
- done: boolean;
107
- }>;
105
+ }): Promise<ContactResult>;
108
106
 
109
107
  export {};
@@ -29,7 +29,7 @@ export interface HapticFeedbackOptions {
29
29
  * @public
30
30
  * @category 인터렉션
31
31
  * @name generateHapticFeedback
32
- * @description 디바이스에 햅틱 진동을 일으키는 함수예요. 예를 들어, 버튼 터치나 화면전환에 드라마틱한 효과를 주고 싶을 때 사용할 수 있어요. [HapticFeedbackOptions](/react-native/reference/@apps-in-toss/web-framework/인터렉션/HapticFeedbackOptions.html)에서 진동타입을 확인해 보세요.
32
+ * @description 디바이스에 햅틱 진동을 일으키는 함수예요. 예를 들어, 버튼 터치나 화면전환에 드라마틱한 효과를 주고 싶을 때 사용할 수 있어요. [HapticFeedbackOptions](/react-native/reference/native-modules/인터렉션/HapticFeedbackOptions.html)에서 진동타입을 확인해 보세요.
33
33
  * @returns {void}
34
34
  *
35
35
  * @example
@@ -37,7 +37,7 @@ export interface HapticFeedbackOptions {
37
37
  *
38
38
  * ```tsx
39
39
  *
40
- * import { generateHapticFeedback } from '@apps-in-toss/web-framework';
40
+ * import { generateHapticFeedback } from 'react-native-bedrock';
41
41
  *
42
42
  * function GenerateHapticFeedback() {
43
43
  * return <input type="button" value="햅틱" onClick={() => { generateHapticFeedback( { type: "tickWeak"}) }} />;
@@ -30,13 +30,7 @@ export declare enum Accuracy {
30
30
  */
31
31
  BestForNavigation = 6
32
32
  }
33
- /**
34
- * @public
35
- * @category 위치 정보
36
- * @name Location
37
- * @description 위치 정보를 나타내는 객체예요.
38
- */
39
- export interface Location {
33
+ interface Location$1 {
40
34
  /**
41
35
  * Android에서만 지원하는 옵션이에요.
42
36
  *
@@ -139,6 +133,6 @@ export interface GetCurrentLocationOptions {
139
133
  * }
140
134
  * ```
141
135
  */
142
- export declare function getCurrentLocation(options: GetCurrentLocationOptions): Promise<Location>;
136
+ export declare function getCurrentLocation(options: GetCurrentLocationOptions): Promise<Location$1>;
143
137
 
144
138
  export {};
@@ -12,7 +12,7 @@
12
12
  * ### 현재 사용자의 로케일 정보 가져오기
13
13
  *
14
14
  * ```tsx
15
- * import { getLocale } from '@apps-in-toss/web-framework';
15
+ * import { getLocale } from 'react-native-bedrock';
16
16
  *
17
17
  *
18
18
  * function MyPage() {
@@ -27,7 +27,7 @@ export type NetworkStatus = "OFFLINE" | "WIFI" | "2G" | "3G" | "4G" | "5G" | "WW
27
27
  * ```tsx
28
28
  * import { useState, useEffect } from 'react';
29
29
  *
30
- * import { getNetworkStatus, NetworkStatus } from '@apps-in-toss/web-framework';
30
+ * import { getNetworkStatus, NetworkStatus } from 'react-native-bedrock';
31
31
  *
32
32
  * function GetNetworkStatus() {
33
33
  * const [status, setStatus] = useState<NetworkStatus | ''>('');
@@ -20,7 +20,7 @@
20
20
  * ### 현재 실행중인 OS 플랫폼 확인하기
21
21
  *
22
22
  * ```tsx
23
- * import { getPlatformOS } from '@apps-in-toss/web-framework';
23
+ * import { getPlatformOS } from 'react-native-bedrock';
24
24
  * import { Text } 'react-native';
25
25
  *
26
26
  * function Page() {
@@ -10,7 +10,7 @@
10
10
  * ### 처음 진입한 스킴 값 가져오기
11
11
  *
12
12
  * ```tsx
13
- * import { getSchemeUri } from '@apps-in-toss/web-framework';
13
+ * import { getSchemeUri } from 'react-native-bedrock';
14
14
  *
15
15
  *
16
16
  * function MyPage() {
@@ -1,6 +1,6 @@
1
1
  export * from './bridge.js';
2
2
  export * from '@apps-in-toss/bridge-core';
3
- import { LoadAdMobInterstitialAdOptions, ShowAdMobInterstitialAdOptions, LoadAdMobRewardedAdOptions, ShowAdMobRewardedAdOptions } from '@apps-in-toss/framework';
3
+ import { LoadAdMobInterstitialAdEvent, LoadAdMobInterstitialAdOptions, ShowAdMobInterstitialAdEvent, ShowAdMobInterstitialAdOptions, LoadAdMobRewardedAdEvent, LoadAdMobRewardedAdOptions, ShowAdMobRewardedAdEvent, ShowAdMobRewardedAdOptions } from '@apps-in-toss/framework';
4
4
 
5
5
  /**
6
6
  * @public
@@ -163,7 +163,7 @@ declare const GoogleAdMob: {
163
163
  * ```
164
164
  */
165
165
  loadAdMobInterstitialAd: ((args: {
166
- onEvent: (data: void) => void;
166
+ onEvent: (data: LoadAdMobInterstitialAdEvent) => void;
167
167
  onError: (error: Error) => void;
168
168
  options?: LoadAdMobInterstitialAdOptions | undefined;
169
169
  }) => () => void) & {
@@ -219,7 +219,7 @@ declare const GoogleAdMob: {
219
219
  * ```
220
220
  */
221
221
  showAdMobInterstitialAd: ((args: {
222
- onEvent: (data: void) => void;
222
+ onEvent: (data: ShowAdMobInterstitialAdEvent) => void;
223
223
  onError: (error: Error) => void;
224
224
  options?: ShowAdMobInterstitialAdOptions | undefined;
225
225
  }) => () => void) & {
@@ -304,7 +304,7 @@ declare const GoogleAdMob: {
304
304
  * ```
305
305
  */
306
306
  loadAdMobRewardedAd: ((args: {
307
- onEvent: (data: void) => void;
307
+ onEvent: (data: LoadAdMobRewardedAdEvent) => void;
308
308
  onError: (error: Error) => void;
309
309
  options?: LoadAdMobRewardedAdOptions | undefined;
310
310
  }) => () => void) & {
@@ -360,7 +360,7 @@ declare const GoogleAdMob: {
360
360
  * ```
361
361
  */
362
362
  showAdMobRewardedAd: ((args: {
363
- onEvent: (data: void) => void;
363
+ onEvent: (data: ShowAdMobRewardedAdEvent) => void;
364
364
  onError: (error: Error) => void;
365
365
  options?: ShowAdMobRewardedAdOptions | undefined;
366
366
  }) => () => void) & {
@@ -368,18 +368,18 @@ declare const GoogleAdMob: {
368
368
  };
369
369
  };
370
370
 
371
- type BedrockEvent = {
371
+ type GraniteEvent = {
372
372
  backEvent: {
373
373
  onEvent: () => void;
374
374
  onError?: (error: Error) => void;
375
375
  options?: void;
376
376
  };
377
377
  };
378
- declare const bedrockEvent: {
379
- addEventListener: <K extends keyof BedrockEvent>(event: K, { onEvent, onError, options, }: {
380
- onEvent: BedrockEvent[K]["onEvent"];
381
- onError?: BedrockEvent[K]["onError"];
382
- options?: BedrockEvent[K]["options"];
378
+ declare const graniteEvent: {
379
+ addEventListener: <K extends keyof GraniteEvent>(event: K, { onEvent, onError, options, }: {
380
+ onEvent: GraniteEvent[K]["onEvent"];
381
+ onError?: GraniteEvent[K]["onError"];
382
+ options?: GraniteEvent[K]["options"];
383
383
  }) => () => void;
384
384
  };
385
385
 
@@ -445,4 +445,4 @@ declare const env: {
445
445
  getDeploymentId: () => string;
446
446
  };
447
447
 
448
- export { type AppsInTossEvent, type BedrockEvent, GoogleAdMob, Storage, appsInTossEvent, bedrockEvent, env, getSafeAreaInsets, isMinVersionSupported };
448
+ export { type AppsInTossEvent, GoogleAdMob, type GraniteEvent, Storage, appsInTossEvent, env, getSafeAreaInsets, graniteEvent, isMinVersionSupported };
@@ -1,4 +1,4 @@
1
- export * from './bridge.js'
1
+ export * from './bridge.js';
2
2
 
3
3
  // src/index.ts
4
4
  export * from "@apps-in-toss/bridge-core";
@@ -299,9 +299,12 @@ var GoogleAdMob = {
299
299
  * }
300
300
  * ```
301
301
  */
302
- loadAdMobRewardedAd: Object.assign(createEventBridge("loadAdMobRewardedAd"), {
303
- isSupported: createConstantBridge2("loadAdMobRewardedAd_isSupported")
304
- }),
302
+ loadAdMobRewardedAd: Object.assign(
303
+ createEventBridge("loadAdMobRewardedAd"),
304
+ {
305
+ isSupported: createConstantBridge2("loadAdMobRewardedAd_isSupported")
306
+ }
307
+ ),
305
308
  /**
306
309
  * @public
307
310
  * @category 광고
@@ -351,14 +354,17 @@ var GoogleAdMob = {
351
354
  * }
352
355
  * ```
353
356
  */
354
- showAdMobRewardedAd: Object.assign(createEventBridge("showAdMobRewardedAd"), {
355
- isSupported: createConstantBridge2("showAdMobRewardedAd_isSupported")
356
- })
357
+ showAdMobRewardedAd: Object.assign(
358
+ createEventBridge("showAdMobRewardedAd"),
359
+ {
360
+ isSupported: createConstantBridge2("showAdMobRewardedAd_isSupported")
361
+ }
362
+ )
357
363
  };
358
364
 
359
- // src/bedrockEvent.ts
365
+ // src/graniteEvent.ts
360
366
  import { createEventBridge as createEventBridge2 } from "@apps-in-toss/bridge-core";
361
- var bedrockEvent = {
367
+ var graniteEvent = {
362
368
  addEventListener: (event, {
363
369
  onEvent,
364
370
  onError,
@@ -486,8 +492,8 @@ export {
486
492
  GoogleAdMob,
487
493
  Storage,
488
494
  appsInTossEvent,
489
- bedrockEvent,
490
495
  env,
491
496
  getSafeAreaInsets,
497
+ graniteEvent,
492
498
  isMinVersionSupported
493
499
  };
@@ -21,7 +21,7 @@
21
21
  * ### 외부 URL 열기
22
22
  *
23
23
  * ```tsx
24
- * import { openURL } from '@apps-in-toss/web-framework';
24
+ * import { openURL } from 'react-native-bedrock';
25
25
  *
26
26
  *
27
27
  * function Page() {
@@ -0,0 +1,43 @@
1
+ export interface SaveBase64DataParams {
2
+ data: string;
3
+ fileName: string;
4
+ mimeType: string;
5
+ }
6
+ /**
7
+ * @public
8
+ * @category 데이터
9
+ * @name saveBase64Data
10
+ * @description 문자열로 인코딩된 Base64 데이터를 지정한 파일 이름과 MIME 타입으로 사용자 기기에 저장해요. 이미지, 텍스트, PDF 등 다양한 형식의 데이터를 저장할 수 있어요.
11
+ * @param {SaveBase64DataParams} params - 저장할 데이터와 파일 정보를 담은 객체예요.
12
+ * @param {string} params.data - Base64 형식으로 인코딩된 데이터 문자열이에요.
13
+ * @param {string} params.fileName - 저장할 파일 이름이에요. 확장자도 같이 붙여줘야해요. 예를 들어, 'example.png'로 저장할 수 있어요.
14
+ * @param {string} params.mimeType - 저장할 파일의 MIME 타입이에요. 예를 들어 'image/png' 로 지정하면 이미지, 'application/pdf'는 PDF 파일이에요. 자세한 내용은 [MIME 문서](https://developer.mozilla.org/ko/docs/Web/HTTP/Guides/MIME_types)를 참고해주세요.
15
+ *
16
+ * @example
17
+ * ### Base64 이미지 데이터를 사용자 기기에 저장하기
18
+ *
19
+ * ```tsx
20
+ *
21
+ * import { saveBase64Data } from '@apps-in-toss/web-framework';
22
+ *
23
+ * // '저장' 버튼을 누르면 이미지가 사용자 기기에 저장돼요.
24
+ * function SaveButton() {
25
+ * const handleSave = async () => {
26
+ * try {
27
+ * await saveBase64Data({
28
+ * data: 'iVBORw0KGgo...',
29
+ * fileName: 'some-photo.png',
30
+ * mimeType: 'image/png',
31
+ * });
32
+ * } catch (error) {
33
+ * console.error('데이터 저장에 실패했어요:', error);
34
+ * }
35
+ * };
36
+ *
37
+ * return <input type="button" value="저장" onClick={handleSave} />;
38
+ * }
39
+ * ```
40
+ */
41
+ export declare function saveBase64Data(params: SaveBase64DataParams): Promise<void>;
42
+
43
+ export {};
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @public
3
+ * @category 화면 제어
4
+ * @kind function
5
+ * @name setDeviceOrientation
6
+ * @description
7
+ * `setDeviceOrientation` 함수는 기기의 화면 방향을 설정하는 기능을 제공해요.
8
+ * 이 기능은 특정 화면에서 가로 모드나 세로 모드를 강제로 지정해야 할 때 유용해요.
9
+ *
10
+ * `type` 옵션을 통해 원하는 화면 방향을 지정할 수 있어요. 특히, 이 함수는 앱 전체에 영향을 미치므로
11
+ * 특정 화면에서만 사용하려면 화면을 벗어날 때 이전 상태로 복구하는 추가 작업이 필요해요.
12
+ *
13
+ * 예를 들어, 동영상 감상 화면에서는 가로 모드를 강제하고, 화면을 떠날 때 설정을 복구해서
14
+ * 다른 화면들의 방향 설정에 영향을 주지 않도록 할 수 있어요.
15
+ *
16
+ * @param {object} options 화면 방향 설정 값이에요.
17
+ * @param {string} options.type 화면 방향을 지정하는 옵션이에요.
18
+ * 'portrait' | 'landscape' 중 하나를 선택할 수 있어요.
19
+ *
20
+ * @returns {Promise<void>} 화면 방향 설정이 완료되면 해결되는 Promise를 반환해요.
21
+ *
22
+ * @example
23
+ * ### 화면 방향 설정하기
24
+ *
25
+ * ```tsx
26
+ *
27
+ * import { setDeviceOrientation } from '@apps-in-toss/web-framework';
28
+ *
29
+ * function SetDeviceOrientation() {
30
+ * return (
31
+ * <input type="button"
32
+ * value="가로 모드로 변경"
33
+ * onClick={() => {
34
+ * setDeviceOrientation({ type: 'landscape' });
35
+ * }}
36
+ * />
37
+ * );
38
+ * }
39
+ * ```
40
+ *
41
+ * ### 화면 방향 복구하기
42
+ * 특정 화면을 벗어날 때 이전 상태로 복구하려면 다음과 같이 `useEffect`를 사용하세요.
43
+ *
44
+ * ```tsx
45
+ * import { useEffect } from 'react';
46
+ * import { setDeviceOrientation } from '@apps-in-toss/web-framework';
47
+ *
48
+ * function VideoScreen() {
49
+ * useEffect(() => {
50
+ * setDeviceOrientation({ type: 'landscape' });
51
+ *
52
+ * return () => {
53
+ * setDeviceOrientation({ type: 'portrait' }); // 설정을 이전 상태로 복구해요.
54
+ * };
55
+ * }, []);
56
+ *
57
+ * return <span>동영상을 감상하는 화면</span>;
58
+ * }
59
+ * ```
60
+ */
61
+ export declare function setDeviceOrientation(options: {
62
+ type: "portrait" | "landscape";
63
+ }): Promise<void>;
64
+
65
+ export {};
@@ -18,7 +18,7 @@
18
18
  *
19
19
  *
20
20
  * ```tsx
21
- * import { setIosSwipeGestureEnabled } from '@apps-in-toss/web-framework';
21
+ * import { setIosSwipeGestureEnabled } from 'react-native-bedrock';
22
22
  *
23
23
  *
24
24
  * function Page() {
@@ -25,7 +25,7 @@
25
25
  *
26
26
  * ```tsx
27
27
  *
28
- * import { setScreenAwakeMode } from '@apps-in-toss/web-framework';
28
+ * import { setScreenAwakeMode } from 'react-native-bedrock';
29
29
  *
30
30
  * function SetScreenAwakeMode() {
31
31
  * return (
@@ -44,7 +44,7 @@
44
44
  *
45
45
  * ```tsx
46
46
  * import { useEffect } from 'react';
47
- * import { setScreenAwakeMode, cleanUp } from '@apps-in-toss/web-framework';
47
+ * import { setScreenAwakeMode, cleanUp } from 'react-native-bedrock';
48
48
  *
49
49
  * function MediaScreen() {
50
50
  * useEffect(() => {
@@ -15,7 +15,7 @@
15
15
  *
16
16
  * ```tsx
17
17
  *
18
- * import { setSecureScreen } from '@apps-in-toss/web-framework';
18
+ * import { setSecureScreen } from 'react-native-bedrock';
19
19
  *
20
20
  * function SetSecureScreen() {
21
21
  * return <input type="button" value="캡쳐 막기" onClick={async () => {
@@ -16,7 +16,7 @@
16
16
  * 아래는 버튼을 클릭하면 메시지를 공유하는 간단한 예제예요.
17
17
  *
18
18
  * ```tsx
19
- * import { share } from '@apps-in-toss/web-framework';
19
+ * import { share } from 'react-native-bedrock';
20
20
  *
21
21
  *
22
22
  * function MyPage() {
@@ -30,13 +30,7 @@ declare enum Accuracy {
30
30
  */
31
31
  BestForNavigation = 6
32
32
  }
33
- /**
34
- * @public
35
- * @category 위치 정보
36
- * @name Location
37
- * @description 위치 정보를 나타내는 객체예요.
38
- */
39
- export interface Location {
33
+ interface Location$1 {
40
34
  /**
41
35
  * Android에서만 지원하는 옵션이에요.
42
36
  *
@@ -111,7 +105,7 @@ export interface StartUpdateLocationSubscription extends EmitterSubscription {
111
105
  * 디바이스의 위치 정보 변경을 감지해요
112
106
  */
113
107
  export type UpdateLocationEventEmitter = EventEmitterSchema<"updateLocation", [
114
- Location
108
+ Location$1
115
109
  ]>;
116
110
  /**
117
111
  * @public
@@ -173,7 +167,7 @@ export type UpdateLocationEventEmitter = EventEmitterSchema<"updateLocation", [
173
167
  * ```
174
168
  */
175
169
  export declare function startUpdateLocation(eventParams: {
176
- onEvent: (response: Location) => void;
170
+ onEvent: (response: Location$1) => void;
177
171
  onError: (error: unknown) => void;
178
172
  options: StartUpdateLocationOptions;
179
173
  }): () => void;
package/package.json CHANGED
@@ -1,33 +1,33 @@
1
1
  {
2
2
  "name": "@apps-in-toss/web-bridge",
3
3
  "type": "module",
4
- "version": "0.0.0-dev.1747216176095",
4
+ "version": "0.0.0-dev.1752049503789",
5
5
  "description": "Web Bridge for Apps In Toss",
6
6
  "scripts": {
7
7
  "prepack": "yarn build",
8
8
  "typecheck": "tsc --noEmit",
9
9
  "lint": "eslint .",
10
- "build": "echo 'no build'",
11
- "sync-bridge": "bridgepack build"
10
+ "build": "tsup"
12
11
  },
13
- "main": "./build/index.js",
14
- "module": "./build/index.js",
15
- "types": "./build/index.d.ts",
12
+ "main": "./built/index.js",
13
+ "module": "./built/index.js",
14
+ "types": "./built/index.d.ts",
16
15
  "exports": {
17
16
  ".": {
18
- "types": "./build/index.d.ts",
19
- "default": "./build/index.js"
17
+ "types": "./built/index.d.ts",
18
+ "default": "./built/index.js"
20
19
  }
21
20
  },
22
21
  "files": [
23
- "build"
22
+ "built"
24
23
  ],
25
24
  "devDependencies": {
26
- "@apps-in-toss-internal/bridgepack": "0.0.0-dev.1747216176095",
27
- "@apps-in-toss/bridge-core": "0.0.0-dev.1747216176095",
28
- "@apps-in-toss/framework": "0.0.0-dev.1747216176095",
29
- "react-native-bedrock": "0.0.0-dev.1747215740094",
30
- "tsup": "^8.3.5",
25
+ "@apps-in-toss/bridge-core": "0.0.0-dev.1752049503789",
26
+ "@apps-in-toss/framework": "0.0.0-dev.1752049503789",
27
+ "@swc/core": "^1.12.7",
28
+ "picocolors": "^1.1.1",
29
+ "ts-morph": "^26.0.0",
30
+ "tsup": "^8.5.0",
31
31
  "typescript": "4.9.5",
32
32
  "vitest": "^3.1.2"
33
33
  },
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "b9097d25120bc711f8c90351a5c6d0346d41f7fa"
40
+ "gitHead": "8269e1336952bd7229eba87bc82ae1a077ac874a"
41
41
  }
package/build/bridge.d.ts DELETED
@@ -1,25 +0,0 @@
1
- export * from './closeView.js';
2
- export * from './generateHapticFeedback.js';
3
- export * from './share.js';
4
- export * from './setSecureScreen.js';
5
- export * from './setScreenAwakeMode.js';
6
- export * from './getNetworkStatus.js';
7
- export * from './setIosSwipeGestureEnabled.js';
8
- export * from './openURL.js';
9
- export * from './getLocale.js';
10
- export * from './getSchemeUri.js';
11
- export * from './getPlatformOS.js';
12
- export * from './setClipboardText.js';
13
- export * from './getClipboardText.js';
14
- export * from './fetchContacts.js';
15
- export * from './fetchAlbumPhotos.js';
16
- export * from './getCurrentLocation.js';
17
- export * from './openCamera.js';
18
- export * from './appLogin.js';
19
- export * from './checkoutPayment.js';
20
- export * from './eventLog.js';
21
- export * from './getTossShareLink.js';
22
- export * from './getOperationalEnvironment.js';
23
- export * from './getTossAppVersion.js';
24
- export * from './getDeviceId.js';
25
- export * from './startUpdateLocation.js';
package/build/bridge.js DELETED
@@ -1 +0,0 @@
1
- import{createAsyncBridge,createConstantBridge,createEventBridge}from"@apps-in-toss/bridge-core";var createEvents=function(){return{emit:function emit(event,args){for(var callbacks=this.events[event]||[],i=0,length=callbacks.length;i<length;i++){callbacks[i](args)}},events:{},on:function on(event,cb){var _this=this;var _this_events,_event;((_this_events=this.events)[_event=event]||(_this_events[_event]=[])).push(cb);return function(){var _this_events_event;_this.events[event]=(_this_events_event=_this.events[event])===null||_this_events_event===void 0?void 0:_this_events_event.filter(function(i){return cb!==i})}}}};if(typeof window!=="undefined"){window.__BEDROCK_NATIVE_EMITTER=createEvents()}export var closeView=createAsyncBridge("closeView");export var generateHapticFeedback=createAsyncBridge("generateHapticFeedback");export var share=createAsyncBridge("share");export var setSecureScreen=createAsyncBridge("setSecureScreen");export var setScreenAwakeMode=createAsyncBridge("setScreenAwakeMode");export var getNetworkStatus=createAsyncBridge("getNetworkStatus");export var setIosSwipeGestureEnabled=createAsyncBridge("setIosSwipeGestureEnabled");export var openURL=createAsyncBridge("openURL");export var getLocale=createConstantBridge("getLocale");export var getSchemeUri=createConstantBridge("getSchemeUri");export var getPlatformOS=createConstantBridge("getPlatformOS");export var setClipboardText=createAsyncBridge("setClipboardText");export var getClipboardText=createAsyncBridge("getClipboardText");export var fetchContacts=createAsyncBridge("fetchContacts");export var fetchAlbumPhotos=createAsyncBridge("fetchAlbumPhotos");export var Accuracy=function(Accuracy){Accuracy[Accuracy["Lowest"]=1]="Lowest";Accuracy[Accuracy["Low"]=2]="Low";Accuracy[Accuracy["Balanced"]=3]="Balanced";Accuracy[Accuracy["High"]=4]="High";Accuracy[Accuracy["Highest"]=5]="Highest";Accuracy[Accuracy["BestForNavigation"]=6]="BestForNavigation";return Accuracy}({});export var getCurrentLocation=createAsyncBridge("getCurrentLocation");export var openCamera=createAsyncBridge("openCamera");export var appLogin=createAsyncBridge("appLogin");export var checkoutPayment=createAsyncBridge("checkoutPayment");export var eventLog=createAsyncBridge("eventLog");export var getTossShareLink=createAsyncBridge("getTossShareLink");export var getOperationalEnvironment=createConstantBridge("getOperationalEnvironment");export var getTossAppVersion=createConstantBridge("getTossAppVersion");export var getDeviceId=createConstantBridge("getDeviceId");export var startUpdateLocation=createEventBridge("startUpdateLocation");
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes