diff options
Diffstat (limited to 'src/view/options.ts')
-rw-r--r-- | src/view/options.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/view/options.ts b/src/view/options.ts index 4a57f97..31fd631 100644 --- a/src/view/options.ts +++ b/src/view/options.ts @@ -1,14 +1,14 @@ -export type Options = { - major: boolean, - minor: boolean, - seventh: boolean, - minorSeventh: boolean, - majorSeventh: boolean, - bpm: number, +export interface Model { + major: boolean + minor: boolean + seventh: boolean + minorSeventh: boolean + majorSeventh: boolean + bpm: number beatsPerChord: number } -let defaultOptions: Options = { +let init: Model = { major: true, minor: false, seventh: false, @@ -20,11 +20,11 @@ let defaultOptions: Options = { let key: string = 'options' -export function load(): Options { +export function load(): Model { let str = localStorage[key] - return str && JSON.parse(str) || defaultOptions + return str && JSON.parse(str) || init } -export function save(options: Options): void { +export function save(options: Model): void { localStorage[key] = JSON.stringify(options) } |