@@ -79,7 +79,8 @@ import * as PhoneNumber from '@libs/PhoneNumber';
79
79
import getPolicyEmployeeAccountIDs from '@libs/PolicyEmployeeListUtils' ;
80
80
import { extractPolicyIDFromPath , getPolicy } from '@libs/PolicyUtils' ;
81
81
import processReportIDDeeplink from '@libs/processReportIDDeeplink' ;
82
- import * as Pusher from '@libs/Pusher' ;
82
+ import Pusher from '@libs/Pusher' ;
83
+ import type { UserIsLeavingRoomEvent , UserIsTypingEvent } from '@libs/Pusher/types' ;
83
84
import * as ReportActionsUtils from '@libs/ReportActionsUtils' ;
84
85
import type { OptimisticAddCommentReportAction , OptimisticChatReport } from '@libs/ReportUtils' ;
85
86
import {
@@ -398,7 +399,7 @@ function getReportChannelName(reportID: string): string {
398
399
*
399
400
* This method makes sure that no matter which we get, we return the "new" format
400
401
*/
401
- function getNormalizedStatus ( typingStatus : Pusher . UserIsTypingEvent | Pusher . UserIsLeavingRoomEvent ) : ReportUserIsTyping {
402
+ function getNormalizedStatus ( typingStatus : UserIsTypingEvent | UserIsLeavingRoomEvent ) : ReportUserIsTyping {
402
403
let normalizedStatus : ReportUserIsTyping ;
403
404
404
405
if ( typingStatus . userLogin ) {
@@ -463,7 +464,7 @@ function subscribeToReportLeavingEvents(reportID: string | undefined) {
463
464
Onyx . set ( `${ ONYXKEYS . COLLECTION . REPORT_USER_IS_LEAVING_ROOM } ${ reportID } ` , false ) ;
464
465
465
466
const pusherChannelName = getReportChannelName ( reportID ) ;
466
- Pusher . subscribe ( pusherChannelName , Pusher . TYPE . USER_IS_LEAVING_ROOM , ( leavingStatus : Pusher . UserIsLeavingRoomEvent ) => {
467
+ Pusher . subscribe ( pusherChannelName , Pusher . TYPE . USER_IS_LEAVING_ROOM , ( leavingStatus : UserIsLeavingRoomEvent ) => {
467
468
// If the pusher message comes from OldDot, we expect the leaving status to be keyed by user
468
469
// login OR by 'Concierge'. If the pusher message comes from NewDot, it is keyed by accountID
469
470
// since personal details are keyed by accountID.
@@ -1499,7 +1500,7 @@ function saveReportDraftComment(reportID: string, comment: string | null, callba
1499
1500
/** Broadcasts whether or not a user is typing on a report over the report's private pusher channel. */
1500
1501
function broadcastUserIsTyping ( reportID : string ) {
1501
1502
const privateReportChannelName = getReportChannelName ( reportID ) ;
1502
- const typingStatus : Pusher . UserIsTypingEvent = {
1503
+ const typingStatus : UserIsTypingEvent = {
1503
1504
[ currentUserAccountID ] : true ,
1504
1505
} ;
1505
1506
Pusher . sendEvent ( privateReportChannelName , Pusher . TYPE . USER_IS_TYPING , typingStatus ) ;
@@ -1508,7 +1509,7 @@ function broadcastUserIsTyping(reportID: string) {
1508
1509
/** Broadcasts to the report's private pusher channel whether a user is leaving a report */
1509
1510
function broadcastUserIsLeavingRoom ( reportID : string ) {
1510
1511
const privateReportChannelName = getReportChannelName ( reportID ) ;
1511
- const leavingStatus : Pusher . UserIsLeavingRoomEvent = {
1512
+ const leavingStatus : UserIsLeavingRoomEvent = {
1512
1513
[ currentUserAccountID ] : true ,
1513
1514
} ;
1514
1515
Pusher . sendEvent ( privateReportChannelName , Pusher . TYPE . USER_IS_LEAVING_ROOM , leavingStatus ) ;
0 commit comments