webuix 0.0.13 → 0.0.15

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/index.cjs.js CHANGED
@@ -1 +1 @@
1
- var{defineProperty:v,getOwnPropertyNames:w,getOwnPropertyDescriptor:m}=Object,b=Object.prototype.hasOwnProperty;var W=new WeakMap,h=(r)=>{var n=W.get(r),t;if(n)return n;if(n=v({},"__esModule",{value:!0}),r&&typeof r==="object"||typeof r==="function")w(r).map((e)=>!b.call(n,e)&&v(n,e,{get:()=>r[e],enumerable:!(t=m(r,e))||t.enumerable}));return W.set(r,n),n};var g=(r,n)=>{for(var t in n)v(r,t,{get:n[t],enumerable:!0,configurable:!0,set:(e)=>n[t]=()=>e})};var x={};g(x,{wrapToReadableStream:()=>d,wrapOutputStream:()=>y,wrapInputStream:()=>u,WXEventHandler:()=>c,WXEvent:()=>o});module.exports=h(x);var f={chunkSize:1048576,headers:{"Content-Type":"application/octet-stream"}};async function d(r,n={}){let t={...f,...n};return new Promise((e,i)=>{let a;try{if(a=r,!a)throw new Error("Failed to open file input stream")}catch(s){i(s);return}let l=()=>{try{a?.close()}catch(s){console.error("Error during abort cleanup:",s)}i(new DOMException("The operation was aborted.","AbortError"))};if(t.signal){if(t.signal.aborted){l();return}t.signal.addEventListener("abort",l)}let X=new ReadableStream({async pull(s){try{let p=O(a,t.chunkSize);if(!p){s.close(),E();return}s.enqueue(p)}catch(p){E(),s.error(p),i(new Error(`Error reading file chunk: ${p}`))}},cancel(s){console.warn("Stream canceled:",s),E()}});function E(){try{if(t.signal)t.signal.removeEventListener("abort",l);a?.close()}catch(s){console.error(`Error during cleanup: ${s}`)}}e(X)})}function O(r,n){try{let t=n?r.readChunk(n):r.read();if(typeof t==="number")return new Uint8Array([t]);else if(typeof t==="string"){let e=JSON.parse(t);return e&&Array.isArray(e)&&e.length>0?new Uint8Array(e):null}return null}catch(t){throw new Error("Error reading chunk data: "+t)}}async function u(r,n={}){let t={...f,...n};try{let e=await d(r,t);return new Response(e,t)}catch(e){throw new Error(`wrapInputStream failed: ${e}`)}}async function y(r,n){if(!r||typeof r.getReader!=="function")throw new Error("Invalid ReadableStream provided.");if(!n||typeof n.write!=="function"||typeof n.close!=="function")throw new Error("Invalid outputStreamInstance provided. It must be an already opened stream with 'write' and 'close' methods.");let t=new WritableStream({async start(e){console.log("WritableStream started, output stream instance ready.")},async write(e,i){if(e instanceof Uint8Array)for(let a=0;a<e.length;a++)n.write(e[a]);else console.warn("Received non-Uint8Array chunk in WritableStream:",e),i.error(new TypeError("Expected Uint8Array chunks."))},async close(){console.log("WritableStream closed. Flushing and closing native stream.");try{n.flush(),n.close()}catch(e){throw console.error("Error during WritableStream close cleanup:",e),e}},async abort(e){console.error("WritableStream aborted:",e);try{n.close()}catch(i){console.error("Error during WritableStream abort cleanup:",i)}}});try{await r.pipeTo(t),console.log("Piping completed successfully.")}catch(e){let i=e instanceof Error?e:new Error(String(e));throw console.error("Error during stream piping:",i),new Error(`Failed to pipe stream: ${i.message}`)}}class o extends Event{_wxOrigin;_wxData;get wxOrigin(){return this._wxOrigin}set wxOrigin(r){this._wxOrigin=r}get wx(){return this._wxData}set wx(r){this._wxData=r}constructor(r){super(r,{bubbles:!0,cancelable:!0,composed:!0})}}var _={cordova:!1};class c{_initialized=!1;_handlers=new WeakMap;_eventTypes;get eventTypes(){return this._eventTypes}constructor(r=_){if(this._initialized)return;this._initialized=!0,this._eventTypes={WX_ON_BACK:r.cordova?"backbutton":"back",WX_ON_RESUME:"resume",WX_ON_REFRESH:"refresh",WX_ON_PAUSE:"pause",WX_ON_KEYBOARD:"keyboard",WX_ON_INSETS:"insets"},window.addEventListener("message",(n)=>{try{if(typeof n.data!=="string")return;let t=JSON.parse(n.data);if(!t?.type)return;let e=this._eventTypes[t.type]??t.type;this._dispatch(window,e,t)}catch(t){console.error("[WXEvent] Message error:",t)}})}_dispatch(r,n,t){let e=new o(n);e.wx=t.data,e.wxOrigin="system",r.dispatchEvent(e)}on(r,n,t){if(!this._initialized)new c;let e=(a)=>{if(!(a instanceof o)){console.warn("[WXEvent] Event is not a WXEvent:",a);return}if(a.wxOrigin==="system"){if(typeof t==="function")t(a);else if(t&&typeof t.handleEvent==="function")t.handleEvent(a)}};if(!this._handlers.has(r))this._handlers.set(r,new Map);let i=this._handlers.get(r);if(!i.has(n))i.set(n,new Set);return i.get(n).add({handler:t,wrapper:e}),r.addEventListener(n,e),()=>this.off(r,n,t)}off(r,n,t){let e=this._handlers.get(r);if(!e?.has(n))return;for(let i of e.get(n))if(i.handler===t){r.removeEventListener(n,i.wrapper),e.get(n).delete(i);break}}}
1
+ var{defineProperty:v,getOwnPropertyNames:O,getOwnPropertyDescriptor:_}=Object,x=Object.prototype.hasOwnProperty;var w=new WeakMap,h=(e)=>{var t=w.get(e),n;if(t)return t;if(t=v({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function")O(e).map((r)=>!x.call(t,r)&&v(t,r,{get:()=>e[r],enumerable:!(n=_(e,r))||n.enumerable}));return w.set(e,t),t};var T=(e,t)=>{for(var n in t)v(e,n,{get:t[n],enumerable:!0,configurable:!0,set:(r)=>t[n]=()=>r})};var R={};T(R,{wrapToReadableStream:()=>E,wrapOutputStream:()=>u,wrapInputStream:()=>y,WebUI:()=>X,WXEventHandler:()=>f,WXEvent:()=>a,Intent:()=>W});module.exports=h(R);var c={chunkSize:1048576,headers:{"Content-Type":"application/octet-stream"}};async function E(e,t={}){let n={...c,...t};return new Promise((r,i)=>{let s;try{if(s=e,!s)throw new Error("Failed to open file input stream")}catch(o){i(o);return}let l=()=>{try{s?.close()}catch(o){console.error("Error during abort cleanup:",o)}i(new DOMException("The operation was aborted.","AbortError"))};if(n.signal){if(n.signal.aborted){l();return}n.signal.addEventListener("abort",l)}let b=new ReadableStream({async pull(o){try{let p=g(s,n.chunkSize);if(!p){o.close(),d();return}o.enqueue(p)}catch(p){d(),o.error(p),i(new Error(`Error reading file chunk: ${p}`))}},cancel(o){console.warn("Stream canceled:",o),d()}});function d(){try{if(n.signal)n.signal.removeEventListener("abort",l);s?.close()}catch(o){console.error(`Error during cleanup: ${o}`)}}r(b)})}function g(e,t){try{let n=t?e.readChunk(t):e.read();if(typeof n==="number")return new Uint8Array([n]);else if(typeof n==="string"){let r=JSON.parse(n);return r&&Array.isArray(r)&&r.length>0?new Uint8Array(r):null}return null}catch(n){throw new Error("Error reading chunk data: "+n)}}async function y(e,t={}){let n={...c,...t};try{let r=await E(e,n);return new Response(r,n)}catch(r){throw new Error(`wrapInputStream failed: ${r}`)}}async function u(e,t){if(!e||typeof e.getReader!=="function")throw new Error("Invalid ReadableStream provided.");if(!t||typeof t.write!=="function"||typeof t.close!=="function")throw new Error("Invalid outputStreamInstance provided. It must be an already opened stream with 'write' and 'close' methods.");let n=new WritableStream({async start(r){console.log("WritableStream started, output stream instance ready.")},async write(r,i){if(r instanceof Uint8Array)for(let s=0;s<r.length;s++)t.write(r[s]);else console.warn("Received non-Uint8Array chunk in WritableStream:",r),i.error(new TypeError("Expected Uint8Array chunks."))},async close(){console.log("WritableStream closed. Flushing and closing native stream.");try{t.flush(),t.close()}catch(r){throw console.error("Error during WritableStream close cleanup:",r),r}},async abort(r){console.error("WritableStream aborted:",r);try{t.close()}catch(i){console.error("Error during WritableStream abort cleanup:",i)}}});try{await e.pipeTo(n),console.log("Piping completed successfully.")}catch(r){let i=r instanceof Error?r:new Error(String(r));throw console.error("Error during stream piping:",i),new Error(`Failed to pipe stream: ${i.message}`)}}class a extends Event{_wxOrigin;_wxData;get wxOrigin(){return this._wxOrigin}set wxOrigin(e){this._wxOrigin=e}get wx(){return this._wxData}set wx(e){this._wxData=e}constructor(e){super(e,{bubbles:!0,cancelable:!0,composed:!0})}}var m={cordova:!1};class f{_initialized=!1;_handlers=new WeakMap;_eventTypes;get eventTypes(){return this._eventTypes}constructor(e=m){if(this._initialized)return;this._initialized=!0,this._eventTypes={WX_ON_BACK:e.cordova?"backbutton":"back",WX_ON_RESUME:"resume",WX_ON_REFRESH:"refresh",WX_ON_PAUSE:"pause",WX_ON_KEYBOARD:"keyboard",WX_ON_INSETS:"insets"},window.addEventListener("message",(t)=>{try{if(typeof t.data!=="string")return;let n=JSON.parse(t.data);if(!n?.type)return;let r=this._eventTypes[n.type]??n.type;this._dispatch(window,r,n)}catch(n){console.error("[WXEvent] Message error:",n)}})}_dispatch(e,t,n){let r=new a(t);r.wx=n.data,r.wxOrigin="system",e.dispatchEvent(r)}on(e,t,n){if(!this._initialized)new f;let r=(s)=>{if(!(s instanceof a)){console.warn("[WXEvent] Event is not a WXEvent:",s);return}if(s.wxOrigin==="system"){if(typeof n==="function")n(s);else if(n&&typeof n.handleEvent==="function")n.handleEvent(s)}};if(!this._handlers.has(e))this._handlers.set(e,new Map);let i=this._handlers.get(e);if(!i.has(t))i.set(t,new Set);return i.get(t).add({handler:n,wrapper:r}),e.addEventListener(t,r),()=>this.off(e,t,n)}off(e,t,n){let r=this._handlers.get(e);if(!r?.has(t))return;for(let i of r.get(t))if(i.handler===n){e.removeEventListener(t,i.wrapper),r.get(t).delete(i);break}}}class W{_action;_interface=null;constructor(e){if(this._action=e,typeof window==="undefined"||!window.$intent||typeof window.$intent.create!=="function")console.warn("window['$intent'] or window['$intent'].create is not defined. Intent functionality may be limited.");else this._interface=window.$intent.create(this._action)}getParsedIntent(){return this._interface}setData(e){if(this._interface&&typeof this._interface.setData==="function")this._interface.setData(e);else console.error("setData method not available on the intent interface.")}setPackage(e){if(this._interface&&typeof this._interface.setPackage==="function")this._interface.setPackage(e);else console.error("setPackage method not available on the intent interface.")}addCategory(e){if(this._interface&&typeof this._interface.addCategory==="function")this._interface.addCategory(e);else console.error("addCategory method not available on the intent interface.")}setType(e){if(this._interface&&typeof this._interface.setType==="function")this._interface.setType(e);else console.error("setType method not available on the intent interface.")}putExtra(e,t){if(this._interface&&typeof this._interface.putExtra==="function")this._interface.putExtra(e,t);else console.error("putExtra method not available on the intent interface.")}getStringExtra(e){if(this._interface&&typeof this._interface.getStringExtra==="function")return this._interface.getStringExtra(e);else return console.error("getStringExtra method not available on the intent interface."),null}getIntExtra(e){if(this._interface&&typeof this._interface.getIntExtra==="function")return this._interface.getIntExtra(e);else return console.error("getIntExtra method not available on the intent interface."),0}getBooleanExtra(e){if(this._interface&&typeof this._interface.getBooleanExtra==="function")return this._interface.getBooleanExtra(e);else return console.error("getBooleanExtra method not available on the intent interface."),!1}static ACTION_MAIN="android.intent.action.MAIN";static ACTION_VIEW="android.intent.action.VIEW";static ACTION_ATTACH_DATA="android.intent.action.ATTACH_DATA";static ACTION_EDIT="android.intent.action.EDIT";static ACTION_PICK="android.intent.action.PICK";static ACTION_CHOOSER="android.intent.action.CHOOSER";static ACTION_GET_CONTENT="android.intent.action.GET_CONTENT";static ACTION_DIAL="android.intent.action.DIAL";static ACTION_CALL="android.intent.action.CALL";static ACTION_SEND="android.intent.action.SEND";static ACTION_SENDTO="android.intent.action.SENDTO";static ACTION_SEND_MULTIPLE="android.intent.action.SEND_MULTIPLE";static ACTION_SYNC="android.intent.action.SYNC";static ACTION_BATTERY_LOW="android.intent.action.BATTERY_LOW";static ACTION_BATTERY_OKAY="android.intent.action.BATTERY_OKAY";static ACTION_BOOT_COMPLETED="android.intent.action.BOOT_COMPLETED";static ACTION_CAMERA_BUTTON="android.intent.action.CAMERA_BUTTON";static ACTION_CLOSE_SYSTEM_DIALOGS="android.intent.action.CLOSE_SYSTEM_DIALOGS";static ACTION_DEVICE_STORAGE_LOW="android.intent.action.DEVICE_STORAGE_LOW";static ACTION_DEVICE_STORAGE_OK="android.intent.action.DEVICE_STORAGE_OK";static ACTION_EXTERNAL_APPLICATIONS_AVAILABLE="android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE";static ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE="android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE";static ACTION_LOCALE_CHANGED="android.intent.action.LOCALE_CHANGED";static ACTION_MEDIA_BAD_REMOVAL="android.intent.action.MEDIA_BAD_REMOVAL";static ACTION_MEDIA_BUTTON="android.intent.action.MEDIA_BUTTON";static ACTION_MEDIA_CHECKING="android.intent.action.MEDIA_CHECKING";static ACTION_MEDIA_EJECT="android.intent.action.MEDIA_EJECT";static ACTION_MEDIA_MOUNTED="android.intent.action.MEDIA_MOUNTED";static ACTION_MEDIA_NOFS="android.intent.action.MEDIA_NOFS";static ACTION_MEDIA_REMOVED="android.intent.action.MEDIA_REMOVED";static ACTION_MEDIA_SCANNER_FINISHED="android.intent.action.MEDIA_SCANNER_FINISHED";static ACTION_MEDIA_SCANNER_SCAN_FILE="android.intent.action.MEDIA_SCANNER_SCAN_FILE";static ACTION_MEDIA_SCANNER_STARTED="android.intent.action.MEDIA_SCANNER_STARTED";static ACTION_MEDIA_SHARED="android.intent.action.MEDIA_SHARED";static ACTION_MEDIA_UNMOUNTABLE="android.intent.action.MEDIA_UNMOUNTABLE";static ACTION_MEDIA_UNMOUNTED="android.intent.action.MEDIA_UNMOUNTED";static ACTION_NEW_OUTGOING_CALL="android.intent.action.NEW_OUTGOING_CALL";static ACTION_PACKAGE_ADDED="android.intent.action.PACKAGE_ADDED";static ACTION_PACKAGE_CHANGED="android.intent.action.PACKAGE_CHANGED";static ACTION_PACKAGE_DATA_CLEARED="android.intent.action.PACKAGE_DATA_CLEARED";static ACTION_PACKAGE_FULLY_REMOVED="android.intent.action.PACKAGE_FULLY_REMOVED";static ACTION_PACKAGE_INSTALL="android.intent.action.PACKAGE_INSTALL";static ACTION_PACKAGE_FIRST_LAUNCH="android.intent.action.PACKAGE_FIRST_LAUNCH";static ACTION_PACKAGE_NEEDS_VERIFICATION="android.intent.action.PACKAGE_NEEDS_VERIFICATION";static ACTION_PACKAGE_REMOVED="android.intent.action.PACKAGE_REMOVED";static ACTION_PACKAGE_REPLACED="android.intent.action.PACKAGE_REPLACED";static ACTION_PACKAGE_RESTARTED="android.intent.action.PACKAGE_RESTARTED";static ACTION_PACKAGE_VERIFIED="android.intent.action.PACKAGE_VERIFIED";static ACTION_POWER_CONNECTED="android.intent.action.POWER_CONNECTED";static ACTION_POWER_DISCONNECTED="android.intent.action.POWER_DISCONNECTED";static ACTION_PROVIDER_CHANGED="android.intent.action.PROVIDER_CHANGED";static ACTION_REBOOT="android.intent.action.REBOOT";static ACTION_SCREEN_OFF="android.intent.action.SCREEN_OFF";static ACTION_SCREEN_ON="android.intent.action.SCREEN_ON";static ACTION_SHUTDOWN="android.intent.action.SHUTDOWN";static ACTION_TIME_CHANGED="android.intent.action.TIME_CHANGED";static ACTION_TIME_TICK="android.intent.action.TIME_TICK";static ACTION_TIMEZONE_CHANGED="android.intent.action.TIMEZONE_CHANGED";static ACTION_UID_REMOVED="android.intent.action.UID_REMOVED";static ACTION_USER_BACKGROUND="android.intent.action.USER_BACKGROUND";static ACTION_USER_FOREGROUND="android.intent.action.USER_FOREGROUND";static ACTION_USER_INITIALIZE="android.intent.action.USER_INITIALIZE";static ACTION_USER_PRESENT="android.intent.action.USER_PRESENT";static ACTION_USER_UNLOCKED="android.intent.action.USER_UNLOCKED";static ACTION_WALLPAPER_CHANGED="android.intent.action.WALLPAPER_CHANGED";static ACTION_AIRPLANE_MODE_CHANGED="android.intent.action.AIRPLANE_MODE";static ACTION_ANSWER="android.intent.action.ANSWER";static ACTION_DREAMING_STARTED="android.intent.action.DREAMING_STARTED";static ACTION_DREAMING_STOPPED="android.intent.action.DREAMING_STOPPED";static ACTION_INPUT_METHOD_CHANGED="android.intent.action.INPUT_METHOD_CHANGED";static ACTION_HEADSET_PLUG="android.intent.action.HEADSET_PLUG";static ACTION_MANAGE_PACKAGE_STORAGE="android.intent.action.MANAGE_PACKAGE_STORAGE";static ACTION_MY_PACKAGE_REPLACED="android.intent.action.MY_PACKAGE_REPLACED";static ACTION_PREFERRED_APPLICATIONS_CHANGED="android.intent.action.PREFERRED_APPLICATIONS_CHANGED";static ACTION_RADIO_POWER_RESET="android.intent.action.RADIO_POWER_RESET";static ACTION_UMS_CONNECTED="android.intent.action.UMS_CONNECTED";static ACTION_UMS_DISCONNECTED="android.intent.action.UMS_DISCONNECTED";static ACTION_USER_ADDED="android.intent.action.USER_ADDED";static ACTION_USER_REMOVED="android.intent.action.USER_REMOVED";static ACTION_USER_STOPPED="android.intent.action.USER_STOPPED";static ACTION_VPN_SETTINGS="android.intent.action.VPN_SETTINGS";static ACTION_INSTALL_FAILURE="android.intent.action.INSTALL_FAILURE";static ACTION_INSTALL_PACKAGE="android.intent.action.INSTALL_PACKAGE";static ACTION_UNINSTALL_PACKAGE="android.intent.action.UNINSTALL_PACKAGE";static ACTION_APPLICATION_SETTINGS="android.intent.action.APPLICATION_SETTINGS";static ACTION_DATA_ROAMING_SETTINGS="android.intent.action.DATA_ROAMING_SETTINGS";static ACTION_DATE_SETTINGS="android.intent.action.DATE_SETTINGS";static ACTION_DEVICE_INFO_SETTINGS="android.intent.action.DEVICE_INFO_SETTINGS";static ACTION_DISPLAY_SETTINGS="android.intent.action.DISPLAY_SETTINGS";static ACTION_HOME_SETTINGS="android.intent.action.HOME_SETTINGS";static ACTION_LOCATION_SOURCE_SETTINGS="android.intent.action.LOCATION_SOURCE_SETTINGS";static ACTION_NETWORK_SETTINGS="android.intent.action.NETWORK_SETTINGS";static ACTION_NFC_SETTINGS="android.intent.action.NFC_SETTINGS";static ACTION_PRIVACY_SETTINGS="android.intent.action.PRIVACY_SETTINGS";static ACTION_SEARCH_SETTINGS="android.intent.action.SEARCH_SETTINGS";static ACTION_SECURITY_SETTINGS="android.intent.action.SECURITY_SETTINGS";static ACTION_SETTINGS="android.intent.action.SETTINGS";static ACTION_SOUND_SETTINGS="android.intent.action.SOUND_SETTINGS";static ACTION_SYNC_SETTINGS="android.intent.action.SYNC_SETTINGS";static ACTION_USAGE_ACCESS_SETTINGS="android.intent.action.USAGE_ACCESS_SETTINGS";static ACTION_WIFI_IP_SETTINGS="android.intent.action.WIFI_IP_SETTINGS";static ACTION_WIFI_SETTINGS="android.intent.action.WIFI_SETTINGS";static ACTION_WIRELESS_SETTINGS="android.intent.action.WIRELESS_SETTINGS";static ACTION_BLUETOOTH_SETTINGS="android.intent.action.BLUETOOTH_SETTINGS";static ACTION_ACCESSIBILITY_SETTINGS="android.intent.action.ACCESSIBILITY_SETTINGS";static ACTION_ACCOUNT_SETTINGS="android.intent.action.ACCOUNT_SETTINGS";static ACTION_ADD_ACCOUNT="android.intent.action.ADD_ACCOUNT";static ACTION_APPLICATION_DETAILS_SETTINGS="android.intent.action.APPLICATION_DETAILS_SETTINGS";static ACTION_APPLICATION_DEVELOPMENT_SETTINGS="android.intent.action.APPLICATION_DEVELOPMENT_SETTINGS";static ACTION_WEB_SEARCH="android.intent.action.WEB_SEARCH";static ACTION_CREATE_SHORTCUT="android.intent.action.CREATE_SHORTCUT";static EXTRA_STREAM="android.intent.extra.STREAM";static EXTRA_TEXT="android.intent.extra.TEXT";static EXTRA_EMAIL="android.intent.extra.EMAIL";static EXTRA_CC="android.intent.extra.CC";static EXTRA_BCC="android.intent.extra.BCC";static EXTRA_SUBJECT="android.intent.extra.SUBJECT";static EXTRA_REFERRER="android.intent.extra.REFERRER";static EXTRA_REFERRER_NAME="android.intent.extra.REFERRER_NAME";static EXTRA_PHONE_NUMBER="android.intent.extra.PHONE_NUMBER";static EXTRA_LOCAL_ONLY="android.intent.extra.LOCAL_ONLY";static EXTRA_INITIAL_INTENTS="android.intent.extra.INITIAL_INTENTS";static EXTRA_CHOSEN_COMPONENT="android.intent.extra.CHOSEN_COMPONENT";static EXTRA_SHORTCUT_INTENT="android.intent.extra.SHORTCUT_INTENT";static EXTRA_SHORTCUT_NAME="android.intent.extra.SHORTCUT_NAME";static EXTRA_SHORTCUT_ICON="android.intent.extra.SHORTCUT_ICON";static EXTRA_SHORTCUT_ICON_RESOURCE="android.intent.extra.SHORTCUT_ICON_RESOURCE";static EXTRA_TITLE="android.intent.extra.TITLE";static EXTRA_HTML_TEXT="android.intent.extra.HTML_TEXT";static EXTRA_ASSIST_CONTEXT="android.intent.extra.ASSIST_CONTEXT";static EXTRA_ASSIST_INPUT_DEVICE_ID="android.intent.extra.ASSIST_INPUT_DEVICE_ID";static EXTRA_ASSIST_INPUT_METHOD_MANAGER_SERVICE="android.intent.extra.ASSIST_INPUT_METHOD_MANAGER_SERVICE";static EXTRA_ASSIST_SCREENSHOT="android.intent.extra.ASSIST_SCREENSHOT";static EXTRA_ASSIST_URI="android.intent.extra.ASSIST_URI";static EXTRA_ORIGINATING_URI="android.intent.extra.ORIGINATING_URI";static EXTRA_WEB_SEARCH_INTENT="android.intent.extra.WEB_SEARCH_INTENT";static EXTRA_MEDIA_ALBUM="android.intent.extra.MEDIA_ALBUM";static EXTRA_MEDIA_ARTIST="android.intent.extra.MEDIA_ARTIST";static EXTRA_MEDIA_FOCUS="android.intent.extra.MEDIA_FOCUS";static EXTRA_MEDIA_GENRE="android.intent.extra.MEDIA_GENRE";static EXTRA_MEDIA_TITLE="android.intent.extra.MEDIA_TITLE";static EXTRA_ALARM_COUNT="android.intent.extra.ALARM_COUNT";static EXTRA_CHANGED_COMPONENT_NAME_LIST="android.intent.extra.CHANGED_COMPONENT_NAME_LIST";static EXTRA_CHANGED_PACKAGE_LIST="android.intent.extra.CHANGED_PACKAGE_LIST";static EXTRA_CHANGED_UID_LIST="android.intent.extra.CHANGED_UID_LIST";static EXTRA_DATA_REMOVED="android.intent.extra.DATA_REMOVED";static EXTRA_DONT_KILL_APP="android.intent.extra.DONT_KILL_APP";static EXTRA_INSTALL_RESULT="android.intent.extra.INSTALL_RESULT";static EXTRA_KEY_EVENT="android.intent.extra.KEY_EVENT";static EXTRA_MIME_TYPES="android.intent.extra.MIME_TYPES";static EXTRA_MOUNT_FAILED="android.intent.extra.MOUNT_FAILED";static EXTRA_NOTIFICATION_ID="android.intent.extra.NOTIFICATION_ID";static EXTRA_NOTIFICATION_TAG="android.intent.extra.NOTIFICATION_TAG";static EXTRA_PACKAGES="android.intent.extra.PACKAGES";static EXTRA_REPLACING="android.intent.extra.REPLACING";static EXTRA_SPLIT_NAME="android.intent.extra.SPLIT_NAME";static EXTRA_SUSPENDED_PACKAGE_EXTRAS="android.intent.extra.SUSPENDED_PACKAGE_EXTRAS";static EXTRA_UID="android.intent.extra.UID";static EXTRA_USER="android.intent.extra.USER";static EXTRA_CHANNEL_ID="android.intent.extra.CHANNEL_ID";static EXTRA_REMOTE_INTENT_TOKEN="android.intent.extra.REMOTE_INTENT_TOKEN";static EXTRA_PERMISSION_GROUP_NAME="android.intent.extra.PERMISSION_GROUP_NAME";static EXTRA_PERMISSION_NAME="android.intent.extra.PERMISSION_NAME";static EXTRA_RESTRICTIONS_BUNDLE="android.intent.extra.RESTRICTIONS_BUNDLE";static EXTRA_RESTRICTIONS_INTENT="android.intent.extra.RESTRICTIONS_INTENT";static EXTRA_TIMEZONE="android.intent.extra.TIMEZONE";static EXTRA_DONT_REPLACE_EXISTING_APPLICATION_INFO="android.intent.extra.DONT_REPLACE_EXISTING_APPLICATION_INFO";static EXTRA_SPLASH_SCREEN_THEME="android.intent.extra.SPLASH_SCREEN_THEME";static EXTRA_SPLASH_SCREEN_ICON_ID="android.intent.extra.SPLASH_SCREEN_ICON_ID";static EXTRA_STREAM_MULTIPLE="android.intent.extra.STREAM_MULTIPLE";static EXTRA_EXCLUDE_COMPONENTS="android.intent.extra.EXCLUDE_COMPONENTS";static EXTRA_ALLOW_MULTIPLE="android.intent.extra.ALLOW_MULTIPLE";static EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE="android.intent.extra.PROVISIONING_ACCOUNT_TO_MIGRATE";static EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME="android.intent.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME";static EXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED="android.intent.extra.PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED";static EXTRA_PROVISIONING_LOCALE="android.intent.extra.PROVISIONING_LOCALE";static EXTRA_PROVISIONING_TIME_ZONE="android.intent.extra.PROVISIONING_TIME_ZONE";static EXTRA_PROVISIONING_WIFI_HIDDEN="android.intent.extra.PROVISIONING_WIFI_HIDDEN";static EXTRA_PROVISIONING_WIFI_PASSWORD="android.intent.extra.PROVISIONING_WIFI_PASSWORD";static EXTRA_PROVISIONING_WIFI_SECURITY_TYPE="android.intent.extra.PROVISIONING_WIFI_SECURITY_TYPE";static EXTRA_PROVISIONING_WIFI_SSID="android.intent.extra.PROVISIONING_WIFI_SSID"}class X{_interface=null;constructor(){if(typeof window==="undefined"||!window.webui)console.warn("window['webui'] is not defined. WebUI functionality may be limited.");else this._interface=window.webui}exit(){if(this._interface&&typeof this._interface.exit==="function")this._interface.exit();else console.error("exit method not available on the webui interface.")}setRefreshing(e){if(this._interface&&typeof this._interface.setRefreshing==="function")this._interface.setRefreshing(e);else console.error("setRefreshing method not available on the webui interface.")}get currentRootManager(){if(this._interface&&typeof this._interface.getCurrentRootManager!=="undefined")return this._interface.getCurrentRootManager();else return console.error("currentRootManager getter not available on the webui interface."),null}get currentApplication(){if(this._interface&&typeof this._interface.getCurrentApplication!=="undefined")return this._interface.getCurrentApplication();else return console.error("currentApplication getter not available on the webui interface."),null}getApplication(e){if(this._interface&&typeof this._interface.getApplication==="function")return this._interface.getApplication(e);else return console.error("getApplication method not available on the webui interface."),null}openFile(e){if(this._interface&&typeof this._interface.openFile==="function")this._interface.openFile(e.getParsedIntent());else console.error("openFile method not available on the webui interface.")}startActivity(e){if(this._interface&&typeof this._interface.startActivity==="function")this._interface.startActivity(e.getParsedIntent());else console.error("startActivity method not available on the webui interface.")}}
package/dist/index.d.ts CHANGED
@@ -87,5 +87,313 @@ export declare class WXEventHandler {
87
87
  on<K extends keyof WXEventMap>(element: Window | Element, type: K, handler: WXEventListenerOrWXEventListenerObject<WXEventMap[K]>): () => void;
88
88
  off(element: Window | Element, type: WXEventType, handler: WXEventListenerOrWXEventListenerObject): void;
89
89
  }
90
+ export interface IntentData {
91
+ setPackage(packageName: string): void;
92
+ setData(data: string): void;
93
+ addCategory(category: string): void;
94
+ setType(type: string): void;
95
+ getStringExtra(name: string): string | null;
96
+ getIntExtra(name: string, defaultValue?: number): number;
97
+ getBooleanExtra(name: string, defaultValue?: boolean): boolean;
98
+ putExtra(name: string, value: string | number | boolean): void;
99
+ }
100
+ export declare class Intent {
101
+ private _action;
102
+ private _interface;
103
+ /**
104
+ * Initializes a new Intent object.
105
+ * @param {string} action The action to be performed by this intent.
106
+ */
107
+ constructor(action: string);
108
+ getParsedIntent(): IntentData | null;
109
+ /**
110
+ * Sets the data URI for the intent.
111
+ * @param {string} data The data URI string.
112
+ */
113
+ setData(data: string): void;
114
+ /**
115
+ * Sets the package name for the intent.
116
+ * This method corresponds to `setPackage` in IntentData.
117
+ * @param {string} packageName The package name to set.
118
+ */
119
+ setPackage(packageName: string): void;
120
+ /**
121
+ * Adds a category to the intent.
122
+ * This method corresponds to `addCategory` in IntentData.
123
+ * @param {string} category The category to add.
124
+ */
125
+ addCategory(category: string): void;
126
+ /**
127
+ * Sets the MIME type for the intent.
128
+ * This method corresponds to `setType` in IntentData.
129
+ * @param {string} type The MIME type to set.
130
+ */
131
+ setType(type: string): void;
132
+ /**
133
+ * Adds extended data to the intent.
134
+ * This method corresponds to the `putExtra` overloads in IntentData.
135
+ * @param {string} name The name of the extra data.
136
+ * @param {(string|number|boolean)} value The value of the extra data.
137
+ */
138
+ putExtra(name: string, value: string | number | boolean): void;
139
+ /**
140
+ * Retrieves string extra data from the intent.
141
+ * This method corresponds to `getStringExtra` in IntentData.
142
+ * @param {string} name The name of the extra data.
143
+ * @returns {string | null} The string value, or null if not found.
144
+ */
145
+ getStringExtra(name: string): string | null;
146
+ /**
147
+ * Retrieves integer extra data from the intent.
148
+ * This method corresponds to `getIntExtra` in IntentData.
149
+ * @param {string} name The name of the extra data.
150
+ * @returns {number} The integer value, or the default value if not found.
151
+ */
152
+ getIntExtra(name: string): number;
153
+ /**
154
+ * Retrieves boolean extra data from the intent.
155
+ * This method corresponds to `getBooleanExtra` in IntentData.
156
+ * @param {string} name The name of the extra data.
157
+ * @returns {boolean} The boolean value, or the default value if not found.
158
+ */
159
+ getBooleanExtra(name: string): boolean;
160
+ static readonly ACTION_MAIN = "android.intent.action.MAIN";
161
+ static readonly ACTION_VIEW = "android.intent.action.VIEW";
162
+ static readonly ACTION_ATTACH_DATA = "android.intent.action.ATTACH_DATA";
163
+ static readonly ACTION_EDIT = "android.intent.action.EDIT";
164
+ static readonly ACTION_PICK = "android.intent.action.PICK";
165
+ static readonly ACTION_CHOOSER = "android.intent.action.CHOOSER";
166
+ static readonly ACTION_GET_CONTENT = "android.intent.action.GET_CONTENT";
167
+ static readonly ACTION_DIAL = "android.intent.action.DIAL";
168
+ static readonly ACTION_CALL = "android.intent.action.CALL";
169
+ static readonly ACTION_SEND = "android.intent.action.SEND";
170
+ static readonly ACTION_SENDTO = "android.intent.action.SENDTO";
171
+ static readonly ACTION_SEND_MULTIPLE = "android.intent.action.SEND_MULTIPLE";
172
+ static readonly ACTION_SYNC = "android.intent.action.SYNC";
173
+ static readonly ACTION_BATTERY_LOW = "android.intent.action.BATTERY_LOW";
174
+ static readonly ACTION_BATTERY_OKAY = "android.intent.action.BATTERY_OKAY";
175
+ static readonly ACTION_BOOT_COMPLETED = "android.intent.action.BOOT_COMPLETED";
176
+ static readonly ACTION_CAMERA_BUTTON = "android.intent.action.CAMERA_BUTTON";
177
+ static readonly ACTION_CLOSE_SYSTEM_DIALOGS = "android.intent.action.CLOSE_SYSTEM_DIALOGS";
178
+ static readonly ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
179
+ static readonly ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK";
180
+ static readonly ACTION_EXTERNAL_APPLICATIONS_AVAILABLE = "android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE";
181
+ static readonly ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE = "android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE";
182
+ static readonly ACTION_LOCALE_CHANGED = "android.intent.action.LOCALE_CHANGED";
183
+ static readonly ACTION_MEDIA_BAD_REMOVAL = "android.intent.action.MEDIA_BAD_REMOVAL";
184
+ static readonly ACTION_MEDIA_BUTTON = "android.intent.action.MEDIA_BUTTON";
185
+ static readonly ACTION_MEDIA_CHECKING = "android.intent.action.MEDIA_CHECKING";
186
+ static readonly ACTION_MEDIA_EJECT = "android.intent.action.MEDIA_EJECT";
187
+ static readonly ACTION_MEDIA_MOUNTED = "android.intent.action.MEDIA_MOUNTED";
188
+ static readonly ACTION_MEDIA_NOFS = "android.intent.action.MEDIA_NOFS";
189
+ static readonly ACTION_MEDIA_REMOVED = "android.intent.action.MEDIA_REMOVED";
190
+ static readonly ACTION_MEDIA_SCANNER_FINISHED = "android.intent.action.MEDIA_SCANNER_FINISHED";
191
+ static readonly ACTION_MEDIA_SCANNER_SCAN_FILE = "android.intent.action.MEDIA_SCANNER_SCAN_FILE";
192
+ static readonly ACTION_MEDIA_SCANNER_STARTED = "android.intent.action.MEDIA_SCANNER_STARTED";
193
+ static readonly ACTION_MEDIA_SHARED = "android.intent.action.MEDIA_SHARED";
194
+ static readonly ACTION_MEDIA_UNMOUNTABLE = "android.intent.action.MEDIA_UNMOUNTABLE";
195
+ static readonly ACTION_MEDIA_UNMOUNTED = "android.intent.action.MEDIA_UNMOUNTED";
196
+ static readonly ACTION_NEW_OUTGOING_CALL = "android.intent.action.NEW_OUTGOING_CALL";
197
+ static readonly ACTION_PACKAGE_ADDED = "android.intent.action.PACKAGE_ADDED";
198
+ static readonly ACTION_PACKAGE_CHANGED = "android.intent.action.PACKAGE_CHANGED";
199
+ static readonly ACTION_PACKAGE_DATA_CLEARED = "android.intent.action.PACKAGE_DATA_CLEARED";
200
+ static readonly ACTION_PACKAGE_FULLY_REMOVED = "android.intent.action.PACKAGE_FULLY_REMOVED";
201
+ static readonly ACTION_PACKAGE_INSTALL = "android.intent.action.PACKAGE_INSTALL";
202
+ static readonly ACTION_PACKAGE_FIRST_LAUNCH = "android.intent.action.PACKAGE_FIRST_LAUNCH";
203
+ static readonly ACTION_PACKAGE_NEEDS_VERIFICATION = "android.intent.action.PACKAGE_NEEDS_VERIFICATION";
204
+ static readonly ACTION_PACKAGE_REMOVED = "android.intent.action.PACKAGE_REMOVED";
205
+ static readonly ACTION_PACKAGE_REPLACED = "android.intent.action.PACKAGE_REPLACED";
206
+ static readonly ACTION_PACKAGE_RESTARTED = "android.intent.action.PACKAGE_RESTARTED";
207
+ static readonly ACTION_PACKAGE_VERIFIED = "android.intent.action.PACKAGE_VERIFIED";
208
+ static readonly ACTION_POWER_CONNECTED = "android.intent.action.POWER_CONNECTED";
209
+ static readonly ACTION_POWER_DISCONNECTED = "android.intent.action.POWER_DISCONNECTED";
210
+ static readonly ACTION_PROVIDER_CHANGED = "android.intent.action.PROVIDER_CHANGED";
211
+ static readonly ACTION_REBOOT = "android.intent.action.REBOOT";
212
+ static readonly ACTION_SCREEN_OFF = "android.intent.action.SCREEN_OFF";
213
+ static readonly ACTION_SCREEN_ON = "android.intent.action.SCREEN_ON";
214
+ static readonly ACTION_SHUTDOWN = "android.intent.action.SHUTDOWN";
215
+ static readonly ACTION_TIME_CHANGED = "android.intent.action.TIME_CHANGED";
216
+ static readonly ACTION_TIME_TICK = "android.intent.action.TIME_TICK";
217
+ static readonly ACTION_TIMEZONE_CHANGED = "android.intent.action.TIMEZONE_CHANGED";
218
+ static readonly ACTION_UID_REMOVED = "android.intent.action.UID_REMOVED";
219
+ static readonly ACTION_USER_BACKGROUND = "android.intent.action.USER_BACKGROUND";
220
+ static readonly ACTION_USER_FOREGROUND = "android.intent.action.USER_FOREGROUND";
221
+ static readonly ACTION_USER_INITIALIZE = "android.intent.action.USER_INITIALIZE";
222
+ static readonly ACTION_USER_PRESENT = "android.intent.action.USER_PRESENT";
223
+ static readonly ACTION_USER_UNLOCKED = "android.intent.action.USER_UNLOCKED";
224
+ static readonly ACTION_WALLPAPER_CHANGED = "android.intent.action.WALLPAPER_CHANGED";
225
+ static readonly ACTION_AIRPLANE_MODE_CHANGED = "android.intent.action.AIRPLANE_MODE";
226
+ static readonly ACTION_ANSWER = "android.intent.action.ANSWER";
227
+ static readonly ACTION_DREAMING_STARTED = "android.intent.action.DREAMING_STARTED";
228
+ static readonly ACTION_DREAMING_STOPPED = "android.intent.action.DREAMING_STOPPED";
229
+ static readonly ACTION_INPUT_METHOD_CHANGED = "android.intent.action.INPUT_METHOD_CHANGED";
230
+ static readonly ACTION_HEADSET_PLUG = "android.intent.action.HEADSET_PLUG";
231
+ static readonly ACTION_MANAGE_PACKAGE_STORAGE = "android.intent.action.MANAGE_PACKAGE_STORAGE";
232
+ static readonly ACTION_MY_PACKAGE_REPLACED = "android.intent.action.MY_PACKAGE_REPLACED";
233
+ static readonly ACTION_PREFERRED_APPLICATIONS_CHANGED = "android.intent.action.PREFERRED_APPLICATIONS_CHANGED";
234
+ static readonly ACTION_RADIO_POWER_RESET = "android.intent.action.RADIO_POWER_RESET";
235
+ static readonly ACTION_UMS_CONNECTED = "android.intent.action.UMS_CONNECTED";
236
+ static readonly ACTION_UMS_DISCONNECTED = "android.intent.action.UMS_DISCONNECTED";
237
+ static readonly ACTION_USER_ADDED = "android.intent.action.USER_ADDED";
238
+ static readonly ACTION_USER_REMOVED = "android.intent.action.USER_REMOVED";
239
+ static readonly ACTION_USER_STOPPED = "android.intent.action.USER_STOPPED";
240
+ static readonly ACTION_VPN_SETTINGS = "android.intent.action.VPN_SETTINGS";
241
+ static readonly ACTION_INSTALL_FAILURE = "android.intent.action.INSTALL_FAILURE";
242
+ static readonly ACTION_INSTALL_PACKAGE = "android.intent.action.INSTALL_PACKAGE";
243
+ static readonly ACTION_UNINSTALL_PACKAGE = "android.intent.action.UNINSTALL_PACKAGE";
244
+ static readonly ACTION_APPLICATION_SETTINGS = "android.intent.action.APPLICATION_SETTINGS";
245
+ static readonly ACTION_DATA_ROAMING_SETTINGS = "android.intent.action.DATA_ROAMING_SETTINGS";
246
+ static readonly ACTION_DATE_SETTINGS = "android.intent.action.DATE_SETTINGS";
247
+ static readonly ACTION_DEVICE_INFO_SETTINGS = "android.intent.action.DEVICE_INFO_SETTINGS";
248
+ static readonly ACTION_DISPLAY_SETTINGS = "android.intent.action.DISPLAY_SETTINGS";
249
+ static readonly ACTION_HOME_SETTINGS = "android.intent.action.HOME_SETTINGS";
250
+ static readonly ACTION_LOCATION_SOURCE_SETTINGS = "android.intent.action.LOCATION_SOURCE_SETTINGS";
251
+ static readonly ACTION_NETWORK_SETTINGS = "android.intent.action.NETWORK_SETTINGS";
252
+ static readonly ACTION_NFC_SETTINGS = "android.intent.action.NFC_SETTINGS";
253
+ static readonly ACTION_PRIVACY_SETTINGS = "android.intent.action.PRIVACY_SETTINGS";
254
+ static readonly ACTION_SEARCH_SETTINGS = "android.intent.action.SEARCH_SETTINGS";
255
+ static readonly ACTION_SECURITY_SETTINGS = "android.intent.action.SECURITY_SETTINGS";
256
+ static readonly ACTION_SETTINGS = "android.intent.action.SETTINGS";
257
+ static readonly ACTION_SOUND_SETTINGS = "android.intent.action.SOUND_SETTINGS";
258
+ static readonly ACTION_SYNC_SETTINGS = "android.intent.action.SYNC_SETTINGS";
259
+ static readonly ACTION_USAGE_ACCESS_SETTINGS = "android.intent.action.USAGE_ACCESS_SETTINGS";
260
+ static readonly ACTION_WIFI_IP_SETTINGS = "android.intent.action.WIFI_IP_SETTINGS";
261
+ static readonly ACTION_WIFI_SETTINGS = "android.intent.action.WIFI_SETTINGS";
262
+ static readonly ACTION_WIRELESS_SETTINGS = "android.intent.action.WIRELESS_SETTINGS";
263
+ static readonly ACTION_BLUETOOTH_SETTINGS = "android.intent.action.BLUETOOTH_SETTINGS";
264
+ static readonly ACTION_ACCESSIBILITY_SETTINGS = "android.intent.action.ACCESSIBILITY_SETTINGS";
265
+ static readonly ACTION_ACCOUNT_SETTINGS = "android.intent.action.ACCOUNT_SETTINGS";
266
+ static readonly ACTION_ADD_ACCOUNT = "android.intent.action.ADD_ACCOUNT";
267
+ static readonly ACTION_APPLICATION_DETAILS_SETTINGS = "android.intent.action.APPLICATION_DETAILS_SETTINGS";
268
+ static readonly ACTION_APPLICATION_DEVELOPMENT_SETTINGS = "android.intent.action.APPLICATION_DEVELOPMENT_SETTINGS";
269
+ static readonly ACTION_WEB_SEARCH = "android.intent.action.WEB_SEARCH";
270
+ static readonly ACTION_CREATE_SHORTCUT = "android.intent.action.CREATE_SHORTCUT";
271
+ static readonly EXTRA_STREAM = "android.intent.extra.STREAM";
272
+ static readonly EXTRA_TEXT = "android.intent.extra.TEXT";
273
+ static readonly EXTRA_EMAIL = "android.intent.extra.EMAIL";
274
+ static readonly EXTRA_CC = "android.intent.extra.CC";
275
+ static readonly EXTRA_BCC = "android.intent.extra.BCC";
276
+ static readonly EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
277
+ static readonly EXTRA_REFERRER = "android.intent.extra.REFERRER";
278
+ static readonly EXTRA_REFERRER_NAME = "android.intent.extra.REFERRER_NAME";
279
+ static readonly EXTRA_PHONE_NUMBER = "android.intent.extra.PHONE_NUMBER";
280
+ static readonly EXTRA_LOCAL_ONLY = "android.intent.extra.LOCAL_ONLY";
281
+ static readonly EXTRA_INITIAL_INTENTS = "android.intent.extra.INITIAL_INTENTS";
282
+ static readonly EXTRA_CHOSEN_COMPONENT = "android.intent.extra.CHOSEN_COMPONENT";
283
+ static readonly EXTRA_SHORTCUT_INTENT = "android.intent.extra.SHORTCUT_INTENT";
284
+ static readonly EXTRA_SHORTCUT_NAME = "android.intent.extra.SHORTCUT_NAME";
285
+ static readonly EXTRA_SHORTCUT_ICON = "android.intent.extra.SHORTCUT_ICON";
286
+ static readonly EXTRA_SHORTCUT_ICON_RESOURCE = "android.intent.extra.SHORTCUT_ICON_RESOURCE";
287
+ static readonly EXTRA_TITLE = "android.intent.extra.TITLE";
288
+ static readonly EXTRA_HTML_TEXT = "android.intent.extra.HTML_TEXT";
289
+ static readonly EXTRA_ASSIST_CONTEXT = "android.intent.extra.ASSIST_CONTEXT";
290
+ static readonly EXTRA_ASSIST_INPUT_DEVICE_ID = "android.intent.extra.ASSIST_INPUT_DEVICE_ID";
291
+ static readonly EXTRA_ASSIST_INPUT_METHOD_MANAGER_SERVICE = "android.intent.extra.ASSIST_INPUT_METHOD_MANAGER_SERVICE";
292
+ static readonly EXTRA_ASSIST_SCREENSHOT = "android.intent.extra.ASSIST_SCREENSHOT";
293
+ static readonly EXTRA_ASSIST_URI = "android.intent.extra.ASSIST_URI";
294
+ static readonly EXTRA_ORIGINATING_URI = "android.intent.extra.ORIGINATING_URI";
295
+ static readonly EXTRA_WEB_SEARCH_INTENT = "android.intent.extra.WEB_SEARCH_INTENT";
296
+ static readonly EXTRA_MEDIA_ALBUM = "android.intent.extra.MEDIA_ALBUM";
297
+ static readonly EXTRA_MEDIA_ARTIST = "android.intent.extra.MEDIA_ARTIST";
298
+ static readonly EXTRA_MEDIA_FOCUS = "android.intent.extra.MEDIA_FOCUS";
299
+ static readonly EXTRA_MEDIA_GENRE = "android.intent.extra.MEDIA_GENRE";
300
+ static readonly EXTRA_MEDIA_TITLE = "android.intent.extra.MEDIA_TITLE";
301
+ static readonly EXTRA_ALARM_COUNT = "android.intent.extra.ALARM_COUNT";
302
+ static readonly EXTRA_CHANGED_COMPONENT_NAME_LIST = "android.intent.extra.CHANGED_COMPONENT_NAME_LIST";
303
+ static readonly EXTRA_CHANGED_PACKAGE_LIST = "android.intent.extra.CHANGED_PACKAGE_LIST";
304
+ static readonly EXTRA_CHANGED_UID_LIST = "android.intent.extra.CHANGED_UID_LIST";
305
+ static readonly EXTRA_DATA_REMOVED = "android.intent.extra.DATA_REMOVED";
306
+ static readonly EXTRA_DONT_KILL_APP = "android.intent.extra.DONT_KILL_APP";
307
+ static readonly EXTRA_INSTALL_RESULT = "android.intent.extra.INSTALL_RESULT";
308
+ static readonly EXTRA_KEY_EVENT = "android.intent.extra.KEY_EVENT";
309
+ static readonly EXTRA_MIME_TYPES = "android.intent.extra.MIME_TYPES";
310
+ static readonly EXTRA_MOUNT_FAILED = "android.intent.extra.MOUNT_FAILED";
311
+ static readonly EXTRA_NOTIFICATION_ID = "android.intent.extra.NOTIFICATION_ID";
312
+ static readonly EXTRA_NOTIFICATION_TAG = "android.intent.extra.NOTIFICATION_TAG";
313
+ static readonly EXTRA_PACKAGES = "android.intent.extra.PACKAGES";
314
+ static readonly EXTRA_REPLACING = "android.intent.extra.REPLACING";
315
+ static readonly EXTRA_SPLIT_NAME = "android.intent.extra.SPLIT_NAME";
316
+ static readonly EXTRA_SUSPENDED_PACKAGE_EXTRAS = "android.intent.extra.SUSPENDED_PACKAGE_EXTRAS";
317
+ static readonly EXTRA_UID = "android.intent.extra.UID";
318
+ static readonly EXTRA_USER = "android.intent.extra.USER";
319
+ static readonly EXTRA_CHANNEL_ID = "android.intent.extra.CHANNEL_ID";
320
+ static readonly EXTRA_REMOTE_INTENT_TOKEN = "android.intent.extra.REMOTE_INTENT_TOKEN";
321
+ static readonly EXTRA_PERMISSION_GROUP_NAME = "android.intent.extra.PERMISSION_GROUP_NAME";
322
+ static readonly EXTRA_PERMISSION_NAME = "android.intent.extra.PERMISSION_NAME";
323
+ static readonly EXTRA_RESTRICTIONS_BUNDLE = "android.intent.extra.RESTRICTIONS_BUNDLE";
324
+ static readonly EXTRA_RESTRICTIONS_INTENT = "android.intent.extra.RESTRICTIONS_INTENT";
325
+ static readonly EXTRA_TIMEZONE = "android.intent.extra.TIMEZONE";
326
+ static readonly EXTRA_DONT_REPLACE_EXISTING_APPLICATION_INFO = "android.intent.extra.DONT_REPLACE_EXISTING_APPLICATION_INFO";
327
+ static readonly EXTRA_SPLASH_SCREEN_THEME = "android.intent.extra.SPLASH_SCREEN_THEME";
328
+ static readonly EXTRA_SPLASH_SCREEN_ICON_ID = "android.intent.extra.SPLASH_SCREEN_ICON_ID";
329
+ static readonly EXTRA_STREAM_MULTIPLE = "android.intent.extra.STREAM_MULTIPLE";
330
+ static readonly EXTRA_EXCLUDE_COMPONENTS = "android.intent.extra.EXCLUDE_COMPONENTS";
331
+ static readonly EXTRA_ALLOW_MULTIPLE = "android.intent.extra.ALLOW_MULTIPLE";
332
+ static readonly EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE = "android.intent.extra.PROVISIONING_ACCOUNT_TO_MIGRATE";
333
+ static readonly EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME = "android.intent.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME";
334
+ static readonly EXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED = "android.intent.extra.PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED";
335
+ static readonly EXTRA_PROVISIONING_LOCALE = "android.intent.extra.PROVISIONING_LOCALE";
336
+ static readonly EXTRA_PROVISIONING_TIME_ZONE = "android.intent.extra.PROVISIONING_TIME_ZONE";
337
+ static readonly EXTRA_PROVISIONING_WIFI_HIDDEN = "android.intent.extra.PROVISIONING_WIFI_HIDDEN";
338
+ static readonly EXTRA_PROVISIONING_WIFI_PASSWORD = "android.intent.extra.PROVISIONING_WIFI_PASSWORD";
339
+ static readonly EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.intent.extra.PROVISIONING_WIFI_SECURITY_TYPE";
340
+ static readonly EXTRA_PROVISIONING_WIFI_SSID = "android.intent.extra.PROVISIONING_WIFI_SSID";
341
+ }
342
+ export interface WXApp {
343
+ getPackageName(): string;
344
+ getVersionName(): string;
345
+ getVersionCode(): number;
346
+ }
347
+ /**
348
+ * Represents the WebUI interface for interacting with native application functionalities.
349
+ * This class bridges JavaScript calls to methods exposed by the native ApplicationInterface.
350
+ */
351
+ export declare class WebUI {
352
+ private _interface;
353
+ constructor();
354
+ /**
355
+ * Exits the native application.
356
+ * Corresponds to `ApplicationInterface.exit()`.
357
+ */
358
+ exit(): void;
359
+ /**
360
+ * Sets the refreshing state of the pull-to-refresh mechanism.
361
+ * Requires pull-to-refresh and JavaScript refresh interceptor to be enabled natively.
362
+ * Corresponds to `ApplicationInterface.setRefreshing(state)`.
363
+ * @param {boolean} state True to show refreshing indicator, false to hide.
364
+ */
365
+ setRefreshing(state: boolean): void;
366
+ /**
367
+ * Gets information about the current root manager application.
368
+ * Corresponds to `ApplicationInterface.currentRootManager` getter.
369
+ * @returns {Object | null} An object with packageName, versionName, and versionCode, or null if unavailable.
370
+ */
371
+ get currentRootManager(): WXApp | null;
372
+ /**
373
+ * Gets information about the current application.
374
+ * Corresponds to `ApplicationInterface.currentApplication` getter.
375
+ * @returns {Object | null} An object with packageName, versionName, and versionCode, or null if unavailable.
376
+ */
377
+ get currentApplication(): WXApp | null;
378
+ /**
379
+ * Gets information about a specific application by its package name.
380
+ * Corresponds to `ApplicationInterface.getApplication(packageName)`.
381
+ * @param {string} packageName The package name of the application.
382
+ * @returns {Object | null} An object with packageName, versionName, and versionCode, or null if unavailable/error.
383
+ */
384
+ getApplication(packageName: string): WXApp | null;
385
+ /**
386
+ * Opens a file chooser dialog using the provided intent data.
387
+ * Corresponds to `ApplicationInterface.openFile(i: IntentData?)`.
388
+ * @param {Intent} intent An Intent object (from the previously defined Intent class) containing file selection details.
389
+ */
390
+ openFile(intent: Intent): void;
391
+ /**
392
+ * Starts a new activity using the provided intent data.
393
+ * Corresponds to `ApplicationInterface.startActivity(i: IntentData)`.
394
+ * @param {Intent} intent An Intent object (from the previously defined Intent class) describing the activity to start.
395
+ */
396
+ startActivity(intent: Intent): void;
397
+ }
90
398
 
91
399
  export {};
package/dist/index.esm.js CHANGED
@@ -1 +1 @@
1
- var l={chunkSize:1048576,headers:{"Content-Type":"application/octet-stream"}};async function E(r,n={}){let t={...l,...n};return new Promise((e,i)=>{let a;try{if(a=r,!a)throw new Error("Failed to open file input stream")}catch(s){i(s);return}let d=()=>{try{a?.close()}catch(s){console.error("Error during abort cleanup:",s)}i(new DOMException("The operation was aborted.","AbortError"))};if(t.signal){if(t.signal.aborted){d();return}t.signal.addEventListener("abort",d)}let f=new ReadableStream({async pull(s){try{let o=W(a,t.chunkSize);if(!o){s.close(),c();return}s.enqueue(o)}catch(o){c(),s.error(o),i(new Error(`Error reading file chunk: ${o}`))}},cancel(s){console.warn("Stream canceled:",s),c()}});function c(){try{if(t.signal)t.signal.removeEventListener("abort",d);a?.close()}catch(s){console.error(`Error during cleanup: ${s}`)}}e(f)})}function W(r,n){try{let t=n?r.readChunk(n):r.read();if(typeof t==="number")return new Uint8Array([t]);else if(typeof t==="string"){let e=JSON.parse(t);return e&&Array.isArray(e)&&e.length>0?new Uint8Array(e):null}return null}catch(t){throw new Error("Error reading chunk data: "+t)}}async function u(r,n={}){let t={...l,...n};try{let e=await E(r,t);return new Response(e,t)}catch(e){throw new Error(`wrapInputStream failed: ${e}`)}}async function y(r,n){if(!r||typeof r.getReader!=="function")throw new Error("Invalid ReadableStream provided.");if(!n||typeof n.write!=="function"||typeof n.close!=="function")throw new Error("Invalid outputStreamInstance provided. It must be an already opened stream with 'write' and 'close' methods.");let t=new WritableStream({async start(e){console.log("WritableStream started, output stream instance ready.")},async write(e,i){if(e instanceof Uint8Array)for(let a=0;a<e.length;a++)n.write(e[a]);else console.warn("Received non-Uint8Array chunk in WritableStream:",e),i.error(new TypeError("Expected Uint8Array chunks."))},async close(){console.log("WritableStream closed. Flushing and closing native stream.");try{n.flush(),n.close()}catch(e){throw console.error("Error during WritableStream close cleanup:",e),e}},async abort(e){console.error("WritableStream aborted:",e);try{n.close()}catch(i){console.error("Error during WritableStream abort cleanup:",i)}}});try{await r.pipeTo(t),console.log("Piping completed successfully.")}catch(e){let i=e instanceof Error?e:new Error(String(e));throw console.error("Error during stream piping:",i),new Error(`Failed to pipe stream: ${i.message}`)}}class p extends Event{_wxOrigin;_wxData;get wxOrigin(){return this._wxOrigin}set wxOrigin(r){this._wxOrigin=r}get wx(){return this._wxData}set wx(r){this._wxData=r}constructor(r){super(r,{bubbles:!0,cancelable:!0,composed:!0})}}var X={cordova:!1};class v{_initialized=!1;_handlers=new WeakMap;_eventTypes;get eventTypes(){return this._eventTypes}constructor(r=X){if(this._initialized)return;this._initialized=!0,this._eventTypes={WX_ON_BACK:r.cordova?"backbutton":"back",WX_ON_RESUME:"resume",WX_ON_REFRESH:"refresh",WX_ON_PAUSE:"pause",WX_ON_KEYBOARD:"keyboard",WX_ON_INSETS:"insets"},window.addEventListener("message",(n)=>{try{if(typeof n.data!=="string")return;let t=JSON.parse(n.data);if(!t?.type)return;let e=this._eventTypes[t.type]??t.type;this._dispatch(window,e,t)}catch(t){console.error("[WXEvent] Message error:",t)}})}_dispatch(r,n,t){let e=new p(n);e.wx=t.data,e.wxOrigin="system",r.dispatchEvent(e)}on(r,n,t){if(!this._initialized)new v;let e=(a)=>{if(!(a instanceof p)){console.warn("[WXEvent] Event is not a WXEvent:",a);return}if(a.wxOrigin==="system"){if(typeof t==="function")t(a);else if(t&&typeof t.handleEvent==="function")t.handleEvent(a)}};if(!this._handlers.has(r))this._handlers.set(r,new Map);let i=this._handlers.get(r);if(!i.has(n))i.set(n,new Set);return i.get(n).add({handler:t,wrapper:e}),r.addEventListener(n,e),()=>this.off(r,n,t)}off(r,n,t){let e=this._handlers.get(r);if(!e?.has(n))return;for(let i of e.get(n))if(i.handler===t){r.removeEventListener(n,i.wrapper),e.get(n).delete(i);break}}}export{E as wrapToReadableStream,y as wrapOutputStream,u as wrapInputStream,v as WXEventHandler,p as WXEvent};
1
+ var l={chunkSize:1048576,headers:{"Content-Type":"application/octet-stream"}};async function d(e,n={}){let t={...l,...n};return new Promise((r,i)=>{let s;try{if(s=e,!s)throw new Error("Failed to open file input stream")}catch(o){i(o);return}let E=()=>{try{s?.close()}catch(o){console.error("Error during abort cleanup:",o)}i(new DOMException("The operation was aborted.","AbortError"))};if(t.signal){if(t.signal.aborted){E();return}t.signal.addEventListener("abort",E)}let X=new ReadableStream({async pull(o){try{let a=w(s,t.chunkSize);if(!a){o.close(),f();return}o.enqueue(a)}catch(a){f(),o.error(a),i(new Error(`Error reading file chunk: ${a}`))}},cancel(o){console.warn("Stream canceled:",o),f()}});function f(){try{if(t.signal)t.signal.removeEventListener("abort",E);s?.close()}catch(o){console.error(`Error during cleanup: ${o}`)}}r(X)})}function w(e,n){try{let t=n?e.readChunk(n):e.read();if(typeof t==="number")return new Uint8Array([t]);else if(typeof t==="string"){let r=JSON.parse(t);return r&&Array.isArray(r)&&r.length>0?new Uint8Array(r):null}return null}catch(t){throw new Error("Error reading chunk data: "+t)}}async function y(e,n={}){let t={...l,...n};try{let r=await d(e,t);return new Response(r,t)}catch(r){throw new Error(`wrapInputStream failed: ${r}`)}}async function u(e,n){if(!e||typeof e.getReader!=="function")throw new Error("Invalid ReadableStream provided.");if(!n||typeof n.write!=="function"||typeof n.close!=="function")throw new Error("Invalid outputStreamInstance provided. It must be an already opened stream with 'write' and 'close' methods.");let t=new WritableStream({async start(r){console.log("WritableStream started, output stream instance ready.")},async write(r,i){if(r instanceof Uint8Array)for(let s=0;s<r.length;s++)n.write(r[s]);else console.warn("Received non-Uint8Array chunk in WritableStream:",r),i.error(new TypeError("Expected Uint8Array chunks."))},async close(){console.log("WritableStream closed. Flushing and closing native stream.");try{n.flush(),n.close()}catch(r){throw console.error("Error during WritableStream close cleanup:",r),r}},async abort(r){console.error("WritableStream aborted:",r);try{n.close()}catch(i){console.error("Error during WritableStream abort cleanup:",i)}}});try{await e.pipeTo(t),console.log("Piping completed successfully.")}catch(r){let i=r instanceof Error?r:new Error(String(r));throw console.error("Error during stream piping:",i),new Error(`Failed to pipe stream: ${i.message}`)}}class p extends Event{_wxOrigin;_wxData;get wxOrigin(){return this._wxOrigin}set wxOrigin(e){this._wxOrigin=e}get wx(){return this._wxData}set wx(e){this._wxData=e}constructor(e){super(e,{bubbles:!0,cancelable:!0,composed:!0})}}var b={cordova:!1};class v{_initialized=!1;_handlers=new WeakMap;_eventTypes;get eventTypes(){return this._eventTypes}constructor(e=b){if(this._initialized)return;this._initialized=!0,this._eventTypes={WX_ON_BACK:e.cordova?"backbutton":"back",WX_ON_RESUME:"resume",WX_ON_REFRESH:"refresh",WX_ON_PAUSE:"pause",WX_ON_KEYBOARD:"keyboard",WX_ON_INSETS:"insets"},window.addEventListener("message",(n)=>{try{if(typeof n.data!=="string")return;let t=JSON.parse(n.data);if(!t?.type)return;let r=this._eventTypes[t.type]??t.type;this._dispatch(window,r,t)}catch(t){console.error("[WXEvent] Message error:",t)}})}_dispatch(e,n,t){let r=new p(n);r.wx=t.data,r.wxOrigin="system",e.dispatchEvent(r)}on(e,n,t){if(!this._initialized)new v;let r=(s)=>{if(!(s instanceof p)){console.warn("[WXEvent] Event is not a WXEvent:",s);return}if(s.wxOrigin==="system"){if(typeof t==="function")t(s);else if(t&&typeof t.handleEvent==="function")t.handleEvent(s)}};if(!this._handlers.has(e))this._handlers.set(e,new Map);let i=this._handlers.get(e);if(!i.has(n))i.set(n,new Set);return i.get(n).add({handler:t,wrapper:r}),e.addEventListener(n,r),()=>this.off(e,n,t)}off(e,n,t){let r=this._handlers.get(e);if(!r?.has(n))return;for(let i of r.get(n))if(i.handler===t){e.removeEventListener(n,i.wrapper),r.get(n).delete(i);break}}}class c{_action;_interface=null;constructor(e){if(this._action=e,typeof window==="undefined"||!window.$intent||typeof window.$intent.create!=="function")console.warn("window['$intent'] or window['$intent'].create is not defined. Intent functionality may be limited.");else this._interface=window.$intent.create(this._action)}getParsedIntent(){return this._interface}setData(e){if(this._interface&&typeof this._interface.setData==="function")this._interface.setData(e);else console.error("setData method not available on the intent interface.")}setPackage(e){if(this._interface&&typeof this._interface.setPackage==="function")this._interface.setPackage(e);else console.error("setPackage method not available on the intent interface.")}addCategory(e){if(this._interface&&typeof this._interface.addCategory==="function")this._interface.addCategory(e);else console.error("addCategory method not available on the intent interface.")}setType(e){if(this._interface&&typeof this._interface.setType==="function")this._interface.setType(e);else console.error("setType method not available on the intent interface.")}putExtra(e,n){if(this._interface&&typeof this._interface.putExtra==="function")this._interface.putExtra(e,n);else console.error("putExtra method not available on the intent interface.")}getStringExtra(e){if(this._interface&&typeof this._interface.getStringExtra==="function")return this._interface.getStringExtra(e);else return console.error("getStringExtra method not available on the intent interface."),null}getIntExtra(e){if(this._interface&&typeof this._interface.getIntExtra==="function")return this._interface.getIntExtra(e);else return console.error("getIntExtra method not available on the intent interface."),0}getBooleanExtra(e){if(this._interface&&typeof this._interface.getBooleanExtra==="function")return this._interface.getBooleanExtra(e);else return console.error("getBooleanExtra method not available on the intent interface."),!1}static ACTION_MAIN="android.intent.action.MAIN";static ACTION_VIEW="android.intent.action.VIEW";static ACTION_ATTACH_DATA="android.intent.action.ATTACH_DATA";static ACTION_EDIT="android.intent.action.EDIT";static ACTION_PICK="android.intent.action.PICK";static ACTION_CHOOSER="android.intent.action.CHOOSER";static ACTION_GET_CONTENT="android.intent.action.GET_CONTENT";static ACTION_DIAL="android.intent.action.DIAL";static ACTION_CALL="android.intent.action.CALL";static ACTION_SEND="android.intent.action.SEND";static ACTION_SENDTO="android.intent.action.SENDTO";static ACTION_SEND_MULTIPLE="android.intent.action.SEND_MULTIPLE";static ACTION_SYNC="android.intent.action.SYNC";static ACTION_BATTERY_LOW="android.intent.action.BATTERY_LOW";static ACTION_BATTERY_OKAY="android.intent.action.BATTERY_OKAY";static ACTION_BOOT_COMPLETED="android.intent.action.BOOT_COMPLETED";static ACTION_CAMERA_BUTTON="android.intent.action.CAMERA_BUTTON";static ACTION_CLOSE_SYSTEM_DIALOGS="android.intent.action.CLOSE_SYSTEM_DIALOGS";static ACTION_DEVICE_STORAGE_LOW="android.intent.action.DEVICE_STORAGE_LOW";static ACTION_DEVICE_STORAGE_OK="android.intent.action.DEVICE_STORAGE_OK";static ACTION_EXTERNAL_APPLICATIONS_AVAILABLE="android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE";static ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE="android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE";static ACTION_LOCALE_CHANGED="android.intent.action.LOCALE_CHANGED";static ACTION_MEDIA_BAD_REMOVAL="android.intent.action.MEDIA_BAD_REMOVAL";static ACTION_MEDIA_BUTTON="android.intent.action.MEDIA_BUTTON";static ACTION_MEDIA_CHECKING="android.intent.action.MEDIA_CHECKING";static ACTION_MEDIA_EJECT="android.intent.action.MEDIA_EJECT";static ACTION_MEDIA_MOUNTED="android.intent.action.MEDIA_MOUNTED";static ACTION_MEDIA_NOFS="android.intent.action.MEDIA_NOFS";static ACTION_MEDIA_REMOVED="android.intent.action.MEDIA_REMOVED";static ACTION_MEDIA_SCANNER_FINISHED="android.intent.action.MEDIA_SCANNER_FINISHED";static ACTION_MEDIA_SCANNER_SCAN_FILE="android.intent.action.MEDIA_SCANNER_SCAN_FILE";static ACTION_MEDIA_SCANNER_STARTED="android.intent.action.MEDIA_SCANNER_STARTED";static ACTION_MEDIA_SHARED="android.intent.action.MEDIA_SHARED";static ACTION_MEDIA_UNMOUNTABLE="android.intent.action.MEDIA_UNMOUNTABLE";static ACTION_MEDIA_UNMOUNTED="android.intent.action.MEDIA_UNMOUNTED";static ACTION_NEW_OUTGOING_CALL="android.intent.action.NEW_OUTGOING_CALL";static ACTION_PACKAGE_ADDED="android.intent.action.PACKAGE_ADDED";static ACTION_PACKAGE_CHANGED="android.intent.action.PACKAGE_CHANGED";static ACTION_PACKAGE_DATA_CLEARED="android.intent.action.PACKAGE_DATA_CLEARED";static ACTION_PACKAGE_FULLY_REMOVED="android.intent.action.PACKAGE_FULLY_REMOVED";static ACTION_PACKAGE_INSTALL="android.intent.action.PACKAGE_INSTALL";static ACTION_PACKAGE_FIRST_LAUNCH="android.intent.action.PACKAGE_FIRST_LAUNCH";static ACTION_PACKAGE_NEEDS_VERIFICATION="android.intent.action.PACKAGE_NEEDS_VERIFICATION";static ACTION_PACKAGE_REMOVED="android.intent.action.PACKAGE_REMOVED";static ACTION_PACKAGE_REPLACED="android.intent.action.PACKAGE_REPLACED";static ACTION_PACKAGE_RESTARTED="android.intent.action.PACKAGE_RESTARTED";static ACTION_PACKAGE_VERIFIED="android.intent.action.PACKAGE_VERIFIED";static ACTION_POWER_CONNECTED="android.intent.action.POWER_CONNECTED";static ACTION_POWER_DISCONNECTED="android.intent.action.POWER_DISCONNECTED";static ACTION_PROVIDER_CHANGED="android.intent.action.PROVIDER_CHANGED";static ACTION_REBOOT="android.intent.action.REBOOT";static ACTION_SCREEN_OFF="android.intent.action.SCREEN_OFF";static ACTION_SCREEN_ON="android.intent.action.SCREEN_ON";static ACTION_SHUTDOWN="android.intent.action.SHUTDOWN";static ACTION_TIME_CHANGED="android.intent.action.TIME_CHANGED";static ACTION_TIME_TICK="android.intent.action.TIME_TICK";static ACTION_TIMEZONE_CHANGED="android.intent.action.TIMEZONE_CHANGED";static ACTION_UID_REMOVED="android.intent.action.UID_REMOVED";static ACTION_USER_BACKGROUND="android.intent.action.USER_BACKGROUND";static ACTION_USER_FOREGROUND="android.intent.action.USER_FOREGROUND";static ACTION_USER_INITIALIZE="android.intent.action.USER_INITIALIZE";static ACTION_USER_PRESENT="android.intent.action.USER_PRESENT";static ACTION_USER_UNLOCKED="android.intent.action.USER_UNLOCKED";static ACTION_WALLPAPER_CHANGED="android.intent.action.WALLPAPER_CHANGED";static ACTION_AIRPLANE_MODE_CHANGED="android.intent.action.AIRPLANE_MODE";static ACTION_ANSWER="android.intent.action.ANSWER";static ACTION_DREAMING_STARTED="android.intent.action.DREAMING_STARTED";static ACTION_DREAMING_STOPPED="android.intent.action.DREAMING_STOPPED";static ACTION_INPUT_METHOD_CHANGED="android.intent.action.INPUT_METHOD_CHANGED";static ACTION_HEADSET_PLUG="android.intent.action.HEADSET_PLUG";static ACTION_MANAGE_PACKAGE_STORAGE="android.intent.action.MANAGE_PACKAGE_STORAGE";static ACTION_MY_PACKAGE_REPLACED="android.intent.action.MY_PACKAGE_REPLACED";static ACTION_PREFERRED_APPLICATIONS_CHANGED="android.intent.action.PREFERRED_APPLICATIONS_CHANGED";static ACTION_RADIO_POWER_RESET="android.intent.action.RADIO_POWER_RESET";static ACTION_UMS_CONNECTED="android.intent.action.UMS_CONNECTED";static ACTION_UMS_DISCONNECTED="android.intent.action.UMS_DISCONNECTED";static ACTION_USER_ADDED="android.intent.action.USER_ADDED";static ACTION_USER_REMOVED="android.intent.action.USER_REMOVED";static ACTION_USER_STOPPED="android.intent.action.USER_STOPPED";static ACTION_VPN_SETTINGS="android.intent.action.VPN_SETTINGS";static ACTION_INSTALL_FAILURE="android.intent.action.INSTALL_FAILURE";static ACTION_INSTALL_PACKAGE="android.intent.action.INSTALL_PACKAGE";static ACTION_UNINSTALL_PACKAGE="android.intent.action.UNINSTALL_PACKAGE";static ACTION_APPLICATION_SETTINGS="android.intent.action.APPLICATION_SETTINGS";static ACTION_DATA_ROAMING_SETTINGS="android.intent.action.DATA_ROAMING_SETTINGS";static ACTION_DATE_SETTINGS="android.intent.action.DATE_SETTINGS";static ACTION_DEVICE_INFO_SETTINGS="android.intent.action.DEVICE_INFO_SETTINGS";static ACTION_DISPLAY_SETTINGS="android.intent.action.DISPLAY_SETTINGS";static ACTION_HOME_SETTINGS="android.intent.action.HOME_SETTINGS";static ACTION_LOCATION_SOURCE_SETTINGS="android.intent.action.LOCATION_SOURCE_SETTINGS";static ACTION_NETWORK_SETTINGS="android.intent.action.NETWORK_SETTINGS";static ACTION_NFC_SETTINGS="android.intent.action.NFC_SETTINGS";static ACTION_PRIVACY_SETTINGS="android.intent.action.PRIVACY_SETTINGS";static ACTION_SEARCH_SETTINGS="android.intent.action.SEARCH_SETTINGS";static ACTION_SECURITY_SETTINGS="android.intent.action.SECURITY_SETTINGS";static ACTION_SETTINGS="android.intent.action.SETTINGS";static ACTION_SOUND_SETTINGS="android.intent.action.SOUND_SETTINGS";static ACTION_SYNC_SETTINGS="android.intent.action.SYNC_SETTINGS";static ACTION_USAGE_ACCESS_SETTINGS="android.intent.action.USAGE_ACCESS_SETTINGS";static ACTION_WIFI_IP_SETTINGS="android.intent.action.WIFI_IP_SETTINGS";static ACTION_WIFI_SETTINGS="android.intent.action.WIFI_SETTINGS";static ACTION_WIRELESS_SETTINGS="android.intent.action.WIRELESS_SETTINGS";static ACTION_BLUETOOTH_SETTINGS="android.intent.action.BLUETOOTH_SETTINGS";static ACTION_ACCESSIBILITY_SETTINGS="android.intent.action.ACCESSIBILITY_SETTINGS";static ACTION_ACCOUNT_SETTINGS="android.intent.action.ACCOUNT_SETTINGS";static ACTION_ADD_ACCOUNT="android.intent.action.ADD_ACCOUNT";static ACTION_APPLICATION_DETAILS_SETTINGS="android.intent.action.APPLICATION_DETAILS_SETTINGS";static ACTION_APPLICATION_DEVELOPMENT_SETTINGS="android.intent.action.APPLICATION_DEVELOPMENT_SETTINGS";static ACTION_WEB_SEARCH="android.intent.action.WEB_SEARCH";static ACTION_CREATE_SHORTCUT="android.intent.action.CREATE_SHORTCUT";static EXTRA_STREAM="android.intent.extra.STREAM";static EXTRA_TEXT="android.intent.extra.TEXT";static EXTRA_EMAIL="android.intent.extra.EMAIL";static EXTRA_CC="android.intent.extra.CC";static EXTRA_BCC="android.intent.extra.BCC";static EXTRA_SUBJECT="android.intent.extra.SUBJECT";static EXTRA_REFERRER="android.intent.extra.REFERRER";static EXTRA_REFERRER_NAME="android.intent.extra.REFERRER_NAME";static EXTRA_PHONE_NUMBER="android.intent.extra.PHONE_NUMBER";static EXTRA_LOCAL_ONLY="android.intent.extra.LOCAL_ONLY";static EXTRA_INITIAL_INTENTS="android.intent.extra.INITIAL_INTENTS";static EXTRA_CHOSEN_COMPONENT="android.intent.extra.CHOSEN_COMPONENT";static EXTRA_SHORTCUT_INTENT="android.intent.extra.SHORTCUT_INTENT";static EXTRA_SHORTCUT_NAME="android.intent.extra.SHORTCUT_NAME";static EXTRA_SHORTCUT_ICON="android.intent.extra.SHORTCUT_ICON";static EXTRA_SHORTCUT_ICON_RESOURCE="android.intent.extra.SHORTCUT_ICON_RESOURCE";static EXTRA_TITLE="android.intent.extra.TITLE";static EXTRA_HTML_TEXT="android.intent.extra.HTML_TEXT";static EXTRA_ASSIST_CONTEXT="android.intent.extra.ASSIST_CONTEXT";static EXTRA_ASSIST_INPUT_DEVICE_ID="android.intent.extra.ASSIST_INPUT_DEVICE_ID";static EXTRA_ASSIST_INPUT_METHOD_MANAGER_SERVICE="android.intent.extra.ASSIST_INPUT_METHOD_MANAGER_SERVICE";static EXTRA_ASSIST_SCREENSHOT="android.intent.extra.ASSIST_SCREENSHOT";static EXTRA_ASSIST_URI="android.intent.extra.ASSIST_URI";static EXTRA_ORIGINATING_URI="android.intent.extra.ORIGINATING_URI";static EXTRA_WEB_SEARCH_INTENT="android.intent.extra.WEB_SEARCH_INTENT";static EXTRA_MEDIA_ALBUM="android.intent.extra.MEDIA_ALBUM";static EXTRA_MEDIA_ARTIST="android.intent.extra.MEDIA_ARTIST";static EXTRA_MEDIA_FOCUS="android.intent.extra.MEDIA_FOCUS";static EXTRA_MEDIA_GENRE="android.intent.extra.MEDIA_GENRE";static EXTRA_MEDIA_TITLE="android.intent.extra.MEDIA_TITLE";static EXTRA_ALARM_COUNT="android.intent.extra.ALARM_COUNT";static EXTRA_CHANGED_COMPONENT_NAME_LIST="android.intent.extra.CHANGED_COMPONENT_NAME_LIST";static EXTRA_CHANGED_PACKAGE_LIST="android.intent.extra.CHANGED_PACKAGE_LIST";static EXTRA_CHANGED_UID_LIST="android.intent.extra.CHANGED_UID_LIST";static EXTRA_DATA_REMOVED="android.intent.extra.DATA_REMOVED";static EXTRA_DONT_KILL_APP="android.intent.extra.DONT_KILL_APP";static EXTRA_INSTALL_RESULT="android.intent.extra.INSTALL_RESULT";static EXTRA_KEY_EVENT="android.intent.extra.KEY_EVENT";static EXTRA_MIME_TYPES="android.intent.extra.MIME_TYPES";static EXTRA_MOUNT_FAILED="android.intent.extra.MOUNT_FAILED";static EXTRA_NOTIFICATION_ID="android.intent.extra.NOTIFICATION_ID";static EXTRA_NOTIFICATION_TAG="android.intent.extra.NOTIFICATION_TAG";static EXTRA_PACKAGES="android.intent.extra.PACKAGES";static EXTRA_REPLACING="android.intent.extra.REPLACING";static EXTRA_SPLIT_NAME="android.intent.extra.SPLIT_NAME";static EXTRA_SUSPENDED_PACKAGE_EXTRAS="android.intent.extra.SUSPENDED_PACKAGE_EXTRAS";static EXTRA_UID="android.intent.extra.UID";static EXTRA_USER="android.intent.extra.USER";static EXTRA_CHANNEL_ID="android.intent.extra.CHANNEL_ID";static EXTRA_REMOTE_INTENT_TOKEN="android.intent.extra.REMOTE_INTENT_TOKEN";static EXTRA_PERMISSION_GROUP_NAME="android.intent.extra.PERMISSION_GROUP_NAME";static EXTRA_PERMISSION_NAME="android.intent.extra.PERMISSION_NAME";static EXTRA_RESTRICTIONS_BUNDLE="android.intent.extra.RESTRICTIONS_BUNDLE";static EXTRA_RESTRICTIONS_INTENT="android.intent.extra.RESTRICTIONS_INTENT";static EXTRA_TIMEZONE="android.intent.extra.TIMEZONE";static EXTRA_DONT_REPLACE_EXISTING_APPLICATION_INFO="android.intent.extra.DONT_REPLACE_EXISTING_APPLICATION_INFO";static EXTRA_SPLASH_SCREEN_THEME="android.intent.extra.SPLASH_SCREEN_THEME";static EXTRA_SPLASH_SCREEN_ICON_ID="android.intent.extra.SPLASH_SCREEN_ICON_ID";static EXTRA_STREAM_MULTIPLE="android.intent.extra.STREAM_MULTIPLE";static EXTRA_EXCLUDE_COMPONENTS="android.intent.extra.EXCLUDE_COMPONENTS";static EXTRA_ALLOW_MULTIPLE="android.intent.extra.ALLOW_MULTIPLE";static EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE="android.intent.extra.PROVISIONING_ACCOUNT_TO_MIGRATE";static EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME="android.intent.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME";static EXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED="android.intent.extra.PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED";static EXTRA_PROVISIONING_LOCALE="android.intent.extra.PROVISIONING_LOCALE";static EXTRA_PROVISIONING_TIME_ZONE="android.intent.extra.PROVISIONING_TIME_ZONE";static EXTRA_PROVISIONING_WIFI_HIDDEN="android.intent.extra.PROVISIONING_WIFI_HIDDEN";static EXTRA_PROVISIONING_WIFI_PASSWORD="android.intent.extra.PROVISIONING_WIFI_PASSWORD";static EXTRA_PROVISIONING_WIFI_SECURITY_TYPE="android.intent.extra.PROVISIONING_WIFI_SECURITY_TYPE";static EXTRA_PROVISIONING_WIFI_SSID="android.intent.extra.PROVISIONING_WIFI_SSID"}class W{_interface=null;constructor(){if(typeof window==="undefined"||!window.webui)console.warn("window['webui'] is not defined. WebUI functionality may be limited.");else this._interface=window.webui}exit(){if(this._interface&&typeof this._interface.exit==="function")this._interface.exit();else console.error("exit method not available on the webui interface.")}setRefreshing(e){if(this._interface&&typeof this._interface.setRefreshing==="function")this._interface.setRefreshing(e);else console.error("setRefreshing method not available on the webui interface.")}get currentRootManager(){if(this._interface&&typeof this._interface.getCurrentRootManager!=="undefined")return this._interface.getCurrentRootManager();else return console.error("currentRootManager getter not available on the webui interface."),null}get currentApplication(){if(this._interface&&typeof this._interface.getCurrentApplication!=="undefined")return this._interface.getCurrentApplication();else return console.error("currentApplication getter not available on the webui interface."),null}getApplication(e){if(this._interface&&typeof this._interface.getApplication==="function")return this._interface.getApplication(e);else return console.error("getApplication method not available on the webui interface."),null}openFile(e){if(this._interface&&typeof this._interface.openFile==="function")this._interface.openFile(e.getParsedIntent());else console.error("openFile method not available on the webui interface.")}startActivity(e){if(this._interface&&typeof this._interface.startActivity==="function")this._interface.startActivity(e.getParsedIntent());else console.error("startActivity method not available on the webui interface.")}}export{d as wrapToReadableStream,u as wrapOutputStream,y as wrapInputStream,W as WebUI,v as WXEventHandler,p as WXEvent,c as Intent};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webuix",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "type": "module",
5
5
  "description": "A library to make your life easier when working with MMRL's WebUI",
6
6
  "source": "src/index.ts",
package/tsconfig.json CHANGED
@@ -13,6 +13,7 @@
13
13
  "allowImportingTsExtensions": true,
14
14
  "verbatimModuleSyntax": true,
15
15
  "noEmit": true,
16
+ "noImplicitAny": false,
16
17
 
17
18
  // Best practices
18
19
  "strict": true,