Calling type improvements

This commit is contained in:
Josh Perez 2020-09-04 14:27:12 -04:00 committed by Evan Hahn
parent 2bedd41e57
commit aeff7540c8
5 changed files with 18 additions and 13 deletions

View File

@ -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.

2
ts/model-types.d.ts vendored
View File

@ -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';

View File

@ -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,

View File

@ -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 }

3
ts/window.d.ts vendored
View File

@ -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';