aboutsummaryrefslogtreecommitdiff
path: root/src/settings/actions/index.ts
blob: 75c6bb53f708a947bfe1d5ce5c9b99a2fb036d66 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// 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;