aboutsummaryrefslogtreecommitdiff
path: root/src/settings/actions/index.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-05-02 11:12:28 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2019-05-02 22:07:54 +0900
commite69497fab457df486b2a7068bdd0283505461f8b (patch)
treef1cb4111bae89160d4238df9057493a50acacc39 /src/settings/actions/index.ts
parentc059bf8be3b302173f2cab0d22a434aea4a6e0bd (diff)
Types src/settings
Diffstat (limited to 'src/settings/actions/index.ts')
-rw-r--r--src/settings/actions/index.ts39
1 files changed, 32 insertions, 7 deletions
diff --git a/src/settings/actions/index.ts b/src/settings/actions/index.ts
index 016f2a5..75c6bb5 100644
--- a/src/settings/actions/index.ts
+++ b/src/settings/actions/index.ts
@@ -1,7 +1,32 @@
-export default {
- // Settings
- SETTING_SET_SETTINGS: 'setting.set.settings',
- SETTING_SHOW_ERROR: 'setting.show.error',
- SETTING_SWITCH_TO_FORM: 'setting.switch.to.form',
- SETTING_SWITCH_TO_JSON: 'setting.switch.to.json',
-};
+// 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: string;
+ json: string;
+ form: any;
+}
+
+interface SettingShowErrorAction {
+ type: typeof SETTING_SHOW_ERROR;
+ error: string;
+ json: string;
+}
+
+interface SettingSwitchToFormAction {
+ type: typeof SETTING_SWITCH_TO_FORM;
+ form: any;
+}
+
+interface SettingSwitchToJsonAction {
+ type: typeof SETTING_SWITCH_TO_JSON;
+ json: string;
+}
+
+export type SettingAction =
+ SettingSetSettingsAcion | SettingShowErrorAction |
+ SettingSwitchToFormAction | SettingSwitchToJsonAction;