-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
ui-state-updaters.d.ts
194 lines (183 loc) · 5.18 KB
/
ui-state-updaters.d.ts
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
import * as UiStateActions from 'actions/ui-state-actions';
import {ToggleSplitMapUpdaterAction} from 'actions/map-state-actions';
import {LoadFilesUpdaterAction, LoadFilesErrUpdaterAction} from ' actions/vis-state-actions';
export type ExportImage = {
ratio: string;
resolution: string;
legend: boolean;
mapH: number;
mapW: number;
imageSize: {
zoomOffset: number;
scale: number;
imageW: number;
imageH: number;
};
// exporting state
imageDataUri: string;
exporting: boolean;
processing: boolean;
error: Error;
};
export type ExportData = {
selectedDataset: string;
dataType: string;
filtered: boolean;
};
export type ExportHtml = {
exportMapboxAccessToken: null | string;
userMapboxToken: string;
mode: string;
};
export type ExportJson = {
hasData: boolean;
};
export type ExportMap = {
HTML: ExportHtml;
JSON: ExportJson;
format: 'HTML' | 'JSON';
};
export type MapControl = {
show: boolean;
active: boolean;
disableClose?: boolean;
activeMapIndex?: number;
};
export type MapControls = {
visibleLayers: MapControl;
mapLegend: MapControl;
toggle3d: MapControl;
splitMap: MapControl;
mapDraw: MapControl;
mapLocale: MapControl;
};
export type LoadFiles = {
fileLoading: boolean;
};
export type Notifications = {
message: string;
type: string;
topic: string;
id: string;
};
export type Locale = string;
export type UiState = {
readOnly: boolean;
activeSidePanel: string;
currentModal: string | null;
datasetKeyToRemove: string | null;
visibleDropdown: string | null;
// export image modal ui
exportImage: ExportImage;
// export data modal ui
exportData: ExportData;
// html export
exportMap: ExportMap;
// map control panels
mapControls: MapControls;
// ui notifications
notifications: Notifications[];
// load files
loadFiles: LoadFiles;
// Locale of the UI
locale: Locale;
};
export const DEFAULT_MAP_CONTROLS: MapControls;
export const DEFAULT_EXPORT_IMAGE: ExportImage;
export const INITIAL_UI_STATE: UiState;
export function toggleSidePanelUpdater(
state: UiState,
action: UiStateActions.ToggleSidePanelUpdaterAction
): UiState;
export function toggleModalUpdater(
state: UiState,
action: UiStateActions.ToggleModalUpdaterAction
): UiState;
export function showExportDropdownUpdater(
state: UiState,
action: UiStateActions.ShowExportDropdownUpdaterAction
): UiState;
export function hideExportDropdownUpdater(
state: UiState,
action: UiStateActions.HideExportDropdownUpdaterAction
): UiState;
export function toggleMapControlUpdater(
state: UiState,
action: UiStateActions.ToggleMapControlUpdaterAction
): UiState;
export function openDeleteModalUpdater(
state: UiState,
action: UiStateActions.OpenDeleteModalUpdaterAction
): UiState;
export function addNotificationUpdater(
state: UiState,
action: UiStateActions.AddNotificationUpdaterAction
): UiState;
export function removeNotificationUpdater(
state: UiState,
action: UiStateActions.RemoveNotificationUpdaterAction
): UiState;
export function setExportImageSettingUpdater(
state: UiState,
action: UiStateActions.SetExportImageSettingUpdaterAction
): UiState;
export function setExportImageDataUriUpdater(
state: UiState,
action: UiStateActions.SetExportImageDataUriUpdaterAction
): UiState;
export function setExportImageErrorUpdater(
state: UiState,
action: UiStateActions.SetExportImageErrorUpdaterAction
): UiState;
export function cleanupExportImageUpdater(
state: UiState,
action: UiStateActions.CleanupExportImageUpdaterAction
): UiState;
export function startExportingImageUpdater(
state: UiState,
action: UiStateActions.startExportingImage
): UiState;
export function setExportSelectedDatasetUpdater(
state: UiState,
action: UiStateActions.SetExportSelectedDatasetUpdaterAction
): UiState;
export function setExportDataTypeUpdater(
state: UiState,
action: UiStateActions.SetExportDataTypeUpdaterAction
): UiState;
export function setExportFilteredUpdater(
state: UiState,
action: UiStateActions.SetExportFilteredUpdaterAction
): UiState;
export function setExportDataUpdater(
state: UiState,
action: UiStateActions.SetExportDataUpdaterAction
): UiState;
export function setUserMapboxAccessTokenUpdater(
state: UiState,
action: UiStateActions.SetUserMapboxAccessTokenUpdaterAction
): UiState;
export function setExportMapFormatUpdater(
state: UiState,
action: UiStateActions.SetExportMapFormatUpdaterAction
): UiState;
export function setExportMapHTMLModeUpdater(
state: UiState,
action: UiStateActions.SetExportHTMLMapModeUpdaterAction
): UiState;
export function showDatasetTableUpdater(state: UiState);
export function setLocaleUpdater(
state: UiState,
action: UiStateActions.SetLocaleUpdaterAction
): UiState;
export function loadFilesUpdater(state: UiState, action: LoadFilesUpdaterAction): UiState;
export function loadFilesErrUpdater(state: UiState, action: LoadFilesErrUpdaterAction): UiState;
export function loadFilesSuccessUpdater(state: UiState): UiState;
export function toggleSplitMapUpdater(state: UiState, action: ToggleSplitMapUpdaterAction): UiState;
export function initUiStateUpdater(
state: UiState,
action: {
type?: ActionTypes.INIT;
payload: KeplerGlInitPayload;
}
): UiState;