File tree 2 files changed +24
-35
lines changed
2 files changed +24
-35
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,7 @@ import {
66
66
EVENT ,
67
67
} from './actionConstants' ;
68
68
69
- import { EventTypes } from './api/eventTypes' ;
70
- import type { MessageEvent , PresenceEvent } from './api/eventTypes' ;
69
+ import type { MessageEvent , PresenceEvent , StreamEvent } from './api/eventTypes' ;
71
70
72
71
import type {
73
72
Dimensions ,
@@ -304,40 +303,9 @@ type EventSubscriptionPeerRemoveAction = {|
304
303
user_id : number ,
305
304
| } ;
306
305
307
- type EventStreamCreate = { |
308
- ...ServerEvent ,
309
- type : typeof EventTypes . stream ,
310
- op : 'create' ,
311
- streams : Stream [ ] ,
312
- | } ;
313
-
314
- type EventStreamDelete = { |
315
- ...ServerEvent ,
316
- type : typeof EventTypes . stream ,
317
- op : 'delete' ,
318
- streams : Stream [ ] ,
319
- | } ;
320
-
321
- type EventStreamUpdate = { |
322
- ...ServerEvent ,
323
- type : typeof EventTypes . stream ,
324
- op : 'update' ,
325
- stream_id : number ,
326
- name : string ,
327
- property : string ,
328
- value : string ,
329
- | } ;
330
-
331
- type EventStreamOccupy = { |
332
- ...ServerEvent ,
333
- type : typeof EventTypes . stream ,
334
- op : 'occupy' ,
335
- streams : Stream [ ] ,
336
- | } ;
337
-
338
306
type GenericEventAction = { |
339
307
type : typeof EVENT ,
340
- event : EventStreamCreate | EventStreamDelete | EventStreamUpdate | EventStreamOccupy ,
308
+ event : StreamEvent ,
341
309
| } ;
342
310
343
311
type EventNewMessageAction = { |
Original file line number Diff line number Diff line change 10
10
* @flow strict-local
11
11
*/
12
12
13
- import type { Message } from './apiTypes' ;
13
+ import type { Message , Stream } from './apiTypes' ;
14
14
15
15
//
16
16
// First, types used inside events.
@@ -110,6 +110,27 @@ export type PresenceEvent = {|
110
110
presence : UserPresence ,
111
111
| } ;
112
112
113
+ type StreamListEvent = { |
114
+ ...EventCommon ,
115
+ type : typeof EventTypes . stream ,
116
+ streams : Stream [ ] ,
117
+ | } ;
118
+
119
+ // prettier-ignore
120
+ export type StreamEvent =
121
+ | { | ...StreamListEvent , op : 'create' , | }
122
+ | { | ...StreamListEvent , op : 'delete' , | }
123
+ | { | ...StreamListEvent , op : 'occupy' , | }
124
+ | { |
125
+ ...EventCommon ,
126
+ type : typeof EventTypes . stream ,
127
+ op : 'update' ,
128
+ stream_id : number ,
129
+ name : string ,
130
+ property : string ,
131
+ value : string ,
132
+ | } ;
133
+
113
134
export type UpdateMessageFlagsEvent = { |
114
135
...EventCommon ,
115
136
type : typeof EventTypes . update_message_flags ,
You can’t perform that action at this time.
0 commit comments