decord/source/stores/MobileCacheSnapshotStore.tsx

79 lines
2.6 KiB
TypeScript
Raw Normal View History

// Module ID: 1073
// Function ID: 1074
// Name: MobileCacheSnapshotStore
// Dependencies: [504, 573, 38, 510, 2]
2026-07-20 16:05:17 +00:00
// Module 1073 (MobileCacheSnapshotStore)
2026-08-24 06:08:38 +00:00
import _modDef38 from "module_38" /* 38 */;
import initializeDefault from "initialize" /* 504 */;
import Storage2 from "Storage" /* 510 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
2026-07-23 10:11:24 +00:00
require = fn;
2026-07-29 08:29:29 +00:00
let MobileCacheSnapshotStore;
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class MobileCacheSnapshotStore extends Store {
constructor(arg0, arg1) {
2026-08-24 06:08:38 +00:00
closure_0 = undefined;
tmp3 = closure_1(closure_2[1]);
2026-07-29 08:29:29 +00:00
obj = {};
merged = Object.assign(global);
obj.CLEAR_CACHES = function CLEAR_CACHES() {
closure_0.clear();
2026-07-29 08:29:29 +00:00
return false;
};
obj.WRITE_CACHES = function WRITE_CACHES() {
closure_0.save();
2026-07-29 08:29:29 +00:00
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");
2026-07-29 08:29:29 +00:00
allStores = MobileCacheSnapshotStore.allStores;
arr1 = allStores.push(tmp21);
return tmp21;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
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() {
2026-08-24 06:08:38 +00:00
const Storage = Storage2.Storage;
2026-07-29 08:29:29 +00:00
Storage.remove(this.persistKey);
};
prototype["save"] = function save() {
2026-08-24 06:08:38 +00:00
const Storage = Storage2.Storage;
2026-07-29 08:29:29 +00:00
const result = Storage.set(this.persistKey, this.takeSnapshot());
};
prototype["readSnapshot"] = function readSnapshot(LATEST_SNAPSHOT_VERSION) {
2026-08-24 06:08:38 +00:00
const Storage = Storage2.Storage;
value = Storage.get(this.persistKey);
2026-07-29 08:29:29 +00:00
let data = null;
if (null != value) {
data = null;
if (value.version === LATEST_SNAPSHOT_VERSION) {
data = value.data;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return data;
};
prototype["getClass"] = function getClass() {
return this.constructor;
};
MobileCacheSnapshotStore.allStores = [];
const size = fn(2);
let result = size.fileFinishedImporting("stores/MobileCacheSnapshotStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default MobileCacheSnapshotStore;