@apps-in-toss/web-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.
- package/dist/chunk-CH3CIAIW.js +7688 -0
- package/dist/chunk-DI2VGQ6M.js +53 -0
- package/dist/chunk-HL7M3JLX.js +53 -0
- package/dist/chunk-I3ZDGLIW.js +19 -0
- package/dist/chunk-LJBVSTWE.js +7687 -0
- package/dist/chunk-TZCMTMV7.js +38 -0
- package/dist/cli/index.cjs +644 -0
- package/dist/cli/index.d.cts +2 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +51 -43
- package/dist/cli.cjs +560 -0
- package/dist/cli.d.cts +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +509 -0
- package/dist/closeView.d.ts +24 -0
- package/dist/config/index.cjs +7976 -0
- package/dist/config/index.d.cts +73 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.js +3 -0
- package/dist/fetchAlbumPhotos.d.ts +75 -0
- package/dist/fetchContacts.d.ts +92 -0
- package/dist/generateHapticFeedback.d.ts +52 -0
- package/dist/getClipboardText.d.ts +42 -0
- package/dist/getCurrentLocation.d.ts +109 -0
- package/dist/getDeviceId.d.ts +32 -0
- package/dist/getLocale.d.ts +31 -0
- package/dist/getNetworkStatus.d.ts +55 -0
- package/dist/getSchemeUri.d.ts +26 -0
- package/dist/index.cjs +18 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +1 -0
- package/dist/openCamera.d.ts +75 -0
- package/dist/plugins/index.cjs +7682 -0
- package/dist/plugins/index.d.cts +15 -0
- package/dist/plugins/index.d.ts +15 -0
- package/dist/plugins/index.js +11 -0
- package/dist/prebuilt/dev.android.js +25 -13
- package/dist/prebuilt/dev.ios.js +25 -13
- package/dist/prebuilt/prod.android.js +1 -1
- package/dist/prebuilt/prod.ios.js +1 -1
- package/dist/prebuilt/prod.json +4 -4
- package/dist/setClipboardText.d.ts +34 -0
- package/dist/setScreenAwakeMode.d.ts +69 -0
- package/dist/setSecureScreen.d.ts +34 -0
- package/dist/share.d.ts +37 -0
- package/dist/startUpdateLocation.d.ts +151 -0
- package/package.json +4 -4
- package/src-web/appLogin.d.ts +4 -5
- package/src-web/closeView.d.ts +1 -2
- package/src-web/fetchAlbumPhotos.d.ts +1 -3
- package/src-web/fetchContacts.d.ts +1 -3
- package/src-web/generateHapticFeedback.d.ts +24 -27
- package/src-web/getClipboardText.d.ts +1 -3
- package/src-web/getCurrentLocation.d.ts +4 -6
- package/src-web/getDeviceId.d.ts +1 -2
- package/src-web/getLocale.d.ts +1 -2
- package/src-web/getNetworkStatus.d.ts +1 -2
- package/src-web/getOperationalEnvironment.d.ts +35 -0
- package/src-web/getPlatformOS.d.ts +28 -0
- package/src-web/getSchemeUri.d.ts +1 -2
- package/src-web/index.d.ts +2 -0
- package/src-web/index.js +1 -1
- package/src-web/openCamera.d.ts +1 -3
- package/src-web/setClipboardText.d.ts +1 -3
- package/src-web/setScreenAwakeMode.d.ts +1 -2
- package/src-web/setSecureScreen.d.ts +1 -2
- package/src-web/share.d.ts +1 -2
- package/src-web/startUpdateLocation.d.ts +3 -5
package/src-web/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './getNetworkStatus';
|
|
|
7
7
|
export * from './getLocale';
|
|
8
8
|
export * from './getSchemeUri';
|
|
9
9
|
export * from './getDeviceId';
|
|
10
|
+
export * from './getPlatformOS';
|
|
10
11
|
export * from './setClipboardText';
|
|
11
12
|
export * from './getClipboardText';
|
|
12
13
|
export * from './fetchContacts';
|
|
@@ -14,4 +15,5 @@ export * from './fetchAlbumPhotos';
|
|
|
14
15
|
export * from './getCurrentLocation';
|
|
15
16
|
export * from './openCamera';
|
|
16
17
|
export * from './appLogin';
|
|
18
|
+
export * from './getOperationalEnvironment';
|
|
17
19
|
export * from './startUpdateLocation';
|
package/src-web/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const createEvents=()=>({emit(event,args){for(let callbacks=this.events[event]||[],i=0,length=callbacks.length;i<length;i++){callbacks[i](args)}},events:{},on(event,cb){var _this_events,_event;((_this_events=this.events)[_event=event]||(_this_events[_event]=[])).push(cb);return()=>{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(i=>cb!==i)}}});const createEventId=()=>Math.random().toString(36).substring(2,15);const deserializeError=value=>{if(value&&value.__isError){const err=new Error(value.message);err.name=value.name;err.stack=value.stack;return err}return value};window.__BEDROCK_NATIVE_EMITTER=createEvents();export function closeView(...args){if(!window.ReactNativeWebView){throw new Error("This closeView is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`closeView/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`closeView/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"closeView",eventId,args}))})}export function generateHapticFeedback(...args){if(!window.ReactNativeWebView){throw new Error("This generateHapticFeedback is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`generateHapticFeedback/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`generateHapticFeedback/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"generateHapticFeedback",eventId,args}))})}export function share(...args){if(!window.ReactNativeWebView){throw new Error("This share is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`share/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`share/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"share",eventId,args}))})}export function setSecureScreen(...args){if(!window.ReactNativeWebView){throw new Error("This setSecureScreen is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setSecureScreen/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setSecureScreen/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"setSecureScreen",eventId,args}))})}export function setScreenAwakeMode(...args){if(!window.ReactNativeWebView){throw new Error("This setScreenAwakeMode is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setScreenAwakeMode/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setScreenAwakeMode/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"setScreenAwakeMode",eventId,args}))})}export function getNetworkStatus(...args){if(!window.ReactNativeWebView){throw new Error("This getNetworkStatus is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getNetworkStatus/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getNetworkStatus/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"getNetworkStatus",eventId,args}))})}export function getLocale(){if(!window.ReactNativeWebView){throw new Error("This getLocale is not available in browser environment")}if("getLocale"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getLocale"]}throw new Error("getLocale is not a constant handler")}export function getSchemeUri(){if(!window.ReactNativeWebView){throw new Error("This getSchemeUri is not available in browser environment")}if("getSchemeUri"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getSchemeUri"]}throw new Error("getSchemeUri is not a constant handler")}export function getDeviceId(){if(!window.ReactNativeWebView){throw new Error("This getDeviceId is not available in browser environment")}if("getDeviceId"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getDeviceId"]}throw new Error("getDeviceId is not a constant handler")}export function setClipboardText(...args){if(!window.ReactNativeWebView){throw new Error("This setClipboardText is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setClipboardText/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setClipboardText/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"setClipboardText",eventId,args}))})}export function getClipboardText(...args){if(!window.ReactNativeWebView){throw new Error("This getClipboardText is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getClipboardText/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getClipboardText/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"getClipboardText",eventId,args}))})}export function fetchContacts(...args){if(!window.ReactNativeWebView){throw new Error("This fetchContacts is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchContacts/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchContacts/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"fetchContacts",eventId,args}))})}export function fetchAlbumPhotos(...args){if(!window.ReactNativeWebView){throw new Error("This fetchAlbumPhotos is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchAlbumPhotos/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchAlbumPhotos/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"fetchAlbumPhotos",eventId,args}))})}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 function getCurrentLocation(...args){if(!window.ReactNativeWebView){throw new Error("This getCurrentLocation is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getCurrentLocation/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getCurrentLocation/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"getCurrentLocation",eventId,args}))})}export function openCamera(...args){if(!window.ReactNativeWebView){throw new Error("This openCamera is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`openCamera/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`openCamera/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"openCamera",eventId,args}))})}export function appLogin(...args){if(!window.ReactNativeWebView){throw new Error("This appLogin is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`appLogin/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`appLogin/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"appLogin",eventId,args}))})}export function startUpdateLocation({onEvent,onError,options}){if(!window.ReactNativeWebView){onError(new Error("This startUpdateLocation is not available in browser environment"));return()=>{}}const eventId=createEventId();const removes=[window.__BEDROCK_NATIVE_EMITTER.on(`startUpdateLocation/onEvent/${eventId}`,response=>{onEvent(response)}),window.__BEDROCK_NATIVE_EMITTER.on(`startUpdateLocation/onError/${eventId}`,error=>{onError(deserializeError(error))})];window.ReactNativeWebView.postMessage(JSON.stringify({type:"addEventListener",functionName:"startUpdateLocation",eventId,args:options}));return()=>{window.ReactNativeWebView.postMessage(JSON.stringify({type:"removeEventListener",functionName:"startUpdateLocation",eventId}));for(const remove of removes){remove()}}}
|
|
1
|
+
export const createEvents=()=>({emit(event,args){for(let callbacks=this.events[event]||[],i=0,length=callbacks.length;i<length;i++){callbacks[i](args)}},events:{},on(event,cb){var _this_events,_event;((_this_events=this.events)[_event=event]||(_this_events[_event]=[])).push(cb);return()=>{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(i=>cb!==i)}}});const createEventId=()=>Math.random().toString(36).substring(2,15);const deserializeError=value=>{if(value&&value.__isError){const err=new Error(value.message);err.name=value.name;err.stack=value.stack;return err}return value};window.__BEDROCK_NATIVE_EMITTER=createEvents();export function closeView(...args){if(!window.ReactNativeWebView){throw new Error("This closeView is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`closeView/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`closeView/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"closeView",eventId,args}))})}export function generateHapticFeedback(...args){if(!window.ReactNativeWebView){throw new Error("This generateHapticFeedback is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`generateHapticFeedback/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`generateHapticFeedback/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"generateHapticFeedback",eventId,args}))})}export function share(...args){if(!window.ReactNativeWebView){throw new Error("This share is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`share/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`share/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"share",eventId,args}))})}export function setSecureScreen(...args){if(!window.ReactNativeWebView){throw new Error("This setSecureScreen is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setSecureScreen/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setSecureScreen/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"setSecureScreen",eventId,args}))})}export function setScreenAwakeMode(...args){if(!window.ReactNativeWebView){throw new Error("This setScreenAwakeMode is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setScreenAwakeMode/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setScreenAwakeMode/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"setScreenAwakeMode",eventId,args}))})}export function getNetworkStatus(...args){if(!window.ReactNativeWebView){throw new Error("This getNetworkStatus is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getNetworkStatus/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getNetworkStatus/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"getNetworkStatus",eventId,args}))})}export function getLocale(){if(!window.ReactNativeWebView){throw new Error("This getLocale is not available in browser environment")}if("getLocale"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getLocale"]}throw new Error("getLocale is not a constant handler")}export function getSchemeUri(){if(!window.ReactNativeWebView){throw new Error("This getSchemeUri is not available in browser environment")}if("getSchemeUri"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getSchemeUri"]}throw new Error("getSchemeUri is not a constant handler")}export function getDeviceId(){if(!window.ReactNativeWebView){throw new Error("This getDeviceId is not available in browser environment")}if("getDeviceId"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getDeviceId"]}throw new Error("getDeviceId is not a constant handler")}export function getPlatformOS(){if(!window.ReactNativeWebView){throw new Error("This getPlatformOS is not available in browser environment")}if("getPlatformOS"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getPlatformOS"]}throw new Error("getPlatformOS is not a constant handler")}export function setClipboardText(...args){if(!window.ReactNativeWebView){throw new Error("This setClipboardText is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setClipboardText/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`setClipboardText/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"setClipboardText",eventId,args}))})}export function getClipboardText(...args){if(!window.ReactNativeWebView){throw new Error("This getClipboardText is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getClipboardText/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getClipboardText/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"getClipboardText",eventId,args}))})}export function fetchContacts(...args){if(!window.ReactNativeWebView){throw new Error("This fetchContacts is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchContacts/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchContacts/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"fetchContacts",eventId,args}))})}export function fetchAlbumPhotos(...args){if(!window.ReactNativeWebView){throw new Error("This fetchAlbumPhotos is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchAlbumPhotos/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`fetchAlbumPhotos/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"fetchAlbumPhotos",eventId,args}))})}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 function getCurrentLocation(...args){if(!window.ReactNativeWebView){throw new Error("This getCurrentLocation is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getCurrentLocation/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`getCurrentLocation/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"getCurrentLocation",eventId,args}))})}export function openCamera(...args){if(!window.ReactNativeWebView){throw new Error("This openCamera is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`openCamera/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`openCamera/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"openCamera",eventId,args}))})}export function appLogin(...args){if(!window.ReactNativeWebView){throw new Error("This appLogin is not available in browser environment")}const eventId=createEventId();const emitters=[];const unsubscribe=()=>{for(const emitter of emitters){emitter()}};return new Promise((resolve,reject)=>{emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`appLogin/resolve/${eventId}`,args=>{unsubscribe();resolve(args)}));emitters.push(window.__BEDROCK_NATIVE_EMITTER.on(`appLogin/reject/${eventId}`,error=>{unsubscribe();reject(deserializeError(error))}));window.ReactNativeWebView.postMessage(JSON.stringify({type:"method",functionName:"appLogin",eventId,args}))})}export function getOperationalEnvironment(){if(!window.ReactNativeWebView){throw new Error("This getOperationalEnvironment is not available in browser environment")}if("getOperationalEnvironment"in window.__CONSTANT_HANDLER_MAP){return window.__CONSTANT_HANDLER_MAP["getOperationalEnvironment"]}throw new Error("getOperationalEnvironment is not a constant handler")}export function startUpdateLocation({onEvent,onError,options}){if(!window.ReactNativeWebView){onError(new Error("This startUpdateLocation is not available in browser environment"));return()=>{}}const eventId=createEventId();const removes=[window.__BEDROCK_NATIVE_EMITTER.on(`startUpdateLocation/onEvent/${eventId}`,response=>{onEvent(response)}),window.__BEDROCK_NATIVE_EMITTER.on(`startUpdateLocation/onError/${eventId}`,error=>{onError(deserializeError(error))})];window.ReactNativeWebView.postMessage(JSON.stringify({type:"addEventListener",functionName:"startUpdateLocation",eventId,args:options}));return()=>{window.ReactNativeWebView.postMessage(JSON.stringify({type:"removeEventListener",functionName:"startUpdateLocation",eventId}));for(const remove of removes){remove()}}}
|
package/src-web/openCamera.d.ts
CHANGED
|
@@ -23,9 +23,7 @@ export interface OpenCameraOptions {
|
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* @public
|
|
26
|
-
* @
|
|
27
|
-
* @category AppsInTossModules
|
|
28
|
-
* @kind function
|
|
26
|
+
* @category 카메라
|
|
29
27
|
* @name openCamera
|
|
30
28
|
* @description 카메라를 실행해서 촬영된 이미지를 반환하는 함수예요.
|
|
31
29
|
* @param {OpenCameraOptions} options - 카메라 실행 시 사용되는 옵션 객체예요.
|
package/src-web/share.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare enum Accuracy {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* @public
|
|
35
|
-
* @category
|
|
35
|
+
* @category 위치 정보
|
|
36
36
|
* @name Location
|
|
37
37
|
* @description 위치 정보를 나타내는 객체예요.
|
|
38
38
|
*/
|
|
@@ -57,7 +57,7 @@ export interface Location {
|
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* @public
|
|
60
|
-
* @category
|
|
60
|
+
* @category 위치 정보
|
|
61
61
|
* @name LocationCoords
|
|
62
62
|
* @description 세부 위치 정보를 나타내는 객체예요.
|
|
63
63
|
*/
|
|
@@ -117,9 +117,7 @@ export interface UpdateLocationEventEmitter extends EventEmitterSchema<"updateLo
|
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
119
119
|
* @public
|
|
120
|
-
* @
|
|
121
|
-
* @category AppsInTossModules
|
|
122
|
-
* @kind function
|
|
120
|
+
* @category 위치 정보
|
|
123
121
|
* @name startUpdateLocation
|
|
124
122
|
* @description 디바이스의 위치 정보를 지속적으로 감지하고, 위치가 변경되면 콜백을 실행하는 함수예요. 콜백 함수를 등록하면 위치가 변경될 때마다 자동으로 호출돼요.
|
|
125
123
|
* 실시간 위치 추적이 필요한 기능을 구현할 때 사용할 수 있어요. 예를 들어 지도 앱에서 사용자의 현재 위치를 실시간으로 업데이트할 때, 운동 앱에서 사용자의 이동 거리를 기록할 때 등이에요.
|