import { Injectable } from '@angular/core' ; import Store from 'electron-store' ; export interface ConfigType { betterttv : boolean ; frankerfacez : boolean ; autologin : boolean ; openlinks : boolean ; bufferLength : number ; notifications : boolean ; preferredQuality : string ; } const defaults = { betterttv : false , frankerfacez : false , autologin : true , openlinks : true , bufferLength : 10 , notifications : false , preferredQuality : 'auto' } ; @ Injectable ( ) export class SettingsService { store = null ; constructor ( ) { this . store = new Store < ConfigType > ( { defaults } ) ; } getConfig ( ) { return this . store . store ; } setConfig ( config ) { this . store . store = config ; } getStore ( ) { return this . store ; } }