Skip to content
Draft
2 changes: 1 addition & 1 deletion src/components/CallView/shared/VideoVue.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createStore } from 'vuex'
import VideoVue from './VideoVue.vue'
import storeConfig from '../../../store/storeConfig.js'
import EmitterMixin from '../../../utils/EmitterMixin.js'
import CallParticipantModel from '../../../utils/webrtc/models/CallParticipantModel.js'
import { CallParticipantModel } from '../../../utils/webrtc/models/CallParticipantModel.js'

describe('VideoVue.vue', () => {
let store
Expand Down
59 changes: 59 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,65 @@
export type fetchPeersResponse = ApiResponse<operations['call-get-peers-for-call']['responses'][200]['content']['application/json']>
export type callSIPDialOutResponse = ApiResponse<operations['call-sip-dial-out']['responses'][201]['content']['application/json']>

export type CallParticipantCollection = {
callParticipantModels: Array<CallParticipantModel>

on(event: string, handler: (callParticipantCollection: CallParticipantCollection, ...args: any[]) => void): void

Check failure on line 232 in src/types/index.ts

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected any. Specify a different type
off(event: string, handler: (callParticipantCollection: CallParticipantCollection, ...args: any[]) => void): void

Check failure on line 233 in src/types/index.ts

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected any. Specify a different type

add(options: CallParticipantModelOptions): CallParticipantModel
get(peerId: string): CallParticipantModel | undefined
remove(peerId: string): boolean
}

export type CallParticipantModelOptions = {
peerId: string
webRtc: WebRtc
}

export type CallParticipantModel = {
on(event: string, handler: (callParticipantModel: CallParticipantModel, ...args: any[]) => void): void

Check failure on line 246 in src/types/index.ts

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected any. Specify a different type
off(event: string, handler: (callParticipantModel: CallParticipantModel, ...args: any[]) => void): void

Check failure on line 247 in src/types/index.ts

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected any. Specify a different type

get(key: string): any

Check failure on line 249 in src/types/index.ts

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected any. Specify a different type
set(key: string, value: any): void

Check failure on line 250 in src/types/index.ts

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected any. Specify a different type
}

export type LocalCallParticipantModel = {
on(event: string, handler: (localCallParticipantModel: LocalCallParticipantModel, ...args: any[]) => void): void

Check failure on line 254 in src/types/index.ts

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected any. Specify a different type
off(event: string, handler: (localCallParticipantModel: LocalCallParticipantModel, ...args: any[]) => void): void

Check failure on line 255 in src/types/index.ts

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected any. Specify a different type

get(key: string): any

Check failure on line 257 in src/types/index.ts

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected any. Specify a different type
set(key: string, value: any): void

Check failure on line 258 in src/types/index.ts

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected any. Specify a different type
}

export type Signaling = {
settings: {
userId: string | null
}
}

export type InternalWebRtc = {
isAudioEnabled(): boolean
isVideoEnabled(): boolean
isSpeaking(): boolean
}

export type WebRtc = {
on(event: string, handler: () => void): void
off(event: string, handler: () => void): void
emit(event: string): void

sendDataChannelToAll(channel: string, message: string, payload?: string | object): void
sendToAll(message: string, payload: object): void

sendDataChannelTo(peerId: string, channel: string, message: string, payload?: string | object): void
sendTo(peerId: string, messageType: string, payload: object): void

connection: Signaling
webrtc: InternalWebRtc
}

// Participants
export type ParticipantStatus = {
status?: string | null
Expand Down
6 changes: 6 additions & 0 deletions src/types/vendor/wildemitter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

declare module 'wildemitter'
Loading
Loading