decord/beta/source/stores/MobileCacheSnapshotStore.tsx
github-actions 19e52f659f chore: update source for beta 347.11
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
2026-09-26 17:57:22 +00:00

78 lines
2.6 KiB
TypeScript

// Module ID: 1073
// Function ID: 1074
// Name: MobileCacheSnapshotStore
// Dependencies: [504, 573, 38, 510, 2]
// Module 1073 (MobileCacheSnapshotStore)
import _modDef38 from "module_38" /* 38 */;
import initializeDefault from "initialize" /* 504 */;
import Storage2 from "Storage" /* 510 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
require = fn;
let MobileCacheSnapshotStore;
const Store = initializeDefault.Store;
class MobileCacheSnapshotStore extends Store {
constructor(arg0, arg1) {
closure_0 = undefined;
tmp3 = closure_1(closure_2[1]);
obj = {};
merged = Object.assign(global);
obj.CLEAR_CACHES = function CLEAR_CACHES() {
closure_0.clear();
return false;
};
obj.WRITE_CACHES = function WRITE_CACHES() {
closure_0.save();
return false;
};
tmp21 = new tmp2(tmp3, obj, fn, new.target, tmp2, tmp3, obj, new.target, undefined, tmp, global, closure_1);
closure_0 = tmp21;
tmp5 = closure_1(closure_2[2]);
tmp5Result = tmp5(null != tmp21.getClass().displayName, "Snapshot stores need a display name");
tmp7 = closure_1(closure_2[2])(!("CLEAR_CACHES" in global), "MobileCacheSnapshotStores cannot use the 'CLEAR_CACHES' action");
tmp8 = closure_1(closure_2[2])(!("WRITE_CACHES" in global), "MobileCacheSnapshotStores cannot use the 'WRITE_CACHES' action");
allStores = MobileCacheSnapshotStore.allStores;
arr1 = allStores.push(tmp21);
return tmp21;
}
}
const prototype = MobileCacheSnapshotStore.prototype;
MobileCacheSnapshotStore["clearAll"] = function clearAll() {
const allStores = MobileCacheSnapshotStore.allStores;
const item = allStores.forEach((clear) => clear.clear());
};
Object.defineProperty(prototype, "persistKey", {
get: function persistKey() {
return "" + this.getClass().displayName + "-snapshot";
},
set: undefined
});
prototype["clear"] = function clear() {
const Storage = Storage2.Storage;
Storage.remove(this.persistKey);
};
prototype["save"] = function save() {
const Storage = Storage2.Storage;
const result = Storage.set(this.persistKey, this.takeSnapshot());
};
prototype["readSnapshot"] = function readSnapshot(LATEST_SNAPSHOT_VERSION) {
const Storage = Storage2.Storage;
value = Storage.get(this.persistKey);
let data = null;
if (null != value) {
data = null;
if (value.version === LATEST_SNAPSHOT_VERSION) {
data = value.data;
}
}
return data;
};
prototype["getClass"] = function getClass() {
return this.constructor;
};
MobileCacheSnapshotStore.allStores = [];
const size = fn(2);
let result = size.fileFinishedImporting("stores/MobileCacheSnapshotStore.tsx");
export default MobileCacheSnapshotStore;