@apps-in-toss/web-bridge 0.0.39 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/bridge.d.ts +33 -0
- package/built/bridge.js +1 -0
- package/{build → built}/closeView.d.ts +1 -1
- package/{build → built}/contactsViral.d.ts +5 -4
- package/{build → built}/fetchContacts.d.ts +20 -22
- package/{build → built}/generateHapticFeedback.d.ts +2 -2
- package/{build → built}/getCurrentLocation.d.ts +5 -17
- package/{build → built}/getLocale.d.ts +1 -1
- package/{build → built}/getNetworkStatus.d.ts +1 -1
- package/{build → built}/getPlatformOS.d.ts +1 -1
- package/{build → built}/getSchemeUri.d.ts +1 -1
- package/built/index.cjs +680 -0
- package/built/index.d.cts +657 -0
- package/{build → built}/index.d.ts +8 -8
- package/{build → built}/index.js +4 -4
- package/built/onVisibilityChangedByTransparentServiceWeb.d.ts +21 -0
- package/{build → built}/openURL.d.ts +1 -1
- package/{build → built}/setIosSwipeGestureEnabled.d.ts +1 -1
- package/{build → built}/setScreenAwakeMode.d.ts +2 -2
- package/{build → built}/setSecureScreen.d.ts +1 -1
- package/{build → built}/share.d.ts +1 -1
- package/{build → built}/startUpdateLocation.d.ts +5 -11
- package/built/types.d.ts +110 -0
- package/package.json +21 -15
- package/build/bridge.d.ts +0 -31
- package/build/bridge.js +0 -1
- /package/{build → built}/appLogin.d.ts +0 -0
- /package/{build → built}/checkoutPayment.d.ts +0 -0
- /package/{build → built}/eventLog.d.ts +0 -0
- /package/{build → built}/fetchAlbumPhotos.d.ts +0 -0
- /package/{build → built}/getClipboardText.d.ts +0 -0
- /package/{build → built}/getDeviceId.d.ts +0 -0
- /package/{build → built}/getGameCenterGameProfile.d.ts +0 -0
- /package/{build → built}/getOperationalEnvironment.d.ts +0 -0
- /package/{build → built}/getTossAppVersion.d.ts +0 -0
- /package/{build → built}/getTossShareLink.d.ts +0 -0
- /package/{build → built}/openCamera.d.ts +0 -0
- /package/{build → built}/openGameCenterLeaderboard.d.ts +0 -0
- /package/{build → built}/saveBase64Data.d.ts +0 -0
- /package/{build → built}/setClipboardText.d.ts +0 -0
- /package/{build → built}/setDeviceOrientation.d.ts +0 -0
- /package/{build → built}/submitGameCenterLeaderBoardScore.d.ts +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
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 './getGameCenterGameProfile';
|
|
22
|
+
export * from './openGameCenterLeaderboard';
|
|
23
|
+
export * from './submitGameCenterLeaderBoardScore';
|
|
24
|
+
export * from './getLocale';
|
|
25
|
+
export * from './getSchemeUri';
|
|
26
|
+
export * from './getPlatformOS';
|
|
27
|
+
export * from './getOperationalEnvironment';
|
|
28
|
+
export * from './getTossAppVersion';
|
|
29
|
+
export * from './getDeviceId';
|
|
30
|
+
export * from './startUpdateLocation';
|
|
31
|
+
export * from './onVisibilityChangedByTransparentServiceWeb';
|
|
32
|
+
export * from './contactsViral';
|
|
33
|
+
export * from './types';
|
package/built/bridge.js
ADDED
|
@@ -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 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 getGameCenterGameProfile=createAsyncBridge("getGameCenterGameProfile");export var openGameCenterLeaderboard=createAsyncBridge("openGameCenterLeaderboard");export var submitGameCenterLeaderBoardScore=createAsyncBridge("submitGameCenterLeaderBoardScore");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");export var onVisibilityChangedByTransparentServiceWeb=createEventBridge("onVisibilityChangedByTransparentServiceWeb");export var contactsViral=createEventBridge("contactsViral");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}({});
|
|
@@ -18,7 +18,7 @@ export type RewardFromContactsViralEvent = {
|
|
|
18
18
|
/**
|
|
19
19
|
* @public
|
|
20
20
|
* @category 친구초대
|
|
21
|
-
* @name
|
|
21
|
+
* @name ContactsViralSuccessEvent
|
|
22
22
|
* @description 연락처 공유 모듈이 정상적으로 종료됐을 때 전달되는 이벤트 객체예요. 종료 이유와 함께 리워드 상태 및 남은 친구 수 등 관련 정보를 제공해요.
|
|
23
23
|
* @property {'close'} type - 이벤트의 타입이에요. `'close'`는 공유 모듈이 종료됐을 때 돌아와요.
|
|
24
24
|
* @property {Object} data - 모듈 종료와 관련된 세부 정보를 담고 있어요.
|
|
@@ -43,7 +43,7 @@ export type ContactsViralEvent = RewardFromContactsViralEvent | ContactsViralSuc
|
|
|
43
43
|
* @public
|
|
44
44
|
* @category 친구초대
|
|
45
45
|
* @name ContactsViralOption
|
|
46
|
-
* @description [연락처 공유 기능](/
|
|
46
|
+
* @description [연락처 공유 기능](/react-native/reference/native-modules/친구초대/contactsViral.html)을 사용할 때 필요한 옵션이에요.
|
|
47
47
|
* @property {string} moduleId - 공유 리워드를 구분하는 UUID 형식의 고유 ID예요. 앱인토스 콘솔의 미니앱 > 공유 리워드 메뉴에서 확인할 수 있어요.
|
|
48
48
|
*/
|
|
49
49
|
export type ContactsViralOption = {
|
|
@@ -52,9 +52,10 @@ export type ContactsViralOption = {
|
|
|
52
52
|
/**
|
|
53
53
|
* @public
|
|
54
54
|
* @category 친구초대
|
|
55
|
+
* @name ContactsViralParams
|
|
55
56
|
* @description `ContactsViralParams`는 연락처 공유 기능을 사용할 때 전달해야 하는 파라미터 타입이에요. 옵션을 설정하고, 이벤트 및 에러 처리 콜백을 지정할 수 있어요.
|
|
56
57
|
* @property {ContactsViralOption} options - 공유 기능에 사용할 옵션 객체예요.
|
|
57
|
-
* @property {(event: ContactsViralEvent) => void} onEvent - 공유 이벤트가 발생했을 때 실행되는 함수예요. [`RewardFromContactsViralEvent`](/bedrock/reference/
|
|
58
|
+
* @property {(event: ContactsViralEvent) => void} onEvent - 공유 이벤트가 발생했을 때 실행되는 함수예요. [`RewardFromContactsViralEvent`](/bedrock/reference/native-modules/친구초대/RewardFromContactsViralEvent.html) 또는 [`ContactsViralSuccessEvent`](/react-native/reference/native-modules/친구초대/ContactsViralSuccessEvent.html) 타입의 이벤트 객체가 전달돼요.
|
|
58
59
|
* @property {(error: unknown) => void} onError - 예기치 않은 에러가 발생했을 때 실행되는 함수예요.
|
|
59
60
|
*/
|
|
60
61
|
export interface ContactsViralParams {
|
|
@@ -67,7 +68,7 @@ export interface ContactsViralParams {
|
|
|
67
68
|
* @category 친구초대
|
|
68
69
|
* @name contactsViral
|
|
69
70
|
* @description 친구에게 공유하고 리워드를 받을 수 있는 기능을 제공해요. 사용자가 친구에게 공유를 완료하면 앱브릿지가 이벤트를 통해 리워드 정보를 전달해요.
|
|
70
|
-
* @param {ContactsViralParams} params - 연락처 공유 기능을 실행할 때 사용하는 파라미터예요. 옵션 설정과 이벤트 핸들러를 포함해요. 자세한 내용은 [ContactsViralParams](/bedrock/reference/
|
|
71
|
+
* @param {ContactsViralParams} params - 연락처 공유 기능을 실행할 때 사용하는 파라미터예요. 옵션 설정과 이벤트 핸들러를 포함해요. 자세한 내용은 [ContactsViralParams](/bedrock/reference/native-modules/친구초대/ContactsViralParams.html) 문서를 참고하세요.
|
|
71
72
|
* @returns {() => void} 앱브릿지 cleanup 함수를 반환해요. 공유 기능이 끝나면 반드시 이 함수를 호출해서 리소스를 해제해야 해요.
|
|
72
73
|
*
|
|
73
74
|
* @example
|
|
@@ -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
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
18
|
-
* @param query
|
|
19
|
-
* @
|
|
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(
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
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(
|
|
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
|
|
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/
|
|
40
|
+
* import { generateHapticFeedback } from '@apps-in-toss/native-modules';
|
|
41
41
|
*
|
|
42
42
|
* function GenerateHapticFeedback() {
|
|
43
43
|
* return <input type="button" value="햅틱" onClick={() => { generateHapticFeedback( { type: "tickWeak"}) }} />;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @public
|
|
3
|
-
* @category 위치 정보
|
|
4
|
-
* @name Accuracy
|
|
5
|
-
* @description 위치 정확도 옵션이에요.
|
|
6
|
-
*/
|
|
7
|
-
export declare enum Accuracy {
|
|
1
|
+
declare enum Accuracy {
|
|
8
2
|
/**
|
|
9
3
|
* 오차범위 3KM 이내
|
|
10
4
|
*/
|
|
@@ -30,13 +24,7 @@ export declare enum Accuracy {
|
|
|
30
24
|
*/
|
|
31
25
|
BestForNavigation = 6
|
|
32
26
|
}
|
|
33
|
-
|
|
34
|
-
* @public
|
|
35
|
-
* @category 위치 정보
|
|
36
|
-
* @name Location
|
|
37
|
-
* @description 위치 정보를 나타내는 객체예요.
|
|
38
|
-
*/
|
|
39
|
-
export interface Location {
|
|
27
|
+
interface Location$1 {
|
|
40
28
|
/**
|
|
41
29
|
* Android에서만 지원하는 옵션이에요.
|
|
42
30
|
*
|
|
@@ -51,7 +39,7 @@ export interface Location {
|
|
|
51
39
|
*/
|
|
52
40
|
timestamp: number;
|
|
53
41
|
/**
|
|
54
|
-
* @description 위치 정보를 나타내는 객체예요. 자세한 내용은 [LocationCoords](/react-native/reference/
|
|
42
|
+
* @description 위치 정보를 나타내는 객체예요. 자세한 내용은 [LocationCoords](/react-native/reference/native-modules/Types/LocationCoords.html)을 참고해주세요.
|
|
55
43
|
*/
|
|
56
44
|
coords: LocationCoords;
|
|
57
45
|
}
|
|
@@ -103,7 +91,7 @@ export interface GetCurrentLocationOptions {
|
|
|
103
91
|
*
|
|
104
92
|
* @param {GetCurrentLocationOptions} options 위치 정보를 가져올 때 사용하는 옵션 객체예요.
|
|
105
93
|
* @param {Accuracy} [options.accuracy] 위치 정보의 정확도 수준이에요. 정확도는 `Accuracy` 타입으로 설정돼요.
|
|
106
|
-
* @returns {Promise<Location>} 디바이스의 위치 정보가 담긴 객체를 반환해요. 자세한 내용은 [Location](/react-native/reference/
|
|
94
|
+
* @returns {Promise<Location>} 디바이스의 위치 정보가 담긴 객체를 반환해요. 자세한 내용은 [Location](/react-native/reference/native-modules/Types/Location.html)을 참고해주세요.
|
|
107
95
|
*
|
|
108
96
|
* @example
|
|
109
97
|
* ### 디바이스의 현재 위치 정보 가져오기
|
|
@@ -139,6 +127,6 @@ export interface GetCurrentLocationOptions {
|
|
|
139
127
|
* }
|
|
140
128
|
* ```
|
|
141
129
|
*/
|
|
142
|
-
export declare function getCurrentLocation(options: GetCurrentLocationOptions): Promise<Location>;
|
|
130
|
+
export declare function getCurrentLocation(options: GetCurrentLocationOptions): Promise<Location$1>;
|
|
143
131
|
|
|
144
132
|
export {};
|
|
@@ -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/
|
|
30
|
+
* import { getNetworkStatus, NetworkStatus } from '@apps-in-toss/native-modules';
|
|
31
31
|
*
|
|
32
32
|
* function GetNetworkStatus() {
|
|
33
33
|
* const [status, setStatus] = useState<NetworkStatus | ''>('');
|