Calling type improvements
This commit is contained in:
parent
2bedd41e57
commit
aeff7540c8
5 changed files with 18 additions and 13 deletions
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
|
|
||||||
import { Timestamp } from './Timestamp';
|
import { Timestamp } from './Timestamp';
|
||||||
import { LocalizerType } from '../../types/Util';
|
import { LocalizerType } from '../../types/Util';
|
||||||
import { CallHistoryDetailsType } from '../../services/calling';
|
import { CallHistoryDetailsType } from '../../types/Calling';
|
||||||
|
|
||||||
export type PropsData = {
|
export type PropsData = {
|
||||||
// Can be undefined because it comes from JS.
|
// Can be undefined because it comes from JS.
|
||||||
|
|
2
ts/model-types.d.ts
vendored
2
ts/model-types.d.ts
vendored
|
@ -1,9 +1,9 @@
|
||||||
import * as Backbone from 'backbone';
|
import * as Backbone from 'backbone';
|
||||||
|
|
||||||
import { LocalizerType } from './types/Util';
|
import { LocalizerType } from './types/Util';
|
||||||
|
import { CallHistoryDetailsType } from './types/Calling';
|
||||||
import { ColorType } from './types/Colors';
|
import { ColorType } from './types/Colors';
|
||||||
import { ConversationType } from './state/ducks/conversations';
|
import { ConversationType } from './state/ducks/conversations';
|
||||||
import { CallingClass, CallHistoryDetailsType } from './services/calling';
|
|
||||||
import { SendOptionsType } from './textsecure/SendMessage';
|
import { SendOptionsType } from './textsecure/SendMessage';
|
||||||
import { SyncMessageClass } from './textsecure.d';
|
import { SyncMessageClass } from './textsecure.d';
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,11 @@ import {
|
||||||
import { CallingMessageClass, EnvelopeClass } from '../textsecure.d';
|
import { CallingMessageClass, EnvelopeClass } from '../textsecure.d';
|
||||||
import { ConversationModelType } from '../model-types.d';
|
import { ConversationModelType } from '../model-types.d';
|
||||||
import is from '@sindresorhus/is';
|
import is from '@sindresorhus/is';
|
||||||
import { AudioDevice, MediaDeviceSettings } from '../types/Calling';
|
import {
|
||||||
|
AudioDevice,
|
||||||
|
CallHistoryDetailsType,
|
||||||
|
MediaDeviceSettings,
|
||||||
|
} from '../types/Calling';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
CallState,
|
CallState,
|
||||||
|
@ -31,14 +35,6 @@ export {
|
||||||
VideoRenderer,
|
VideoRenderer,
|
||||||
} from 'ringrtc';
|
} from 'ringrtc';
|
||||||
|
|
||||||
export type CallHistoryDetailsType = {
|
|
||||||
wasIncoming: boolean;
|
|
||||||
wasVideoCall: boolean;
|
|
||||||
wasDeclined: boolean;
|
|
||||||
acceptedTime?: number;
|
|
||||||
endedTime: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
export class CallingClass {
|
export class CallingClass {
|
||||||
readonly videoCapturer: GumVideoCapturer;
|
readonly videoCapturer: GumVideoCapturer;
|
||||||
|
|
||||||
|
@ -304,7 +300,7 @@ export class CallingClass {
|
||||||
? availableSpeakers[selectedSpeakerIndex]
|
? availableSpeakers[selectedSpeakerIndex]
|
||||||
: undefined;
|
: 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 preferredCamera = window.storage.get('preferred-video-input-device');
|
||||||
const selectedCamera = this.findBestMatchingCamera(
|
const selectedCamera = this.findBestMatchingCamera(
|
||||||
availableCameras,
|
availableCameras,
|
||||||
|
|
|
@ -34,6 +34,14 @@ export type MediaDeviceSettings = {
|
||||||
selectedCamera: string | undefined;
|
selectedCamera: string | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type CallHistoryDetailsType = {
|
||||||
|
wasIncoming: boolean;
|
||||||
|
wasVideoCall: boolean;
|
||||||
|
wasDeclined: boolean;
|
||||||
|
acceptedTime?: number;
|
||||||
|
endedTime: number;
|
||||||
|
};
|
||||||
|
|
||||||
export type ChangeIODevicePayloadType =
|
export type ChangeIODevicePayloadType =
|
||||||
| { type: CallingDeviceType.CAMERA; selectedDevice: string }
|
| { type: CallingDeviceType.CAMERA; selectedDevice: string }
|
||||||
| { type: CallingDeviceType.MICROPHONE; selectedDevice: AudioDevice }
|
| { type: CallingDeviceType.MICROPHONE; selectedDevice: AudioDevice }
|
||||||
|
|
3
ts/window.d.ts
vendored
3
ts/window.d.ts
vendored
|
@ -16,9 +16,10 @@ import {
|
||||||
} from './libsignal.d';
|
} from './libsignal.d';
|
||||||
import { ContactRecordIdentityState, TextSecureType } from './textsecure.d';
|
import { ContactRecordIdentityState, TextSecureType } from './textsecure.d';
|
||||||
import { WebAPIConnectType } from './textsecure/WebAPI';
|
import { WebAPIConnectType } from './textsecure/WebAPI';
|
||||||
import { CallingClass, CallHistoryDetailsType } from './services/calling';
|
import { CallingClass } from './services/calling';
|
||||||
import * as Crypto from './Crypto';
|
import * as Crypto from './Crypto';
|
||||||
import { LocalizerType } from './types/Util';
|
import { LocalizerType } from './types/Util';
|
||||||
|
import { CallHistoryDetailsType } from './types/Calling';
|
||||||
import { ColorType } from './types/Colors';
|
import { ColorType } from './types/Colors';
|
||||||
import { ConversationController } from './ConversationController';
|
import { ConversationController } from './ConversationController';
|
||||||
import { SendOptionsType } from './textsecure/SendMessage';
|
import { SendOptionsType } from './textsecure/SendMessage';
|
||||||
|
|
Loading…
Reference in a new issue