Conform more of the codebase to strictNullChecks (#10800)
This commit is contained in:
parent
adb29b38a3
commit
456c66db5b
46 changed files with 147 additions and 123 deletions
|
@ -60,7 +60,7 @@ export class PlaybackClock implements IDestroyable {
|
|||
private stopped = true;
|
||||
private lastCheck = 0;
|
||||
private observable = new SimpleObservable<number[]>();
|
||||
private timerId: number;
|
||||
private timerId?: number;
|
||||
private clipDuration = 0;
|
||||
private placeholderDuration = 0;
|
||||
|
||||
|
|
|
@ -33,9 +33,9 @@ export interface IUpload {
|
|||
* This class can be used to record a single voice message.
|
||||
*/
|
||||
export class VoiceMessageRecording implements IDestroyable {
|
||||
private lastUpload: IUpload;
|
||||
private lastUpload?: IUpload;
|
||||
private buffer = new Uint8Array(0); // use this.audioBuffer to access
|
||||
private playback: Playback;
|
||||
private playback?: Playback;
|
||||
|
||||
public constructor(private matrixClient: MatrixClient, private voiceRecording: VoiceRecording) {
|
||||
this.voiceRecording.onDataAvailable = this.onDataAvailable;
|
||||
|
|
|
@ -243,7 +243,7 @@ export class VoiceRecording extends EventEmitter implements IDestroyable {
|
|||
return;
|
||||
}
|
||||
|
||||
const secondsLeft = TARGET_MAX_LENGTH - this.recorderSeconds;
|
||||
const secondsLeft = TARGET_MAX_LENGTH - this.recorderSeconds!;
|
||||
if (secondsLeft < 0) {
|
||||
// go over to make sure we definitely capture that last frame
|
||||
// noinspection JSIgnoredPromiseFromCall - we aren't concerned with it overlapping
|
||||
|
@ -259,7 +259,8 @@ export class VoiceRecording extends EventEmitter implements IDestroyable {
|
|||
/**
|
||||
* {@link https://github.com/chris-rudmin/opus-recorder#instance-fields ref for recorderSeconds}
|
||||
*/
|
||||
public get recorderSeconds(): number {
|
||||
public get recorderSeconds(): number | undefined {
|
||||
if (!this.recorder) return undefined;
|
||||
return this.recorder.encodedSamplePosition / 48000;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue