35 lines
801 B
TypeScript
Raw Normal View History

2019-12-18 17:11:58 +09:00
import ElectronStore from 'electron-store';
2019-11-11 15:53:39 +09:00
const STORE_KEY_STARTUPHIDEWINDOW = 'options.startupHideWindow';
2019-12-18 17:11:58 +09:00
export class Storage {
private readonly store: ElectronStore<any>;
2019-11-11 15:53:39 +09:00
constructor() {
2019-12-18 17:11:58 +09:00
this.store = new ElectronStore({
2019-11-11 15:53:39 +09:00
schema: {
options: {
type: 'object',
properties: {
startupHideWindow: {
type: 'boolean'
}
},
default: {
startupHideWindow: false
}
}
},
encryptionKey: 'ucap',
fileExtension: 'dat'
});
}
get startupHideWindow(): boolean {
2019-12-18 17:11:58 +09:00
return this.store.get(STORE_KEY_STARTUPHIDEWINDOW, false);
2019-11-11 15:53:39 +09:00
}
set startupHideWindow(startupHideWindow: boolean) {
2019-12-18 17:11:58 +09:00
this.store.set(STORE_KEY_STARTUPHIDEWINDOW, startupHideWindow);
2019-11-11 15:53:39 +09:00
}
}