Files
notesnook/packages/core/database/storage.js

25 lines
530 B
JavaScript
Raw Normal View History

2020-02-02 20:07:11 +05:00
export default class Storage {
constructor(context) {
this.storage = context;
}
async write(key, data) {
await this.storage.write(key, data);
2020-02-02 20:07:11 +05:00
}
async read(key) {
let data = await this.storage.read(key);
return data;
2020-02-02 20:07:11 +05:00
}
2020-02-20 12:11:16 +05:00
async clear() {
await this.storage.clear();
2020-02-02 20:07:11 +05:00
}
2020-02-20 12:11:16 +05:00
async remove(key) {
await this.storage.remove(key);
2020-02-02 20:07:11 +05:00
}
encrypt(password, data) {
return this.storage.encrypt(password, data);
}
decrypt(password, cipher) {
return this.storage.decrypt(password, cipher);
}
}