diff options
author | Shin'ya UEOKA <ueokande@i-beam.org> | 2019-10-05 02:06:02 +0000 |
---|---|---|
committer | Shin'ya UEOKA <ueokande@i-beam.org> | 2019-10-06 12:58:59 +0000 |
commit | 574692551a27ea56660bf2061daeaa0d34beaff4 (patch) | |
tree | 414a7f1de8dfb24af45d7e392b72549bc67ad48a /src/shared/SettingData.ts | |
parent | 2116ac90a6dfdb0910d7ad2896f70a052aa635cc (diff) |
Make Properties class
Diffstat (limited to 'src/shared/SettingData.ts')
-rw-r--r-- | src/shared/SettingData.ts | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/shared/SettingData.ts b/src/shared/SettingData.ts index 6605c80..aa4e382 100644 --- a/src/shared/SettingData.ts +++ b/src/shared/SettingData.ts @@ -2,6 +2,7 @@ import * as operations from './operations'; import Settings, * as settings from './Settings'; import Keymaps from './settings/Keymaps'; import Search from './settings/Search'; +import Properties from './settings/Properties'; export class FormKeymaps { private data: {[op: string]: string}; @@ -143,14 +144,14 @@ export class FormSettings { private search: FormSearch; - private properties: settings.Properties; + private properties: Properties; private blacklist: string[]; constructor( keymaps: FormKeymaps, search: FormSearch, - properties: settings.Properties, + properties: Properties, blacklist: string[], ) { this.keymaps = keymaps; @@ -177,7 +178,7 @@ export class FormSettings { ); } - buildWithProperties(props: settings.Properties): FormSettings { + buildWithProperties(props: Properties): FormSettings { return new FormSettings( this.keymaps, this.search, @@ -199,7 +200,7 @@ export class FormSettings { return settings.valueOf({ keymaps: this.keymaps.toKeymaps().toJSON(), search: this.search.toSearchSettings().toJSON(), - properties: this.properties, + properties: this.properties.toJSON(), blacklist: this.blacklist, }); } @@ -207,13 +208,13 @@ export class FormSettings { toJSON(): { keymaps: ReturnType<FormKeymaps['toJSON']>; search: ReturnType<FormSearch['toJSON']>; - properties: settings.Properties; + properties: ReturnType<Properties['toJSON']>; blacklist: string[]; } { return { keymaps: this.keymaps.toJSON(), search: this.search.toJSON(), - properties: this.properties, + properties: this.properties.toJSON(), blacklist: this.blacklist, }; } @@ -227,7 +228,7 @@ export class FormSettings { return new FormSettings( FormKeymaps.valueOf(o.keymaps), FormSearch.valueOf(o.search), - settings.propertiesValueOf(o.properties), + Properties.fromJSON(o.properties), settings.blacklistValueOf(o.blacklist), ); } |