diff --git a/ts/components/conversation/CallingNotification.tsx b/ts/components/conversation/CallingNotification.tsx index 54f670b2ddbe..bc81ef43f6e1 100644 --- a/ts/components/conversation/CallingNotification.tsx +++ b/ts/components/conversation/CallingNotification.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Timestamp } from './Timestamp'; import { LocalizerType } from '../../types/Util'; -import { CallHistoryDetailsType } from '../../services/calling'; +import { CallHistoryDetailsType } from '../../types/Calling'; export type PropsData = { // Can be undefined because it comes from JS. diff --git a/ts/model-types.d.ts b/ts/model-types.d.ts index 15b943d89093..6c156b5fd9e1 100644 --- a/ts/model-types.d.ts +++ b/ts/model-types.d.ts @@ -1,9 +1,9 @@ import * as Backbone from 'backbone'; import { LocalizerType } from './types/Util'; +import { CallHistoryDetailsType } from './types/Calling'; import { ColorType } from './types/Colors'; import { ConversationType } from './state/ducks/conversations'; -import { CallingClass, CallHistoryDetailsType } from './services/calling'; import { SendOptionsType } from './textsecure/SendMessage'; import { SyncMessageClass } from './textsecure.d'; diff --git a/ts/services/calling.ts b/ts/services/calling.ts index 7a5f00f1132b..3f6313ec1741 100644 --- a/ts/services/calling.ts +++ b/ts/services/calling.ts @@ -21,7 +21,11 @@ import { import { CallingMessageClass, EnvelopeClass } from '../textsecure.d'; import { ConversationModelType } from '../model-types.d'; import is from '@sindresorhus/is'; -import { AudioDevice, MediaDeviceSettings } from '../types/Calling'; +import { + AudioDevice, + CallHistoryDetailsType, + MediaDeviceSettings, +} from '../types/Calling'; export { CallState, @@ -31,14 +35,6 @@ export { VideoRenderer, } from 'ringrtc'; -export type CallHistoryDetailsType = { - wasIncoming: boolean; - wasVideoCall: boolean; - wasDeclined: boolean; - acceptedTime?: number; - endedTime: number; -}; - export class CallingClass { readonly videoCapturer: GumVideoCapturer; @@ -304,7 +300,7 @@ export class CallingClass { ? availableSpeakers[selectedSpeakerIndex] : undefined; - const availableCameras = await window.Signal.Services.calling.videoCapturer.enumerateDevices(); + const availableCameras = await this.videoCapturer.enumerateDevices(); const preferredCamera = window.storage.get('preferred-video-input-device'); const selectedCamera = this.findBestMatchingCamera( availableCameras, diff --git a/ts/types/Calling.ts b/ts/types/Calling.ts index c4b9574a146e..f7b10288f3fa 100644 --- a/ts/types/Calling.ts +++ b/ts/types/Calling.ts @@ -34,6 +34,14 @@ export type MediaDeviceSettings = { selectedCamera: string | undefined; }; +export type CallHistoryDetailsType = { + wasIncoming: boolean; + wasVideoCall: boolean; + wasDeclined: boolean; + acceptedTime?: number; + endedTime: number; +}; + export type ChangeIODevicePayloadType = | { type: CallingDeviceType.CAMERA; selectedDevice: string } | { type: CallingDeviceType.MICROPHONE; selectedDevice: AudioDevice } diff --git a/ts/window.d.ts b/ts/window.d.ts index 09c8a5a6662e..6a16d886e76d 100644 --- a/ts/window.d.ts +++ b/ts/window.d.ts @@ -16,9 +16,10 @@ import { } from './libsignal.d'; import { ContactRecordIdentityState, TextSecureType } from './textsecure.d'; import { WebAPIConnectType } from './textsecure/WebAPI'; -import { CallingClass, CallHistoryDetailsType } from './services/calling'; +import { CallingClass } from './services/calling'; import * as Crypto from './Crypto'; import { LocalizerType } from './types/Util'; +import { CallHistoryDetailsType } from './types/Calling'; import { ColorType } from './types/Colors'; import { ConversationController } from './ConversationController'; import { SendOptionsType } from './textsecure/SendMessage';