@apps-in-toss/web-bridge 0.0.0-dev.1752114017143 → 0.0.0-dev.1752115036458

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 +7 -92
  12. package/{build → built}/index.js +4 -42
  13. package/{build → built}/openURL.d.ts +1 -1
  14. package/{build → built}/setIosSwipeGestureEnabled.d.ts +1 -1
  15. package/{build → built}/setScreenAwakeMode.d.ts +2 -2
  16. package/{build → built}/setSecureScreen.d.ts +1 -1
  17. package/{build → built}/share.d.ts +1 -1
  18. package/{build → built}/startUpdateLocation.d.ts +3 -9
  19. package/package.json +15 -15
  20. package/build/bridge.d.ts +0 -27
  21. package/build/bridge.js +0 -1
  22. /package/{build → built}/appLogin.d.ts +0 -0
  23. /package/{build → built}/checkoutPayment.d.ts +0 -0
  24. /package/{build → built}/eventLog.d.ts +0 -0
  25. /package/{build → built}/fetchAlbumPhotos.d.ts +0 -0
  26. /package/{build → built}/getClipboardText.d.ts +0 -0
  27. /package/{build → built}/getDeviceId.d.ts +0 -0
  28. /package/{build → built}/getOperationalEnvironment.d.ts +0 -0
  29. /package/{build → built}/getTossAppVersion.d.ts +0 -0
  30. /package/{build → built}/getTossShareLink.d.ts +0 -0
  31. /package/{build → built}/openCamera.d.ts +0 -0
  32. /package/{build → built}/saveBase64Data.d.ts +0 -0
  33. /package/{build → built}/setClipboardText.d.ts +0 -0
  34. /package/{build → built}/setDeviceOrientation.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() {
@@ -82,91 +82,6 @@ declare const Storage: {
82
82
  clearItems: (args_0: void) => Promise<void>;
83
83
  };
84
84
 
85
- /**
86
- * @public
87
- * @category 인앱결제
88
- * @name IapCreateOneTimePurchaseOrderResult
89
- * @description 인앱결제 1건이 완료되면 결제 세부 정보와 상품 정보를 담아 반환해요. 반환된 정보로 결제한 상품의 정보를 화면에 표시할 수 있어요.
90
- * @property {string | null} miniAppIconUrl - 미니앱 아이콘 이미지의 URL이에요. 아이콘은 앱인토스 콘솔에서 설정한 이미지예요. 콘솔에서 아이콘을 등록하지 않았다면 `null`로 반환돼요.
91
- * @property {string} displayName - 화면에 표시할 상품 이름이에요.
92
- * @property {string} displayAmount - 통화 단위가 포함된 가격 정보예요. 예를 들어 `1,000원`으로 가격과 통화가 함께 표시돼요.
93
- * @property {number} amount - 상품 가격 숫자 값이에요. 화폐 단위와 쉼표를 제외한 순수 숫자예요. 예를 들어 `1000`으로 표시돼요.
94
- * @property {string} currency - [ISO 4217 표준](https://ko.wikipedia.org/wiki/ISO_4217)에 따른 상품 가격 통화 단위예요. 예를 들어 원화는 `KRW`, 달러는 `USD`로 표시돼요.
95
- * @property {number} fraction - 가격을 표시할 때 소수점 아래 몇 자리까지 보여줄지 정하는 값이에요. 예를 들어 달러는 소수점 둘째 자리까지 보여줘서 `2`, 원화는 소수점이 필요 없어서 `0`이에요
96
- */
97
- interface IapCreateOneTimePurchaseOrderResult {
98
- miniAppIconUrl: string | null;
99
- displayName: string;
100
- displayAmount: string;
101
- amount: number;
102
- currency: string;
103
- fraction: number;
104
- }
105
- /**
106
- * @public
107
- * @category 인앱결제
108
- * @name IapProductListItem
109
- * @description 인앱결제로 구매할 수 있는 상품 하나의 정보를 담은 객체예요. 상품 목록을 화면에 표시할 때 사용해요.
110
- * @property {string} sku - 상품의 고유 ID예요. [인앱결제 주문서 페이지로 이동할때](/bedrock/reference/framework/인앱결제/createOneTimePurchaseOrder.html) 사용하는 `productId`와 동일한 값이에요.
111
- * @property {string} displayName - 화면에 표시할 상품 이름이에요. 상품 이름은 앱인토스 콘솔에서 설정한 값이에요.
112
- * @property {string} displayAmount - 통화 단위가 포함된 가격 정보예요. 예를 들어 `1,000원`으로 가격과 통화가 함께 표시돼요.
113
- * @property {string} iconUrl - 상품 아이콘 이미지의 URL이에요. 아이콘은 앱인토스 콘솔에서 설정한 이미지예요.
114
- * @property {string} description - 상품에 대한 설명이에요. 설명은 앱인토스 콘솔에서 설정한 값이에요.
115
- */
116
- interface IapProductListItem {
117
- sku: string;
118
- displayAmount: string;
119
- displayName: string;
120
- iconUrl: string;
121
- description: string;
122
- }
123
- /**
124
- * @public
125
- * @category 인앱결제
126
- * @name iapCreateOneTimePurchaseOrder
127
- * @description
128
- * 특정 인앱결제 주문서 페이지로 이동해요. 사용자가 상품 구매 버튼을 누르는 상황 등에 사용할 수 있어요. 사용자의 결제는 이동한 페이지에서 진행돼요. 만약 결제 중에 에러가 발생하면 에러 유형에 따라 에러 페이지로 이동해요.
129
- * @param {IapCreateOneTimePurchaseOrderOptions} params - 인앱결제를 생성할 때 필요한 정보예요.
130
- * @param {string} params.productId - 주문할 상품의 ID예요.
131
- * @returns {Promise<IapCreateOneTimePurchaseOrderResult | undefined>} 결제에 성공하면 결제 결과 객체를 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.219.0, iOS 5.219.0)보다 낮으면 인앱결제를 실행할 수 없어서 `undefined`를 반환해요.
132
- */
133
- declare const IAP: {
134
- /**
135
- * @public
136
- * @category 인앱결제
137
- * @name iapCreateOneTimePurchaseOrder
138
- * @description
139
- * 단건 인앱결제 주문서 페이지로 이동해요. 결제는 해당 페이지에서 진행돼요. 주문 중 에러가 발생하면 에러 유형에 따라 에러 페이지로 이동해요.
140
- * @param {IapCreateOneTimePurchaseOrderOptions} params - 인앱결제를 생성할 때 필요한 정보예요.
141
- * @param {string} params.productId - 주문할 상품의 ID예요.
142
- * @returns {Promise<IapCreateOneTimePurchaseOrderResult | undefined>} 결제가 성공하면 결과 객체를 반환해요. 앱 버전이 지원되지 않으면 `undefined`를 반환해요.
143
- *
144
- * @throw {code: "INVALID_PRODUCT_ID"} - 유효하지 않은 상품 ID이거나, 해당 상품이 존재하지 않을 때 발생해요.
145
- * @throw {code: "PAYMENT_PENDING"} - 사용자가 요청한 결제가 아직 승인을 기다리고 있을 때 발생해요.
146
- * @throw {code: "NETWORK_ERROR"} - 서버 내부 문제로 요청을 처리할 수 없을 때 발생해요.
147
- * @throw {code: "INVALID_USER_ENVIRONMENT"} - 특정 기기, 계정 또는 설정 환경에서 구매할 수 없는 상품일 때 발생해요.
148
- * @throw {code: "ITEM_ALREADY_OWNED"} - 사용자가 이미 구매한 상품을 다시 구매하려고 할 때 발생해요.
149
- * @throw {code: "APP_MARKET_VERIFICATION_FAILED"} - 사용자가 결제를 완료했지만, 앱스토어에서 사용자 정보 검증에 실패했을 때 발생해요. 사용자가 앱스토어에 문의해서 환불을 요청해야해요.
150
- * @throw {code: "TOSS_SERVER_VERIFICATION_FAILED"} - 사용자가 결제를 완료했지만, 서버 전송에 실패해서 결제 정보를 저장할 수 없을 때 발생해요.
151
- * @throw {code: "INTERNAL_ERROR"} - 서버 내부 문제로 요청을 처리할 수 없을 때 발생해요.
152
- * @throw {code: "KOREAN_ACCOUNT_ONLY"} - iOS 환경에서 사용자의 계정이 한국 계정이 아닐 때 발생해요.
153
- * @throw {code: "USER_CANCELED"} - 사용자가 결제를 완료하지 않고 주문서 페이지를 이탈했을 때 발생해요.
154
- */
155
- createOneTimePurchaseOrder: (args_0: {
156
- productId: string;
157
- }, args_1: IapCreateOneTimePurchaseOrderResult) => Promise<any>;
158
- /**
159
- * @public
160
- * @category 인앱결제
161
- * @name iapGetProductItemList
162
- * @description 인앱결제로 구매할 수 있는 상품 목록을 가져와요. 상품 목록 화면에 진입할 때 호출해요.
163
- * @returns {Promise<{ products: IapProductListItem[] } | undefined>} 상품 목록을 포함한 객체를 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.219.0, iOS 5.219.0)보다 낮으면 `undefined`를 반환해요.
164
- */
165
- getProductItemList: () => Promise<{
166
- products: IapProductListItem[];
167
- }>;
168
- };
169
-
170
85
  declare function getSafeAreaInsets(): {
171
86
  top: number;
172
87
  bottom: number;
@@ -453,18 +368,18 @@ declare const GoogleAdMob: {
453
368
  };
454
369
  };
455
370
 
456
- type BedrockEvent = {
371
+ type GraniteEvent = {
457
372
  backEvent: {
458
373
  onEvent: () => void;
459
374
  onError?: (error: Error) => void;
460
375
  options?: void;
461
376
  };
462
377
  };
463
- declare const bedrockEvent: {
464
- addEventListener: <K extends keyof BedrockEvent>(event: K, { onEvent, onError, options, }: {
465
- onEvent: BedrockEvent[K]["onEvent"];
466
- onError?: BedrockEvent[K]["onError"];
467
- 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"];
468
383
  }) => () => void;
469
384
  };
470
385
 
@@ -530,4 +445,4 @@ declare const env: {
530
445
  getDeploymentId: () => string;
531
446
  };
532
447
 
533
- export { type AppsInTossEvent, type BedrockEvent, GoogleAdMob, IAP, type IapCreateOneTimePurchaseOrderResult, type IapProductListItem, 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";
@@ -75,43 +75,6 @@ var Storage = {
75
75
  clearItems: createAsyncBridge("clearItems")
76
76
  };
77
77
 
78
- // src/iap.ts
79
- import { createAsyncBridge as createAsyncBridge2 } from "@apps-in-toss/bridge-core";
80
- var IAP = {
81
- /**
82
- * @public
83
- * @category 인앱결제
84
- * @name iapCreateOneTimePurchaseOrder
85
- * @description
86
- * 단건 인앱결제 주문서 페이지로 이동해요. 결제는 해당 페이지에서 진행돼요. 주문 중 에러가 발생하면 에러 유형에 따라 에러 페이지로 이동해요.
87
- * @param {IapCreateOneTimePurchaseOrderOptions} params - 인앱결제를 생성할 때 필요한 정보예요.
88
- * @param {string} params.productId - 주문할 상품의 ID예요.
89
- * @returns {Promise<IapCreateOneTimePurchaseOrderResult | undefined>} 결제가 성공하면 결과 객체를 반환해요. 앱 버전이 지원되지 않으면 `undefined`를 반환해요.
90
- *
91
- * @throw {code: "INVALID_PRODUCT_ID"} - 유효하지 않은 상품 ID이거나, 해당 상품이 존재하지 않을 때 발생해요.
92
- * @throw {code: "PAYMENT_PENDING"} - 사용자가 요청한 결제가 아직 승인을 기다리고 있을 때 발생해요.
93
- * @throw {code: "NETWORK_ERROR"} - 서버 내부 문제로 요청을 처리할 수 없을 때 발생해요.
94
- * @throw {code: "INVALID_USER_ENVIRONMENT"} - 특정 기기, 계정 또는 설정 환경에서 구매할 수 없는 상품일 때 발생해요.
95
- * @throw {code: "ITEM_ALREADY_OWNED"} - 사용자가 이미 구매한 상품을 다시 구매하려고 할 때 발생해요.
96
- * @throw {code: "APP_MARKET_VERIFICATION_FAILED"} - 사용자가 결제를 완료했지만, 앱스토어에서 사용자 정보 검증에 실패했을 때 발생해요. 사용자가 앱스토어에 문의해서 환불을 요청해야해요.
97
- * @throw {code: "TOSS_SERVER_VERIFICATION_FAILED"} - 사용자가 결제를 완료했지만, 서버 전송에 실패해서 결제 정보를 저장할 수 없을 때 발생해요.
98
- * @throw {code: "INTERNAL_ERROR"} - 서버 내부 문제로 요청을 처리할 수 없을 때 발생해요.
99
- * @throw {code: "KOREAN_ACCOUNT_ONLY"} - iOS 환경에서 사용자의 계정이 한국 계정이 아닐 때 발생해요.
100
- * @throw {code: "USER_CANCELED"} - 사용자가 결제를 완료하지 않고 주문서 페이지를 이탈했을 때 발생해요.
101
- */
102
- createOneTimePurchaseOrder: createAsyncBridge2(
103
- "iapCreateOneTimePurchaseOrder"
104
- ),
105
- /**
106
- * @public
107
- * @category 인앱결제
108
- * @name iapGetProductItemList
109
- * @description 인앱결제로 구매할 수 있는 상품 목록을 가져와요. 상품 목록 화면에 진입할 때 호출해요.
110
- * @returns {Promise<{ products: IapProductListItem[] } | undefined>} 상품 목록을 포함한 객체를 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.219.0, iOS 5.219.0)보다 낮으면 `undefined`를 반환해요.
111
- */
112
- getProductItemList: createAsyncBridge2("iapGetProductItemList")
113
- };
114
-
115
78
  // src/getSafeAreaInsets.ts
116
79
  import { createConstantBridge } from "@apps-in-toss/bridge-core";
117
80
  var getSafeAreaBottom = createConstantBridge("getSafeAreaBottom");
@@ -399,9 +362,9 @@ var GoogleAdMob = {
399
362
  )
400
363
  };
401
364
 
402
- // src/bedrockEvent.ts
365
+ // src/graniteEvent.ts
403
366
  import { createEventBridge as createEventBridge2 } from "@apps-in-toss/bridge-core";
404
- var bedrockEvent = {
367
+ var graniteEvent = {
405
368
  addEventListener: (event, {
406
369
  onEvent,
407
370
  onError,
@@ -527,11 +490,10 @@ var env = {
527
490
  };
528
491
  export {
529
492
  GoogleAdMob,
530
- IAP,
531
493
  Storage,
532
494
  appsInTossEvent,
533
- bedrockEvent,
534
495
  env,
535
496
  getSafeAreaInsets,
497
+ graniteEvent,
536
498
  isMinVersionSupported
537
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() {
@@ -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.1752114017143",
4
+ "version": "0.0.0-dev.1752115036458",
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.1752114017143",
27
- "@apps-in-toss/bridge-core": "0.0.0-dev.1752114017143",
28
- "@apps-in-toss/framework": "0.0.0-dev.1752114017143",
29
- "react-native-bedrock": "0.0.25",
30
- "tsup": "^8.3.5",
25
+ "@apps-in-toss/bridge-core": "0.0.0-dev.1752115036458",
26
+ "@apps-in-toss/framework": "0.0.0-dev.1752115036458",
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": "d4d3441684f79edb0dd69330007f32b737ee01dc"
40
+ "gitHead": "73735f83556eb2727f160e998234101bd17e55f0"
41
41
  }
package/build/bridge.d.ts DELETED
@@ -1,27 +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 './setDeviceOrientation.js';
23
- export * from './saveBase64Data.js';
24
- export * from './getOperationalEnvironment.js';
25
- export * from './getTossAppVersion.js';
26
- export * from './getDeviceId.js';
27
- 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 setDeviceOrientation=createAsyncBridge("setDeviceOrientation");export var saveBase64Data=createAsyncBridge("saveBase64Data");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
File without changes
File without changes