diff options
Diffstat (limited to 'src/settings/actions/index.ts')
-rw-r--r-- | src/settings/actions/index.ts | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/settings/actions/index.ts b/src/settings/actions/index.ts new file mode 100644 index 0000000..b1e996e --- /dev/null +++ b/src/settings/actions/index.ts @@ -0,0 +1,36 @@ +import { + JSONSettings, FormSettings, SettingSource, +} from '../../shared/SettingData'; + +// Settings +export const SETTING_SET_SETTINGS = 'setting.set.settings'; +export const SETTING_SHOW_ERROR = 'setting.show.error'; +export const SETTING_SWITCH_TO_FORM = 'setting.switch.to.form'; +export const SETTING_SWITCH_TO_JSON = 'setting.switch.to.json'; + +interface SettingSetSettingsAcion { + type: typeof SETTING_SET_SETTINGS; + source: SettingSource; + json?: JSONSettings; + form?: FormSettings; +} + +interface SettingShowErrorAction { + type: typeof SETTING_SHOW_ERROR; + error: string; + json: JSONSettings; +} + +interface SettingSwitchToFormAction { + type: typeof SETTING_SWITCH_TO_FORM; + form: FormSettings, +} + +interface SettingSwitchToJsonAction { + type: typeof SETTING_SWITCH_TO_JSON; + json: JSONSettings, +} + +export type SettingAction = + SettingSetSettingsAcion | SettingShowErrorAction | + SettingSwitchToFormAction | SettingSwitchToJsonAction; |