@@ -287,19 +287,50 @@ export type ThemeName = 'default' | 'night';
287
287
*/
288
288
export type BrowserPreference = 'embedded' | 'external' | 'default' ;
289
289
290
+ /**
291
+ * The user's chosen settings specific to this account.
292
+ */
293
+ export type PerAccountSettingsState = $ReadOnly < {
294
+ offlineNotification : boolean ,
295
+ onlineNotification : boolean ,
296
+ streamNotification : boolean ,
297
+ ...
298
+ } > ;
299
+
300
+ /**
301
+ * The user's chosen settings.
302
+ *
303
+ * This is a mix of server data representing the active account (see
304
+ * {@link PerAccountSettingsState}), and client-only data that applies
305
+ * across all the user's accounts on this client (i.e. on this install of
306
+ * the app on this device.)
307
+ */
290
308
export type SettingsState = $ReadOnly < { |
309
+ ...$Exact < PerAccountSettingsState > ,
310
+
311
+ // The properties below apply independent of account. That also means
312
+ // they can't come from the server. For per-account settings, see
313
+ // PerAccountSettingsState.
314
+
291
315
// The user's chosen language, as an IETF BCP 47 language tag.
292
316
language : string ,
293
317
294
318
theme : ThemeName ,
295
- offlineNotification : boolean ,
296
- onlineNotification : boolean ,
297
- experimentalFeaturesEnabled : boolean ,
298
- streamNotification : boolean ,
299
319
browser : BrowserPreference ,
320
+
321
+ // TODO cut this? what was it?
322
+ experimentalFeaturesEnabled : boolean ,
323
+
324
+ // Possibly this should be per-account. If so it should probably be put
325
+ // on the server, so it can also be cross-device for the account.
300
326
doNotMarkMessagesAsRead : boolean ,
301
327
| } > ;
302
328
329
+ // As part of letting GlobalState freely convert to PerAccountState,
330
+ // we'll want the same for SettingsState. (This is also why
331
+ // PerAccountSettingsState is inexact.)
332
+ ( s : SettingsState ) : PerAccountSettingsState => s ; // eslint-disable-line no-unused-expressions
333
+
303
334
export type StreamsState = $ReadOnlyArray < Stream > ;
304
335
305
336
export type SubscriptionsState = $ReadOnlyArray < Subscription > ;
0 commit comments