@@ -2,121 +2,24 @@ import i18next from 'i18next';
22import { UpdatePreferencesRequestBody } from '../../../../common/types' ;
33import { apiClient } from '../../../utils/apiClient' ;
44import * as ActionTypes from '../../../constants' ;
5- import type { PreferencesState } from '../reducers/preferences' ;
6- import type { RootState } from '../../../reducers' ;
7-
8- // Value Definitions:
9- export type SetPreferencesTabValue = PreferencesState [ 'tabIndex' ] ;
10- export type SetFontSizeValue = PreferencesState [ 'fontSize' ] ;
11- export type SetLineNumbersValue = PreferencesState [ 'lineNumbers' ] ;
12- export type SetAutocloseBracketsQuotesValue = PreferencesState [ 'autocloseBracketsQuotes' ] ;
13- export type SetAutocompleteHinterValue = PreferencesState [ 'autocompleteHinter' ] ;
14- export type SetAutosaveValue = PreferencesState [ 'autosave' ] ;
15- export type SetLinewrapValue = PreferencesState [ 'linewrap' ] ;
16- export type SetLintWarningValue = PreferencesState [ 'lintWarning' ] ;
17- export type SetTextOutputValue = PreferencesState [ 'textOutput' ] ;
18- export type SetGridOutputValue = PreferencesState [ 'gridOutput' ] ;
19- export type SetThemeValue = PreferencesState [ 'theme' ] ;
20- export type SetAutorefreshValue = PreferencesState [ 'autorefresh' ] ;
21- export type SetLanguageValue = PreferencesState [ 'language' ] ;
22- export type SetAllAccessibleOutputValue =
23- | SetTextOutputValue
24- | SetGridOutputValue ;
25-
26- // Action Definitions:
27- export type OpenPreferencesAction = {
28- type : typeof ActionTypes . OPEN_PREFERENCES ;
29- } ;
30- export type SetPreferencesAction = {
31- type : typeof ActionTypes . SET_PREFERENCES ;
32- preferences : PreferencesState ;
33- } ;
34- export type SetErrorAction = {
35- type : typeof ActionTypes . ERROR ;
36- error : unknown ;
37- } ;
38-
39- export type SetPreferencesTabAction = {
40- type : typeof ActionTypes . SET_PREFERENCES_TAB ;
41- value : SetPreferencesTabValue ;
42- } ;
43- export type SetFontSizeAction = {
44- type : typeof ActionTypes . SET_FONT_SIZE ;
45- value : SetFontSizeValue ;
46- } ;
47- export type SetLineNumbersAction = {
48- type : typeof ActionTypes . SET_LINE_NUMBERS ;
49- value : SetLineNumbersValue ;
50- } ;
51- export type SetAutocloseBracketsQuotesAction = {
52- type : typeof ActionTypes . SET_AUTOCLOSE_BRACKETS_QUOTES ;
53- value : SetAutocloseBracketsQuotesValue ;
54- } ;
55- export type SetAutocompleteHinterAction = {
56- type : typeof ActionTypes . SET_AUTOCOMPLETE_HINTER ;
57- value : SetAutocompleteHinterValue ;
58- } ;
59- export type SetAutosaveAction = {
60- type : typeof ActionTypes . SET_AUTOSAVE ;
61- value : SetAutosaveValue ;
62- } ;
63- export type SetLinewrapAction = {
64- type : typeof ActionTypes . SET_LINEWRAP ;
65- value : SetLinewrapValue ;
66- } ;
67- export type SetLintWarningAction = {
68- type : typeof ActionTypes . SET_LINT_WARNING ;
69- value : SetLintWarningValue ;
70- } ;
71- export type SetTextOutputAction = {
72- type : typeof ActionTypes . SET_TEXT_OUTPUT ;
73- value : SetTextOutputValue ;
74- } ;
75- export type SetGridOutputAction = {
76- type : typeof ActionTypes . SET_GRID_OUTPUT ;
77- value : SetGridOutputValue ;
78- } ;
79- export type SetThemeAction = {
80- type : typeof ActionTypes . SET_THEME ;
81- value : SetThemeValue ;
82- } ;
83- export type SetAutorefreshAction = {
84- type : typeof ActionTypes . SET_AUTOREFRESH ;
85- value : SetAutorefreshValue ;
86- } ;
87- export type SetLanguageAction = {
88- type : typeof ActionTypes . SET_LANGUAGE ;
89- language : SetLanguageValue ;
90- } ;
91-
92- export type PreferencesAction =
93- | OpenPreferencesAction
94- | SetPreferencesAction
95- | SetErrorAction
96- | SetPreferencesTabAction
97- | SetFontSizeAction
98- | SetLineNumbersAction
99- | SetAutocloseBracketsQuotesAction
100- | SetAutocompleteHinterAction
101- | SetAutosaveAction
102- | SetLinewrapAction
103- | SetLintWarningAction
104- | SetTextOutputAction
105- | SetGridOutputAction
106- | SetThemeAction
107- | SetAutorefreshAction
108- | SetLanguageAction ;
109-
110- export type UpdatePreferencesDispatch = (
111- action : PreferencesAction | PreferencesThunk
112- ) => void ;
113-
114- export type PreferencesThunk = (
115- dispatch : UpdatePreferencesDispatch ,
116- getState : GetRootState
117- ) => void ;
118-
119- export type GetRootState = ( ) => RootState ;
5+ import type {
6+ UpdatePreferencesDispatch ,
7+ SetPreferencesTabValue ,
8+ SetFontSizeValue ,
9+ GetRootState ,
10+ SetLineNumbersValue ,
11+ SetAutocloseBracketsQuotesValue ,
12+ SetAutocompleteHinterValue ,
13+ SetAutosaveValue ,
14+ SetLinewrapValue ,
15+ SetLintWarningValue ,
16+ SetTextOutputValue ,
17+ SetAllAccessibleOutputValue ,
18+ SetAutorefreshValue ,
19+ SetGridOutputValue ,
20+ SetLanguageValue ,
21+ SetThemeValue
22+ } from './preferences.types' ;
12023
12124function updatePreferences (
12225 formParams : UpdatePreferencesRequestBody ,
0 commit comments