@buoy-gg/storage 7.0.63 → 7.0.65
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/README.md +2 -0
- package/lib/commonjs/storage/components/GameUIStorageBrowser.js +2 -2
- package/lib/commonjs/storage/hooks/useAsyncStorageKeys.js +1 -1
- package/lib/commonjs/storage/hooks/useMMKVInstances.js +1 -1
- package/lib/commonjs/storage/hooks/useMMKVKeys.js +1 -1
- package/lib/commonjs/storage/hooks/useSecureStoreKeys.js +1 -1
- package/lib/commonjs/storage/stores/storageEventStore.js +1 -1
- package/lib/commonjs/storage/sync/storageSyncAdapter.js +1 -1
- package/lib/commonjs/storage/utils/AsyncStorageListener.js +1 -1
- package/lib/commonjs/storage/utils/AsyncStorageListener.web.js +1 -1
- package/lib/commonjs/storage/utils/MMKVListener.js +1 -1
- package/lib/commonjs/storage/utils/browserStorageLifecycle.web.js +1 -1
- package/lib/commonjs/storage/utils/snapshotProvider.js +1 -1
- package/lib/module/storage/components/GameUIStorageBrowser.js +2 -2
- package/lib/module/storage/hooks/useAsyncStorageKeys.js +1 -1
- package/lib/module/storage/hooks/useMMKVInstances.js +1 -1
- package/lib/module/storage/hooks/useMMKVKeys.js +1 -1
- package/lib/module/storage/hooks/useSecureStoreKeys.js +1 -1
- package/lib/module/storage/stores/storageEventStore.js +1 -1
- package/lib/module/storage/sync/storageSyncAdapter.js +1 -1
- package/lib/module/storage/utils/AsyncStorageListener.js +1 -1
- package/lib/module/storage/utils/AsyncStorageListener.web.js +1 -1
- package/lib/module/storage/utils/MMKVListener.js +1 -1
- package/lib/module/storage/utils/browserStorageLifecycle.web.js +1 -1
- package/lib/module/storage/utils/snapshotProvider.js +1 -1
- package/lib/typescript/storage/hooks/useMMKVInstances.d.ts +0 -13
- package/lib/typescript/storage/hooks/useMMKVKeys.d.ts +0 -12
- package/lib/typescript/storage/stores/storageEventStore.d.ts +1 -0
- package/lib/typescript/storage/sync/storageSyncAdapter.d.ts +1 -1
- package/lib/web/index.mjs +2 -2
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useState as
|
|
1
|
+
"use strict";import{isDevToolsStorageKey as f}from"@buoy-gg/shared-ui";import{useState as a,useEffect as l}from"react";import{mmkvInstanceRegistry as o}from"../utils/MMKVInstanceRegistry";export function useMMKVInstances(e=false){const[n,t]=a([]);const[r,i]=a(true);const c=()=>{i(true);try{const s=o.getAll().filter(({id:u})=>!f(u));const g=s.map(u=>{const{instance:y,id:I,encrypted:m,readOnly:d}=u;const p=y.getAllKeys().filter(x=>!f(x));const h=p?.length||0;const M=void 0;return{id:I,instance:y,encrypted:m,readOnly:d,keyCount:h,size:M}});t(g)}catch(s){t([])}finally{i(false)}};l(()=>{c()},[]);l(()=>{if(!e)return;const s=setInterval(()=>{c()},1e3);return()=>clearInterval(s)},[e]);return{instances:n,instanceCount:n.length,isLoading:r,refresh:c}}export function useMMKVInstance(e){const[n,t]=a(null);l(()=>{if(!o){t(null);return}const r=o.get(e);if(!r){t(null);return}const i=r.instance.getAllKeys().filter(s=>!f(s));const c=i?.length||0;t({...r,keyCount:c,size:void 0})},[e]);return n}export function useMMKVInstanceExists(e){const[n,t]=a(false);l(()=>{if(!o){t(false);return}t(o.has(e))},[e]);return n}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useState as
|
|
1
|
+
"use strict";import{isDevToolsStorageKey as j}from"@buoy-gg/shared-ui";import{useState as m,useEffect as K,useCallback as S,useRef as E}from"react";import{requiredKeyAppliesTo as T}from"../utils/requiredStorageKeyScope";import{detectMMKVType as M,isTypeMatch as w}from"../utils/mmkvTypeDetection";export function useMMKVKeys(p,c,x=[]){const[v,f]=m([]);const[V,a]=m(true);const[_,b]=m(null);const h=JSON.stringify(x);const l=E(x);l.current=x;const y=S(()=>{const i=l.current;a(true);b(null);try{if(!p){f([]);a(false);return}const r=p.getAllKeys().filter(t=>!j(t));if(!r||r.length===0){const t=i.filter(e=>T(e,"mmkv")).map(e=>{const d=typeof e==="string"?e:e.key;const n=typeof e==="object"?e.description:void 0;const o=typeof e==="object"?e.expectedValue:void 0;const u=typeof e==="object"?e.expectedType:void 0;return{key:d,value:void 0,valueType:void 0,storageType:"mmkv",instanceId:c,status:"required_missing",category:"required",description:n,expectedValue:o,expectedType:u}});f(t);a(false);return}const s=[];r.forEach(t=>{const{value:e,type:d}=M(p,t);const n=i.find(g=>{if(!T(g,"mmkv"))return false;if(typeof g==="string")return g===t;return g.key===t});let o="optional_present";if(n){if(e===void 0){o="required_missing"}else if(typeof n==="object"&&n.expectedValue!==void 0){o=String(e)===String(n.expectedValue)?"required_present":"required_wrong_value"}else if(typeof n==="object"&&n.expectedType!==void 0){o=w(d,n.expectedType)?"required_present":"required_wrong_type"}else{o="required_present"}}const u={key:t,value:e,valueType:d!=="unknown"?d:void 0,storageType:"mmkv",instanceId:c,status:o,category:n?"required":"optional",lastUpdated:new Date,...typeof n==="object"&&n.expectedValue!==void 0&&{expectedValue:n.expectedValue},...typeof n==="object"&&n.expectedType!==void 0&&{expectedType:n.expectedType},...typeof n==="object"&&n.description!==void 0&&{description:n.description}};s.push(u)});i.forEach(t=>{if(!T(t,"mmkv"))return;const e=typeof t==="string"?t:t.key;const d=s.some(n=>n.key===e);if(!d){s.push({key:e,value:void 0,valueType:void 0,storageType:"mmkv",instanceId:c,status:"required_missing",category:"required",...typeof t==="object"&&t.expectedValue!==void 0&&{expectedValue:t.expectedValue},...typeof t==="object"&&t.expectedType!==void 0&&{expectedType:t.expectedType},...typeof t==="object"&&t.description!==void 0&&{description:t.description}})}});f(s)}catch(r){b(r instanceof Error?r:new Error("Failed to fetch MMKV storage data"));f([])}finally{a(false)}},[p,c,h]);K(()=>{y()},[y]);return{storageKeys:v,isLoading:V,error:_,refresh:y}}export function useMultiMMKVKeys(p,c=[]){const[x,v]=m([]);const[f,V]=m(true);const[a,_]=m(null);const b=JSON.stringify(c);const h=E(c);h.current=c;const l=S(()=>{const y=h.current;V(true);_(null);try{const i=[];p.forEach(({instance:r,id:s})=>{const t=r.getAllKeys().filter(e=>!j(e));if(!t||t.length===0){return}t.forEach(e=>{const{value:d,type:n}=M(r,e);const o=y.find(k=>{if(!T(k,"mmkv"))return false;if(typeof k==="string")return k===e;return k.key===e});let u="optional_present";if(o){if(d===void 0){u="required_missing"}else if(typeof o==="object"&&o.expectedValue!==void 0){u=String(d)===String(o.expectedValue)?"required_present":"required_wrong_value"}else if(typeof o==="object"&&o.expectedType!==void 0){u=w(n,o.expectedType)?"required_present":"required_wrong_type"}else{u="required_present"}}const g={key:e,value:d,valueType:n!=="unknown"?n:void 0,storageType:"mmkv",instanceId:s,status:u,category:o?"required":"optional",lastUpdated:new Date,...typeof o==="object"&&o.expectedValue!==void 0&&{expectedValue:o.expectedValue},...typeof o==="object"&&o.expectedType!==void 0&&{expectedType:o.expectedType},...typeof o==="object"&&o.description!==void 0&&{description:o.description}};i.push(g)})});y.forEach(r=>{if(!T(r,"mmkv"))return;const s=typeof r==="string"?r:r.key;const t=i.some(e=>e.key===s);if(!t){const e=p[0]?.id||"mmkv.default";i.push({key:s,value:void 0,valueType:void 0,storageType:"mmkv",instanceId:e,status:"required_missing",category:"required",...typeof r==="object"&&r.expectedValue!==void 0&&{expectedValue:r.expectedValue},...typeof r==="object"&&r.expectedType!==void 0&&{expectedType:r.expectedType},...typeof r==="object"&&r.description!==void 0&&{description:r.description}})}});v(i)}catch(i){_(i instanceof Error?i:new Error("Failed to fetch multi-MMKV storage data"));v([])}finally{V(false)}},[p,b]);K(()=>{l()},[l]);return{storageKeys:x,isLoading:f,error:a,refresh:l}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useState as k,useEffect as
|
|
1
|
+
"use strict";import{isDevToolsStorageKey as M}from"@buoy-gg/shared-ui";import{useState as k,useEffect as J,useCallback as L,useRef as p}from"react";import{requiredKeyAppliesTo as K}from"../utils/requiredStorageKeyScope";import{secureStoreRegistry as _}from"../utils/SecureStoreRegistry";const N="\u2022\u2022\u2022\u2022\u2022\u2022 (biometric protected)";const P=3e3;function R(c){return JSON.stringify(c)}export function useSecureStoreKeys(c=[],A={}){const{pollMs:d=P}=A;const v=p(c);v.current=c;const E=JSON.stringify(c);const[I,w]=k([]);const[O,f]=k(true);const[V,x]=k(null);const T=p(R([]));const y=p(false);const g=p(false);const l=L(r=>{const i=R(r);if(i===T.current)return;T.current=i;w(r)},[]);const u=L(async()=>{if(g.current)return;g.current=true;try{const r=_.getModule();const i=_.getAll().filter(({key:e})=>!M(e));const S=v.current.filter(e=>K(e,"secure"));const D=e=>S.find(t=>(typeof t==="string"?t:t.key)===e);if(!r||i.length===0&&S.length===0){l([]);y.current=true;f(false);return}if(!y.current)f(true);x(null);const m=[];const C=[...i,...S.map(e=>typeof e==="string"?e:e.key).filter(e=>!i.some(t=>t.key===e)).map(e=>({key:e,options:{},description:void 0}))];for(const e of C){const t=D(e.key);const n=typeof t==="object"?t:void 0;const b={...n?.expectedValue!==void 0&&{expectedValue:n.expectedValue},...n?.expectedType!==void 0&&{expectedType:n.expectedType}};const h=n?.description??e.description;if(e.options.requireAuthentication){m.push({key:e.key,value:N,storageType:"secure",status:t?"required_present":"optional_present",category:t?"required":"optional",description:h??"Protected by biometric authentication \u2014 value not read by DevTools",...b,...e.options.keychainService&&{instanceId:e.options.keychainService}});continue}let o=null;try{o=await r.getItemAsync(e.key,e.options)}catch{}if(o===null&&!t)continue;let s=o;if(o){try{s=JSON.parse(o)}catch{s=o}}let a="optional_present";if(t){if(o===null)a="required_missing";else if(n?.expectedValue!==void 0)a=String(s)===String(n.expectedValue)?"required_present":"required_wrong_value";else if(n?.expectedType!==void 0){const F=s===null?"null":Array.isArray(s)?"array":typeof s;const q=n.expectedType.toLowerCase();a=F===q||q==="string"&&typeof o==="string"?"required_present":"required_wrong_type"}else a="required_present"}m.push({key:e.key,value:o===null?void 0:s,storageType:"secure",status:a,category:t?"required":"optional",...h&&{description:h},...b,...e.options.keychainService&&{instanceId:e.options.keychainService}})}l(m)}catch(r){x(r instanceof Error?r:new Error("Failed to read SecureStore"));l([])}finally{y.current=true;g.current=false;f(false)}},[l,E]);J(()=>{u();const r=_.subscribe(()=>{u()});if(d<=0)return r;const i=setInterval(u,d);return()=>{r();clearInterval(i)}},[u,d]);return{storageKeys:I,isLoading:O,error:V,refresh:u}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{BaseEventStore as
|
|
1
|
+
"use strict";import{BaseEventStore as v,appStorageEvent as p}from"@buoy-gg/shared-ui";import{startListening as f,addListener as m,isListening as y}from"../utils/AsyncStorageListener";import{addMMKVListener as b}from"../utils/MMKVListener";import{mmkvInstanceRegistry as h}from"../utils/MMKVInstanceRegistry";import{detectMMKVType as S}from"../utils/mmkvTypeDetection";export function isValueOnDevice(n){return!!n&&typeof n==="object"&&n.__buoyValueOnDevice===true}export function batchPairsOf(n){if(n.storageType!=="async"||!n.data)return{};return{pairs:n.data.pairs,prevPairs:n.data.prevPairs}}function d(n){const t=n.data;if(!t)return false;const{pairs:s,prevPairs:a}=batchPairsOf(n);return isValueOnDevice(t.value)||isValueOnDevice(t.prevValue)||isValueOnDevice(s)||isValueOnDevice(a)}let E=0;function c(){return`se-${Date.now()}-${++E}`}class x extends v{addEvent(t){const s=p(t);if(s)super.addEvent(s)}asyncStorageUnsubscribe=null;mmkvUnsubscribe=null;hasScannedInitialState=false;constructor(){super({storeName:"storage",maxEvents:500})}async scanExistingState(){if(this.hasScannedInitialState)return;this.hasScannedInitialState=true;const t=new Date;const s=h.getAll();for(const{id:a,instance:e}of s){try{const r=e.getAllKeys();for(const i of r){const{value:u,type:o}=S(e,i);const l={string:"set.string",number:"set.number",boolean:"set.boolean",buffer:"set.buffer"};const g=l[o]??"set.string";this.addEvent({action:g,timestamp:t,instanceId:a,data:{key:i,value:u,valueType:o,initialScan:true},storageType:"mmkv",id:c()})}}catch{}}try{const{asyncStorage:a,readMany:e}=require("../utils/asyncStorageCompat");if(a){const r=await a.getAllKeys();if(r.length>0){const i=await e(r);for(const[u,o]of i){this.addEvent({action:"setItem",timestamp:t,data:{key:u,value:o??void 0,initialScan:true},storageType:"async",id:c()})}}}}catch{}}async startCapturing(){if(!y()){await f()}if(!this.asyncStorageUnsubscribe){this.asyncStorageUnsubscribe=m(t=>{const s={...t,storageType:"async",id:c()};this.addEvent(s)})}if(!this.mmkvUnsubscribe){this.mmkvUnsubscribe=b(t=>{const s={...t,storageType:"mmkv",id:c()};this.addEvent(s)})}await this.scanExistingState()}stopCapturing(){if(this.asyncStorageUnsubscribe){this.asyncStorageUnsubscribe();this.asyncStorageUnsubscribe=null}if(this.mmkvUnsubscribe){this.mmkvUnsubscribe();this.mmkvUnsubscribe=null}}isCapturing(){return this.asyncStorageUnsubscribe!==null||this.mmkvUnsubscribe!==null}getEventsByType(t){return this.events.filter(s=>s.storageType===t)}replaceEvents(t){const s=new Map;for(const e of this.events){if(!d(e)){s.set(e.id,e)}}const a=t.map(p).filter(e=>e!==null).map(e=>{const r=s.get(e.id);if(!r||!d(e))return e;return{...e,data:{...e.data,value:r.data?.value,prevValue:r.data?.prevValue,...batchPairsOf(r)}}});super.replaceEvents(a)}hydrateEvent(t){const s=p(t);if(!s)return;t=s;const a=this.events.findIndex(i=>i.id===t.id);if(a===-1)return;const e=this.events[a];const r=this.events.slice();r[a]={...e,...t,timestamp:e.timestamp,data:{...e.data,...t.data}};super.replaceEvents(r)}}export const storageEventStore=new x;export const subscribeToStorageEvents=n=>storageEventStore.subscribeToEvents(n);export const onStorageEvent=n=>storageEventStore.onEvent(n);export const getStorageEvents=()=>storageEventStore.getEvents();export const clearStorageEvents=()=>storageEventStore.clearEvents();export const isStorageCapturing=()=>storageEventStore.isCapturing();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import
|
|
1
|
+
"use strict";import y from"../utils/appAsyncStorage";import{approxJsonSize as p,isDevToolsStorageKey as c,isOverWireBudget as v,isJsonSerializable as T}from"@buoy-gg/shared-ui";import{readMany as b,writeMany as V,removeMany as I}from"../utils/asyncStorageCompat";import{batchPairsOf as M,storageEventStore as l}from"../stores/storageEventStore";import{clearAllAppStorage as _}from"../utils/clearAllStorage";import{undoOperation as q,jumpToState as K,canUndo as N}from"../utils/storageTimeTravelUtils";import{mmkvInstanceRegistry as f}from"../utils/MMKVInstanceRegistry";import{detectMMKVType as g}from"../utils/mmkvTypeDetection";import{secureStoreRegistry as u}from"../utils/SecureStoreRegistry";export const VALUE_ON_DEVICE=Object.freeze({__buoyValueOnDevice:true,note:"Value stays on the device \u2014 fetched on demand via getEventDetail / mmkv.get / secure.get."});export const SNAPSHOT_VALUE_INLINE_LIMIT=16*1024;export const SNAPSHOT_EVENTS_BUDGET=1.25*1024*1024;const h=8*1024*1024;function m(e){if(e===void 0)return e;return v(e,SNAPSHOT_VALUE_INLINE_LIMIT)?VALUE_ON_DEVICE:e}function d(e,t){const r=e.data;if(!r)return e;const n=t(r.value);const s=t(r.prevValue);const i=M(e);const o=t(i.pairs);const a=t(i.prevPairs);if(n===r.value&&s===r.prevValue&&o===i.pairs&&a===i.prevPairs){return e}return{...e,data:{...r,value:n,prevValue:s,...e.storageType==="async"?{pairs:o,prevPairs:a}:{}}}}function k(e){if(e===void 0)return e;if(!v(e,h))return e;return T(e)?{__buoyTruncated:true,note:`Exceeds the ${h/(1024*1024)}MB detail limit \u2014 inspect it on-device.`}:VALUE_ON_DEVICE}const w=new WeakMap;const E=new WeakMap;function x(e){const t=w.get(e);if(t)return t;let r;try{const n=d(e,m);r={event:n,bytes:p(n,SNAPSHOT_EVENTS_BUDGET).bytes}}catch{const n=d(e,()=>VALUE_ON_DEVICE);r={event:n,bytes:1024}}w.set(e,r);return r}function O(e){const t=E.get(e);if(t)return t;const r=d(e,s=>s===void 0?void 0:VALUE_ON_DEVICE);const n={event:r,bytes:p(r,SNAPSHOT_EVENTS_BUDGET).bytes};E.set(e,n);return n}function P(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const s=x(e[n]);if(r+s.bytes<=SNAPSHOT_EVENTS_BUDGET){t[n]=s.event;r+=s.bytes}else{const i=O(e[n]);t[n]=i.event;r+=i.bytes}}return t}function A(e){const t=f.get(e);if(!t){throw new Error(`No MMKV instance registered as "${e}"`)}if(t.instance?.isReadOnly){throw new Error(`MMKV instance "${e}" is registered read-only`)}return t.instance}let S=[];export function setToolRequiredStorageKeys(e){S=e}export const storageSyncAdapter={version:3,getSnapshot:()=>P(l.getEvents().filter(e=>{const t=e.data?.key;return!(typeof t==="string"&&c(t))})),subscribe:e=>l.subscribeToEvents(e),actions:{clearEvents:()=>{l.clearEvents()},getRequiredKeys:()=>S,getEventDetail:e=>{const{id:t}=e??{};if(!t)return{found:false,reason:"missing id"};const r=l.getEvents().find(s=>s.id===t);if(!r)return{found:false,reason:"unknown id"};const n=d(r,k);return{found:true,id:t,event:n}},clearAppStorage:()=>_(),"timeTravel.undo":async e=>{const t=e?.id;if(!t)throw new Error("timeTravel.undo requires an event `id`");const r=l.getEvents().find(s=>s.id===t);if(!r)throw new Error(`No storage event with id "${t}"`);if(r.storageType==="mmkv"){throw new Error("Time travel supports AsyncStorage events only")}const n=r;if(!N(n)){throw new Error(`Event "${t}" (${n.action}) has no previous value captured, so it cannot be undone`)}await q(n);return{undone:true,action:n.action,key:n.data?.key}},"timeTravel.jump":async e=>{const{id:t,scope:r="key"}=e??{};if(!t)throw new Error("timeTravel.jump requires an event `id`");const n=l.getEvents().filter(a=>a.storageType!=="mmkv").slice().reverse();const s=n.find(a=>a.id===t);if(!s)throw new Error(`No AsyncStorage event with id "${t}"`);const i=r==="all"?n:n.filter(a=>a.data?.key===s.data?.key);const o=i.findIndex(a=>a.id===t);if(o===-1)throw new Error(`Event "${t}" is not in the timeline`);await K(i,o);return{jumped:true,scope:r,replayed:o+1,of:i.length,key:s.data?.key}},"async.getAllKeys":async()=>(await y.getAllKeys()).filter(e=>!c(e)),"async.multiGet":async e=>(await b(e.keys)).filter(([t])=>!c(t)),"async.getItem":e=>{const{key:t}=e;return c(t)?Promise.resolve(null):y.getItem(t)},"async.setItem":e=>{const{key:t,value:r}=e;return y.setItem(t,r)},"async.removeItem":e=>y.removeItem(e.key),"async.multiRemove":e=>I(e.keys),"async.multiSet":e=>V(e.pairs),"async.clear":()=>y.clear(),"mmkv.snapshot":()=>f.getAll().filter(({id:e})=>!c(e)).map(({id:e,instance:t,encrypted:r,readOnly:n})=>{let s=[];try{s=t.getAllKeys().filter(i=>!c(i)).map(i=>{const{value:o,type:a}=g(t,i);return{key:i,value:m(o),valueType:a}})}catch{}return{id:e,encrypted:r,readOnly:n,entries:s}}),"mmkv.get":e=>{const{instanceId:t,key:r}=e??{};if(!t||!r||c(r)||c(t)){return{found:false,reason:"missing instanceId/key"}}const n=f.get(t);if(!n){return{found:false,reason:"unknown instance"}}const{value:s,type:i}=g(n.instance,r);return{found:true,instanceId:t,key:r,value:k(s),valueType:i}},"mmkv.set":e=>{const{instanceId:t,key:r,value:n}=e;A(t).set(r,n)},"mmkv.remove":e=>{const{instanceId:t,key:r}=e;const n=A(t);if(n.remove)n.remove(r);else n.delete?.(r)},"secure.keys":async()=>{const e=u.getModule();return Promise.all(u.getAll().filter(({key:t})=>!c(t)).map(async({key:t,options:r,description:n})=>{let s=null;if(e&&!r.requireAuthentication){try{s=await e.getItemAsync(t,r)!=null}catch{s=null}}return{key:t,description:n,keychainService:r.keychainService,requireAuthentication:r.requireAuthentication??false,hasValue:s}}))},"secure.snapshot":async()=>{const e=u.getModule();const t=u.getAll().filter(({key:n})=>!c(n));const r=[];for(const{key:n,options:s,description:i}of t){let o=null;if(e&&!s.requireAuthentication){try{o=await e.getItemAsync(n,s)}catch{}}r.push({key:n,description:i,keychainService:s.keychainService,requireAuthentication:s.requireAuthentication??false,value:o==null?o:m(o)})}return r},"secure.get":e=>{const{key:t}=e;if(c(t))return null;const r=u.getAll().find(s=>s.key===t);const n=u.getModule();if(!r||!n||r.options.requireAuthentication){return Promise.resolve(null)}return n.getItemAsync(t,r.options)},"secure.set":e=>{const{key:t,value:r}=e;return u.setValue(t,r)},"secure.delete":e=>u.deleteValue(e.key)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{asyncStorage as e,asyncStorageCaps as u,readMany as h}from"./asyncStorageCompat";const c=Symbol.for("@buoy-gg/storage.asyncStorageOriginals");function
|
|
1
|
+
"use strict";import{isDevToolsStorageKey as d}from"@buoy-gg/shared-ui";import{asyncStorage as e,asyncStorageCaps as u,readMany as h}from"./asyncStorageCompat";const c=Symbol.for("@buoy-gg/storage.asyncStorageOriginals");function M(){return globalThis[c]??null}function I(o){globalThis[c]=o}class f{listeners=[];isListening=false;isInitialized=false;isPaused=false;ignoredKeys=new Set(["@react_buoy_storage_event_filters","@react_buoy_storage_key_filters","@react_buoy_storage_is_monitoring","REACT_QUERY_OFFLINE_CACHE"]);originalSetItem=null;originalRemoveItem=null;originalMergeItem=null;originalClear=null;originalMultiSet=null;originalMultiRemove=null;originalMultiMerge=null;originalSetMany=null;originalRemoveMany=null;shouldIgnoreKey(i){if(d(i))return true;if(this.ignoredKeys.has(i))return true;for(const s of this.ignoredKeys){if(i.startsWith(s))return true}return false}adoptOriginals(i){this.originalSetItem=i.setItem;this.originalRemoveItem=i.removeItem;this.originalClear=i.clear;this.originalMergeItem=i.mergeItem;this.originalMultiSet=i.multiSet;this.originalMultiRemove=i.multiRemove;this.originalMultiMerge=i.multiMerge;this.originalSetMany=i.setMany;this.originalRemoveMany=i.removeMany}async initialize(){if(this.isInitialized){return true}if(e.setItem.name==="swizzled_setItem"){const s=M();if(!s){return false}this.adoptOriginals(s);this.isInitialized=true;return true}const i={setItem:e.setItem.bind(e),removeItem:e.removeItem.bind(e),clear:e.clear.bind(e),mergeItem:null,multiSet:null,multiRemove:null,multiMerge:null,setMany:null,removeMany:null};if(u.hasLegacyMultiApi){i.multiSet=e.multiSet.bind(e);i.multiRemove=e.multiRemove.bind(e);i.mergeItem=e.mergeItem.bind(e);i.multiMerge=e.multiMerge?e.multiMerge.bind(e):null}else{i.setMany=e.setMany.bind(e);i.removeMany=e.removeMany.bind(e)}I(i);this.adoptOriginals(i);this.isInitialized=true;return true}restoreOriginalMethods(){if(!e||!this.originalSetItem){return}e.setItem=this.originalSetItem;if(this.originalRemoveItem){e.removeItem=this.originalRemoveItem}if(this.originalClear){e.clear=this.originalClear}if(this.originalMergeItem){e.mergeItem=this.originalMergeItem}if(this.originalMultiSet){e.multiSet=this.originalMultiSet}if(this.originalMultiRemove){e.multiRemove=this.originalMultiRemove}if(this.originalMultiMerge){e.multiMerge=this.originalMultiMerge}if(this.originalSetMany){e.setMany=this.originalSetMany}if(this.originalRemoveMany){e.removeMany=this.originalRemoveMany}}emit(i){if(this.isPaused){return}if(this.listeners.length===0){return}this.listeners.forEach(s=>{try{s(i)}catch(t){}})}async handleBatchSet(i,s,t="multiSet"){const r=i.filter(([g])=>!this.shouldIgnoreKey(g));if(r.length===0){return s()}const n=r.map(([g])=>g);let a=[];try{a=await h(n)}catch{}const m=await s();this.emit({action:t,timestamp:new Date,data:{pairs:r,prevPairs:a}});return m}async handleBatchRemove(i,s){const t=i.filter(a=>!this.shouldIgnoreKey(a));if(t.length===0){return s()}let r=[];try{r=await h(t)}catch{}const n=await s();this.emit({action:"multiRemove",timestamp:new Date,data:{keys:t,prevPairs:r}});return n}async startListening(){if(this.isListening){return}const i=await this.initialize();if(!i){return}if(e&&e.setItem.name==="swizzled_setItem"){this.restoreOriginalMethods()}const s=async(t,r)=>{if(!this.shouldIgnoreKey(t)){const n=this.originalSetItem?await e.getItem(t):null;const a=this.originalSetItem?await this.originalSetItem(t,r):void 0;this.emit({action:"setItem",timestamp:new Date,data:{key:t,value:r,prevValue:n}});return a}return this.originalSetItem?this.originalSetItem(t,r):Promise.resolve()};Object.defineProperty(s,"name",{value:"swizzled_setItem"});if(e){e.setItem=s}if(e){e.removeItem=async t=>{if(!this.shouldIgnoreKey(t)){const r=this.originalRemoveItem?await e.getItem(t):null;const n=this.originalRemoveItem?await this.originalRemoveItem(t):void 0;this.emit({action:"removeItem",timestamp:new Date,data:{key:t,prevValue:r}});return n}return this.originalRemoveItem?this.originalRemoveItem(t):Promise.resolve()}}if(u.hasMergeApi&&e){e.mergeItem=async(t,r)=>{if(!this.shouldIgnoreKey(t)){const n=this.originalMergeItem?await e.getItem(t):null;const a=this.originalMergeItem?await this.originalMergeItem(t,r):void 0;this.emit({action:"mergeItem",timestamp:new Date,data:{key:t,value:r,prevValue:n}});return a}return this.originalMergeItem?this.originalMergeItem(t,r):Promise.resolve()}}if(e){e.clear=async()=>{let t=[];try{const n=await e.getAllKeys();const a=n.filter(m=>!this.shouldIgnoreKey(m));if(a.length>0){t=await h(a)}}catch{}const r=this.originalClear?await this.originalClear():void 0;this.emit({action:"clear",timestamp:new Date,data:{prevPairs:t}});return r}}if(u.hasLegacyMultiApi&&e){e.multiSet=t=>this.handleBatchSet(t,()=>this.originalMultiSet?this.originalMultiSet(t):Promise.resolve());e.multiRemove=t=>this.handleBatchRemove(t,()=>this.originalMultiRemove?this.originalMultiRemove(t):Promise.resolve());if(this.originalMultiMerge){e.multiMerge=t=>this.handleBatchSet(t,()=>this.originalMultiMerge?this.originalMultiMerge(t):Promise.resolve(),"multiMerge")}}else if(e){e.setMany=t=>this.handleBatchSet(Object.entries(t),()=>this.originalSetMany?this.originalSetMany(t):Promise.resolve());e.removeMany=t=>this.handleBatchRemove(t,()=>this.originalRemoveMany?this.originalRemoveMany(t):Promise.resolve())}this.isListening=true}stopListening(){if(!this.isListening){return}if(!e){return}this.restoreOriginalMethods();this.isListening=false}addListener(i){this.listeners.push(i);return()=>{const s=this.listeners.indexOf(i);if(s>-1){this.listeners.splice(s,1)}}}removeAllListeners(){this.listeners=[]}get isActive(){return this.isListening}get listenerCount(){return this.listeners.length}pause(){this.isPaused=true}resume(){this.isPaused=false}get paused(){return this.isPaused}}const l=new f;export const startListening=()=>l.startListening();export const stopListening=()=>l.stopListening();export const addListener=o=>l.addListener(o);export const removeAllListeners=()=>l.removeAllListeners();export const isListening=()=>l.isActive;export const getListenerCount=()=>l.listenerCount;export const pauseCapture=()=>l.pause();export const resumeCapture=()=>l.resume();export const isPaused=()=>l.paused;export default l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{
|
|
1
|
+
"use strict";import{isDevToolsStorageKey as c,appStorageEvent as p}from"@buoy-gg/shared-ui";import{subscribeToBrowserStorage as d}from"@buoy-gg/shared-ui/utils";import{subscribePreferencesChanges as l,usesCapacitorPreferences as g}from"./capacitorPreferences";const t=new Set;let r;let n=false;const _=new Set(["@react_buoy_storage_event_filters","@react_buoy_storage_key_filters","@react_buoy_storage_is_monitoring","REACT_QUERY_OFFLINE_CACHE"]);const u=e=>c(e)||[..._].some(o=>e.startsWith(o));function a(e){const o=p(e);if(!o)return;e=o;for(const i of[...t]){try{i(e)}catch{}}}export async function startListening(){if(r||typeof window==="undefined")return;if(g()){r=l(e=>{if(!n)a(e)});return}r=d(e=>{if(n||e.area!=="localStorage"||e.key!==void 0&&u(e.key))return;const{area:o,action:i,...s}=e;if(s.prevPairs)s.prevPairs=s.prevPairs.filter(([f])=>!u(f));a({action:i,data:s,timestamp:new Date})})}export function stopListening(){r?.();r=void 0}export function addListener(e){t.add(e);return()=>{t.delete(e)}}export function removeAllListeners(){t.clear()}export function isListening(){return!!r}export function getListenerCount(){return t.size}export function pauseCapture(){n=true}export function resumeCapture(){n=false}export function isPaused(){return n}const m={startListening,stopListening,addListener,removeAllListeners,pause:pauseCapture,resume:resumeCapture,get isActive(){return isListening()},get listenerCount(){return t.size},get paused(){return n}};export default m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{detectMMKVType as l}from"./mmkvTypeDetection";class
|
|
1
|
+
"use strict";import{isDevToolsStorageKey as d}from"@buoy-gg/shared-ui";import{detectMMKVType as l}from"./mmkvTypeDetection";class g{listeners=[];instances=new Map;ignoredKeys=new Set(["@react_buoy_storage_event_filters","@react_buoy_storage_key_filters","@react_buoy_storage_is_monitoring","REACT_QUERY_OFFLINE_CACHE"]);shouldIgnoreKey(e){if(d(e))return true;if(this.ignoredKeys.has(e))return true;for(const t of this.ignoredKeys){if(e.startsWith(t))return true}return false}emit(e){if(this.listeners.length===0)return;this.listeners.forEach(t=>{try{t(e)}catch(r){}})}addInstance(e,t){if(this.instances.has(t)){return}let r;const o=new Map;try{for(const s of e.getAllKeys()??[]){if(this.shouldIgnoreKey(s))continue;o.set(s,l(e,s).value)}}catch{}if(typeof e.addOnValueChangedListener==="function"){try{r=e.addOnValueChangedListener(s=>{if(this.shouldIgnoreKey(s))return;const{value:a,type:i}=l(e,s);const u=o.get(s);const h=i==="unknown"||a===void 0;if(h){o.delete(s);const c={action:"delete",timestamp:new Date,instanceId:t,data:{key:s,prevValue:u,success:true}};this.emit(c)}else{o.set(s,a);const c=i==="string"?"set.string":i==="number"?"set.number":i==="boolean"?"set.boolean":i==="buffer"?"set.buffer":"set.string";const f={action:c,timestamp:new Date,instanceId:t,data:{key:s,value:a,prevValue:u,valueType:i,success:true}};this.emit(f)}})}catch(s){}}this.instances.set(t,{instance:e,instanceId:t,originalMethods:{},nativeListenerUnsubscribe:r,lastKnownValues:o})}removeInstance(e){const t=this.instances.get(e);if(!t){return}const{nativeListenerUnsubscribe:r}=t;try{if(typeof r==="function"){r()}else if(typeof r?.remove==="function"){r.remove()}}catch{}this.instances.delete(e)}removeAllInstances(){const e=Array.from(this.instances.keys());e.forEach(t=>this.removeInstance(t))}addListener(e){this.listeners.push(e);return()=>{const t=this.listeners.indexOf(e);if(t>-1){this.listeners.splice(t,1)}}}removeAllListeners(){this.listeners=[]}hasInstance(e){return this.instances.has(e)}getMonitoredInstances(){return Array.from(this.instances.keys())}get instanceCount(){return this.instances.size}get listenerCount(){return this.listeners.length}get isActive(){return this.instances.size>0}}export const mmkvListener=new g;export const addMMKVInstance=(n,e)=>mmkvListener.addInstance(n,e);export const removeMMKVInstance=n=>mmkvListener.removeInstance(n);export const removeAllMMKVInstances=()=>mmkvListener.removeAllInstances();export const addMMKVListener=n=>mmkvListener.addListener(n);export const removeAllMMKVListeners=()=>mmkvListener.removeAllListeners();export const isMMKVInstanceMonitored=n=>mmkvListener.hasInstance(n);export const getMonitoredMMKVInstances=()=>mmkvListener.getMonitoredInstances();export const getMMKVInstanceCount=()=>mmkvListener.instanceCount;export const getMMKVListenerCount=()=>mmkvListener.listenerCount;export const isMMKVListening=()=>mmkvListener.isActive;export default mmkvListener;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{getBrowserStorage as
|
|
1
|
+
"use strict";import{getBrowserStorage as f,subscribeToBrowserStorage as a}from"@buoy-gg/shared-ui/utils";import{isDevToolsStorageKey as s}from"@buoy-gg/shared-ui";import{registerMMKVInstance as g,unregisterMMKVInstance as c}from"./MMKVInstanceRegistry";import{usesCapacitorPreferences as l}from"./capacitorPreferences";let u=0;function d(o){const t=()=>f(o);const n=()=>Array.from({length:t().length},(e,r)=>t().key(r)).filter(e=>e!==null&&!s(e));return{set(e,r){t().setItem(e,String(r))},getString(e){return t().getItem(e)??void 0},getNumber(){return void 0},getBoolean(){return void 0},getBuffer(){return void 0},contains(e){return t().getItem(e)!==null},delete(e){const r=this.contains(e);t().removeItem(e);return r},getAllKeys:n,clearAll(){for(const e of n())t().removeItem(e)},get size(){return n().reduce((e,r)=>e+2*(r.length+(t().getItem(r)?.length??0)),0)},addOnValueChangedListener(e){return{remove:a(r=>{if(r.area!==o)return;if(r.key!==void 0){if(!s(r.key))e(r.key)}else r.prevPairs?.forEach(([i])=>{if(!s(i))e(i)})})}}}}function m(){return l()?["localStorage","sessionStorage"]:["sessionStorage"]}export function startBrowserStorageCapture(){if(typeof window==="undefined")return()=>{};try{f("sessionStorage")}catch{return()=>{}}const o=m();if(++u===1)for(const n of o)g(n,d(n));let t=true;return()=>{if(t){t=false;if(--u===0)for(const n of o)c(n)}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import R from"./appAsyncStorage";import{classifyPreviewItem as D,createRestoreScope as P,emptyRestoreResult as V,failedRestore as j,isDevToolsStorageKey as
|
|
1
|
+
"use strict";import R from"./appAsyncStorage";import{classifyPreviewItem as D,createRestoreScope as P,emptyRestoreResult as V,failedRestore as j,isDevToolsStorageKey as c,registerStateSnapshotProvider as x,unionKeys as w,wontApply as v}from"@buoy-gg/shared-ui";import{readMany as B,writeMany as L,removeMany as _}from"./asyncStorageCompat";import{clearAllAppStorage as C}from"./clearAllStorage";import{mmkvInstanceRegistry as $}from"./MMKVInstanceRegistry";import{detectMMKVType as W}from"./mmkvTypeDetection";import{secureStoreRegistry as g}from"./SecureStoreRegistry";function E(n,o){if(n.remove)n.remove(o);else n.delete?.(o)}function H(){return{canCapture:true,canRestore:true}}async function T(){const n=[];const o=(await R.getAllKeys()).filter(i=>!c(i));const a=(await B(o)).filter(i=>i[1]!==null);const s={};for(const{id:i,instance:d}of $.getAll().filter(({id:e})=>!c(e))){try{s[i]=d.getAllKeys().filter(e=>!c(e)).map(e=>{const{value:p,type:l}=W(d,e);if(l==="buffer"){n.push(`mmkv "${i}"/"${e}": ArrayBuffer value not capturable`)}return{key:e,value:p,valueType:l}})}catch{n.push(`mmkv "${i}": unreadable, captured without entries`);s[i]=[]}}const f={};const r=g.getModule();for(const{key:i,options:d}of g.getAll().filter(({key:e})=>!c(e))){if(d.requireAuthentication){n.push(`secure "${i}": biometric-protected, not capturable`);continue}let e=null;if(r){try{e=await r.getItemAsync(i,d)}catch{n.push(`secure "${i}": unreadable, captured as unset`)}}f[i]=e}return{data:{async:a,mmkv:s,secure:f},warnings:n}}async function N(){const{data:n,warnings:o}=await T();return{data:n,warnings:o}}async function U(n,o){const a=n;const s=P(o);const f=s.touch;const r=V();if(!a){return j("empty storage snapshot")}try{const e=(a.async??[]).filter(([t])=>!c(t)&&f(`async:${t}`));const p=new Set(e.map(([t])=>t));const l=(await R.getAllKeys()).filter(t=>!c(t));const h=l.filter(t=>!p.has(t)&&f(`async:${t}`));s.countExcluded((a.async??[]).length-e.length);if(h.length>0)await _(h);if(e.length>0)await L(e);r.applied+=e.length+h.length}catch(e){r.ok=false;r.warnings.push(`asyncstorage restore failed: ${String(e)}`)}for(const[e,p]of Object.entries(a.mmkv??{})){if(c(e))continue;const l=$.get(e);if(!l){r.skipped.push({id:`mmkv:${e}`,reason:"instance not registered"});continue}if(l.instance.isReadOnly){r.skipped.push({id:`mmkv:${e}`,reason:"instance registered read-only"});continue}const{instance:h}=l;try{const t=new Set(p.map(u=>u.key));const m=h.getAllKeys().filter(u=>!c(u));for(const u of m){if(!s.allows(`mmkv:${e}/${u}`))continue;if(!t.has(u)){E(h,u);r.applied+=1}}for(const u of p){if(c(u.key))continue;if(!f(`mmkv:${e}/${u.key}`))continue;if(u.valueType==="buffer"){r.skipped.push({id:`mmkv:${e}/${u.key}`,reason:"ArrayBuffer values cannot be restored"});continue}h.set(u.key,u.value);r.applied+=1}}catch(t){r.ok=false;r.warnings.push(`mmkv "${e}" restore failed: ${String(t)}`)}}const i=a.secure??{};for(const{key:e,options:p}of g.getAll().filter(({key:l})=>!c(l))){if(!s.allows(`secure:${e}`))continue;if(p.requireAuthentication){if(e in i){r.skipped.push({id:`secure:${e}`,reason:"biometric-protected keys are never written"})}continue}try{if(e in i){const l=i[e];if(l===null)await g.deleteValue(e);else await g.setValue(e,l)}else{await g.deleteValue(e)}r.applied+=1}catch(l){r.ok=false;r.warnings.push(`secure "${e}" restore failed: ${String(l)}`)}}for(const e of Object.keys(i)){if(c(e))continue;if(!f(`secure:${e}`))continue;if(!g.getAll().filter(({key:p})=>!c(p)).some(p=>p.key===e)){r.skipped.push({id:`secure:${e}`,reason:"key no longer registered with registerSecureStoreKeys"})}}const d=s.excludedWarning("item(s)");if(d)r.warnings.push(d);return r}async function z(){const n=V();try{await C();n.applied+=1}catch(o){n.ok=false;n.warnings.push(`asyncstorage clear failed: ${String(o)}`)}for(const{id:o,instance:a}of $.getAll().filter(({id:s})=>!c(s))){if(a.isReadOnly){n.skipped.push({id:`mmkv:${o}`,reason:"instance registered read-only"});continue}try{for(const s of a.getAllKeys().filter(f=>!c(f))){E(a,s);n.applied+=1}}catch(s){n.ok=false;n.warnings.push(`mmkv "${o}" clear failed: ${String(s)}`)}}for(const{key:o,options:a}of g.getAll().filter(({key:s})=>!c(s))){if(a.requireAuthentication){n.skipped.push({id:`secure:${o}`,reason:"biometric-protected keys are never written"});continue}try{await g.deleteValue(o);n.applied+=1}catch(s){n.ok=false;n.warnings.push(`secure "${o}" clear failed: ${String(s)}`)}}return n}const F=256*1024;function M(n,o,a,s,f,r){return D({key:n,label:o,oldValue:a,newValue:s,inOld:f,inNew:r},{equal:Object.is,tooLarge:i=>typeof i==="string"&&i.length>F,tooLargeReason:"value too large to render a diff \u2014 restore still applies it"})}async function G(n,o){const a=n??{async:[],mmkv:{},secure:{}};const s=o===void 0;const f=s?(await T()).data:o??{async:[],mmkv:{},secure:{}};const r=[];const i=[];const d=new Map(f.async??[]);const e=new Map(a.async??[]);for(const t of w(d,e)){if(c(t))continue;r.push(M(`async:${t}`,t,d.get(t),e.get(t),d.has(t),e.has(t)))}for(const t of w(f.mmkv,a.mmkv)){if(c(t))continue;const m=s?$.get(t):null;const u=s&&!m;const I=s&&m?.instance.isReadOnly===true;const A=new Map((f.mmkv?.[t]??[]).map(y=>[y.key,y]));const S=new Map((a.mmkv?.[t]??[]).map(y=>[y.key,y]));for(const y of w(A,S)){if(c(y))continue;const O=`mmkv:${t}/${y}`;const q=`${t} \xB7 ${y}`;const b=A.get(y);const K=S.get(y);let k=M(O,q,b?.value,K?.value,A.has(y),S.has(y));if(u){k=v(k,"MMKV instance not registered")}else if(I){k=v(k,"MMKV instance registered read-only")}else if(K?.valueType==="buffer"||b?.valueType==="buffer"){k=v(k,"ArrayBuffer values cannot be restored")}r.push(k)}}const p=f.secure??{};const l=a.secure??{};const h=s?new Map(g.getAll().filter(({key:t})=>!c(t)).map(t=>[t.key,t])):null;for(const t of w(p,l)){if(c(t))continue;let m=M(`secure:${t}`,t,p[t],l[t],t in p,t in l);if(s){const u=h?.get(t);if(!u){m=v(m,"key no longer registered with registerSecureStoreKeys")}else if(u.options.requireAuthentication){m=v(m,"biometric-protected keys are never written")}}r.push(m)}return{items:r,notes:i}}x({id:"storage",label:"Storage",status:H,capture:N,restore:U,clear:z,previewItems:G});
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* useMMKVInstances Hook
|
|
3
|
-
*
|
|
4
|
-
* React hook to monitor all registered MMKV instances and their metadata.
|
|
5
|
-
* Works with MMKVInstanceRegistry to provide UI components with instance information.
|
|
6
|
-
*
|
|
7
|
-
* This hook enables:
|
|
8
|
-
* - Multi-instance dropdown/selector UI
|
|
9
|
-
* - Instance metadata display (encrypted, readOnly, key count)
|
|
10
|
-
* - Dynamic updates when instances are added/removed
|
|
11
|
-
*
|
|
12
|
-
* @see MMKVInstanceRegistry.ts for instance registration
|
|
13
|
-
*/
|
|
14
1
|
/**
|
|
15
2
|
* Metadata about an MMKV instance with additional runtime information
|
|
16
3
|
*/
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* useMMKVKeys Hook
|
|
3
|
-
*
|
|
4
|
-
* Fetch and validate MMKV keys from a specific MMKV instance.
|
|
5
|
-
* Equivalent to useAsyncStorageKeys but for MMKV storage.
|
|
6
|
-
*
|
|
7
|
-
* Key Differences from AsyncStorage:
|
|
8
|
-
* - Synchronous API (getAllKeys(), getString(), etc.)
|
|
9
|
-
* - Native types (string, number, boolean, buffer) vs string-only
|
|
10
|
-
* - Multi-instance support (requires instanceId parameter)
|
|
11
|
-
* - No multiGet - must fetch keys individually
|
|
12
|
-
*/
|
|
13
1
|
import { StorageKeyInfo, RequiredStorageKey } from '../types';
|
|
14
2
|
type MMKV = any;
|
|
15
3
|
interface UseMMKVKeysResult {
|
|
@@ -58,6 +58,7 @@ export type StorageEventListener = (events: StorageEvent[]) => void;
|
|
|
58
58
|
*/
|
|
59
59
|
export type StorageEventCallback = (event: StorageEvent) => void;
|
|
60
60
|
declare class StorageEventStore extends BaseEventStore<StorageEvent> {
|
|
61
|
+
protected addEvent(event: StorageEvent): void;
|
|
61
62
|
private asyncStorageUnsubscribe;
|
|
62
63
|
private mmkvUnsubscribe;
|
|
63
64
|
private hasScannedInitialState;
|
|
@@ -153,7 +153,7 @@ export declare const storageSyncAdapter: {
|
|
|
153
153
|
* firing one `secure.get` per key per refresh.
|
|
154
154
|
*/
|
|
155
155
|
"secure.snapshot": () => Promise<SecureSnapshotEntry[]>;
|
|
156
|
-
"secure.get": (params?: unknown) => Promise<string | null
|
|
156
|
+
"secure.get": (params?: unknown) => Promise<string | null> | null;
|
|
157
157
|
/**
|
|
158
158
|
* Write a registered SecureStore key. Goes through the registry so the
|
|
159
159
|
* value is written with the SAME options it was registered with — writing
|