From 0a203d0f59e53611bb9ceb5216e5286853dbfb6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Fri, 8 Nov 2024 18:16:03 +0100 Subject: [PATCH] rename xxxInterface.ts to xxxTypes.ts and suffix classes with "Impl" --- node/src/ActiveSpeakerObserver.ts | 10 ++-- ...rface.ts => ActiveSpeakerObserverTypes.ts} | 4 +- node/src/AudioLevelObserver.ts | 12 ++--- ...nterface.ts => AudioLevelObserverTypes.ts} | 4 +- node/src/Consumer.ts | 6 +-- ...{ConsumerInterface.ts => ConsumerTypes.ts} | 2 +- node/src/DataConsumer.ts | 4 +- ...sumerInterface.ts => DataConsumerTypes.ts} | 0 node/src/DataProducer.ts | 4 +- ...ducerInterface.ts => DataProducerTypes.ts} | 0 node/src/DirectTransport.ts | 12 +++-- ...rtInterface.ts => DirectTransportTypes.ts} | 2 +- node/src/PipeTransport.ts | 16 +++--- ...portInterface.ts => PipeTransportTypes.ts} | 4 +- node/src/PlainTransport.ts | 10 ++-- ...ortInterface.ts => PlainTransportTypes.ts} | 2 +- node/src/Producer.ts | 4 +- ...{ProducerInterface.ts => ProducerTypes.ts} | 0 node/src/Router.ts | 48 +++++++++--------- .../{RouterInterface.ts => RouterTypes.ts} | 24 ++++----- node/src/RtpObserver.ts | 6 +-- ...serverInterface.ts => RtpObserverTypes.ts} | 2 +- node/src/Transport.ts | 32 ++++++------ ...ransportInterface.ts => TransportTypes.ts} | 8 +-- node/src/WebRtcServer.ts | 6 +-- ...erverInterface.ts => WebRtcServerTypes.ts} | 4 +- node/src/WebRtcTransport.ts | 12 +++-- ...rtInterface.ts => WebRtcTransportTypes.ts} | 4 +- node/src/Worker.ts | 16 +++--- .../{WorkerInterface.ts => WorkerTypes.ts} | 4 +- node/src/index.ts | 6 +-- node/src/test/test-Consumer.ts | 4 +- node/src/test/test-DirectTransport.ts | 2 +- node/src/test/test-Producer.ts | 4 +- node/src/test/test-Router.ts | 6 +-- node/src/test/test-WebRtcServer.ts | 50 +++++++++---------- node/src/test/test-WebRtcTransport.ts | 6 +-- node/src/types.ts | 32 ++++++------ node/src/utils.ts | 2 +- 39 files changed, 192 insertions(+), 182 deletions(-) rename node/src/{ActiveSpeakerObserverInterface.ts => ActiveSpeakerObserverTypes.ts} (92%) rename node/src/{AudioLevelObserverInterface.ts => AudioLevelObserverTypes.ts} (94%) rename node/src/{ConsumerInterface.ts => ConsumerTypes.ts} (99%) rename node/src/{DataConsumerInterface.ts => DataConsumerTypes.ts} (100%) rename node/src/{DataProducerInterface.ts => DataProducerTypes.ts} (100%) rename node/src/{DirectTransportInterface.ts => DirectTransportTypes.ts} (97%) rename node/src/{PipeTransportInterface.ts => PipeTransportTypes.ts} (97%) rename node/src/{PlainTransportInterface.ts => PlainTransportTypes.ts} (99%) rename node/src/{ProducerInterface.ts => ProducerTypes.ts} (100%) rename node/src/{RouterInterface.ts => RouterTypes.ts} (90%) rename node/src/{RtpObserverInterface.ts => RtpObserverTypes.ts} (95%) rename node/src/{TransportInterface.ts => TransportTypes.ts} (96%) rename node/src/{WebRtcServerInterface.ts => WebRtcServerTypes.ts} (93%) rename node/src/{WebRtcTransportInterface.ts => WebRtcTransportTypes.ts} (98%) rename node/src/{WorkerInterface.ts => WorkerTypes.ts} (97%) diff --git a/node/src/ActiveSpeakerObserver.ts b/node/src/ActiveSpeakerObserver.ts index 10f6875057..6ff31dcaac 100644 --- a/node/src/ActiveSpeakerObserver.ts +++ b/node/src/ActiveSpeakerObserver.ts @@ -6,9 +6,9 @@ import { ActiveSpeakerObserverEvents, ActiveSpeakerObserverObserver, ActiveSpeakerObserverObserverEvents, -} from './ActiveSpeakerObserverInterface'; -import { RtpObserverInterface } from './RtpObserverInterface'; -import { RtpObserver, RtpObserverConstructorOptions } from './RtpObserver'; +} from './ActiveSpeakerObserverTypes'; +import { RtpObserverInterface } from './RtpObserverTypes'; +import { RtpObserverImpl, RtpObserverConstructorOptions } from './RtpObserver'; import { AppData } from './types'; import { Event, Notification } from './fbs/notification'; import * as FbsActiveSpeakerObserver from './fbs/active-speaker-observer'; @@ -18,10 +18,10 @@ type RtpObserverObserverConstructorOptions = const logger = new Logger('ActiveSpeakerObserver'); -export class ActiveSpeakerObserver< +export class ActiveSpeakerObserverImpl< ActiveSpeakerObserverAppData extends AppData = AppData, > - extends RtpObserver< + extends RtpObserverImpl< ActiveSpeakerObserverAppData, ActiveSpeakerObserverEvents, ActiveSpeakerObserverObserver diff --git a/node/src/ActiveSpeakerObserverInterface.ts b/node/src/ActiveSpeakerObserverTypes.ts similarity index 92% rename from node/src/ActiveSpeakerObserverInterface.ts rename to node/src/ActiveSpeakerObserverTypes.ts index 3e8bd0e3d9..b436c2ecdb 100644 --- a/node/src/ActiveSpeakerObserverInterface.ts +++ b/node/src/ActiveSpeakerObserverTypes.ts @@ -3,8 +3,8 @@ import { RtpObserverInterface, RtpObserverEvents, RtpObserverObserverEvents, -} from './RtpObserverInterface'; -import { ProducerInterface } from './ProducerInterface'; +} from './RtpObserverTypes'; +import { ProducerInterface } from './ProducerTypes'; import { AppData } from './types'; export type ActiveSpeakerObserverOptions< diff --git a/node/src/AudioLevelObserver.ts b/node/src/AudioLevelObserver.ts index bea9bb8a02..a3f09b6133 100644 --- a/node/src/AudioLevelObserver.ts +++ b/node/src/AudioLevelObserver.ts @@ -6,10 +6,10 @@ import { AudioLevelObserverEvents, AudioLevelObserverObserver, AudioLevelObserverObserverEvents, -} from './AudioLevelObserverInterface'; -import { RtpObserverInterface } from './RtpObserverInterface'; -import { RtpObserver, RtpObserverConstructorOptions } from './RtpObserver'; -import { ProducerInterface } from './ProducerInterface'; +} from './AudioLevelObserverTypes'; +import { RtpObserverInterface } from './RtpObserverTypes'; +import { RtpObserverImpl, RtpObserverConstructorOptions } from './RtpObserver'; +import { ProducerInterface } from './ProducerTypes'; import { AppData } from './types'; import * as utils from './utils'; import { Event, Notification } from './fbs/notification'; @@ -20,10 +20,10 @@ type AudioLevelObserverConstructorOptions = const logger = new Logger('AudioLevelObserver'); -export class AudioLevelObserver< +export class AudioLevelObserverImpl< AudioLevelObserverAppData extends AppData = AppData, > - extends RtpObserver< + extends RtpObserverImpl< AudioLevelObserverAppData, AudioLevelObserverEvents, AudioLevelObserverObserver diff --git a/node/src/AudioLevelObserverInterface.ts b/node/src/AudioLevelObserverTypes.ts similarity index 94% rename from node/src/AudioLevelObserverInterface.ts rename to node/src/AudioLevelObserverTypes.ts index ce808b39b6..9979adaf8e 100644 --- a/node/src/AudioLevelObserverInterface.ts +++ b/node/src/AudioLevelObserverTypes.ts @@ -3,8 +3,8 @@ import { RtpObserverInterface, RtpObserverEvents, RtpObserverObserverEvents, -} from './RtpObserverInterface'; -import { ProducerInterface } from './ProducerInterface'; +} from './RtpObserverTypes'; +import { ProducerInterface } from './ProducerTypes'; import { AppData } from './types'; export type AudioLevelObserverOptions< diff --git a/node/src/Consumer.ts b/node/src/Consumer.ts index 31bb0d0736..a47c43bbb3 100644 --- a/node/src/Consumer.ts +++ b/node/src/Consumer.ts @@ -21,10 +21,10 @@ import { ConsumerEvents, ConsumerObserver, ConsumerObserverEvents, -} from './ConsumerInterface'; +} from './ConsumerTypes'; import { Channel } from './Channel'; import { TransportInternal } from './Transport'; -import { ProducerStat } from './ProducerInterface'; +import { ProducerStat } from './ProducerTypes'; import { MediaKind, RtpParameters, @@ -58,7 +58,7 @@ type ConsumerData = { const logger = new Logger('Consumer'); -export class Consumer +export class ConsumerImpl extends EnhancedEventEmitter implements ConsumerInterface { diff --git a/node/src/ConsumerInterface.ts b/node/src/ConsumerTypes.ts similarity index 99% rename from node/src/ConsumerInterface.ts rename to node/src/ConsumerTypes.ts index 2bd9ef9486..9a611ce89a 100644 --- a/node/src/ConsumerInterface.ts +++ b/node/src/ConsumerTypes.ts @@ -1,5 +1,5 @@ import { EnhancedEventEmitter } from './enhancedEvents'; -import { ProducerStat } from './ProducerInterface'; +import { ProducerStat } from './ProducerTypes'; import { MediaKind, RtpCapabilities, diff --git a/node/src/DataConsumer.ts b/node/src/DataConsumer.ts index 256232b7e9..040cc4dd03 100644 --- a/node/src/DataConsumer.ts +++ b/node/src/DataConsumer.ts @@ -8,7 +8,7 @@ import { DataConsumerEvents, DataConsumerObserver, DataConsumerObserverEvents, -} from './DataConsumerInterface'; +} from './DataConsumerTypes'; import { Channel } from './Channel'; import { TransportInternal } from './Transport'; import { @@ -38,7 +38,7 @@ type DataConsumerData = { const logger = new Logger('DataConsumer'); -export class DataConsumer +export class DataConsumerImpl extends EnhancedEventEmitter implements DataConsumerInterface { diff --git a/node/src/DataConsumerInterface.ts b/node/src/DataConsumerTypes.ts similarity index 100% rename from node/src/DataConsumerInterface.ts rename to node/src/DataConsumerTypes.ts diff --git a/node/src/DataProducer.ts b/node/src/DataProducer.ts index 3a5df11969..95a681f854 100644 --- a/node/src/DataProducer.ts +++ b/node/src/DataProducer.ts @@ -8,7 +8,7 @@ import { DataProducerEvents, DataProducerObserver, DataProducerObserverEvents, -} from './DataProducerInterface'; +} from './DataProducerTypes'; import { Channel } from './Channel'; import { TransportInternal } from './Transport'; import { @@ -34,7 +34,7 @@ type DataProducerData = { const logger = new Logger('DataProducer'); -export class DataProducer +export class DataProducerImpl extends EnhancedEventEmitter implements DataProducerInterface { diff --git a/node/src/DataProducerInterface.ts b/node/src/DataProducerTypes.ts similarity index 100% rename from node/src/DataProducerInterface.ts rename to node/src/DataProducerTypes.ts diff --git a/node/src/DirectTransport.ts b/node/src/DirectTransport.ts index db4616bf48..e5d65ed8ef 100644 --- a/node/src/DirectTransport.ts +++ b/node/src/DirectTransport.ts @@ -7,10 +7,10 @@ import { DirectTransportEvents, DirectTransportObserver, DirectTransportObserverEvents, -} from './DirectTransportInterface'; -import { TransportInterface, BaseTransportDump } from './TransportInterface'; +} from './DirectTransportTypes'; +import { TransportInterface, BaseTransportDump } from './TransportTypes'; import { - Transport, + TransportImpl, TransportConstructorOptions, parseBaseTransportDump, parseBaseTransportStats, @@ -36,8 +36,10 @@ export type DirectTransportData = { const logger = new Logger('DirectTransport'); -export class DirectTransport - extends Transport< +export class DirectTransportImpl< + DirectTransportAppData extends AppData = AppData, + > + extends TransportImpl< DirectTransportAppData, DirectTransportEvents, DirectTransportObserver diff --git a/node/src/DirectTransportInterface.ts b/node/src/DirectTransportTypes.ts similarity index 97% rename from node/src/DirectTransportInterface.ts rename to node/src/DirectTransportTypes.ts index 8bfcb29153..8b77198a75 100644 --- a/node/src/DirectTransportInterface.ts +++ b/node/src/DirectTransportTypes.ts @@ -5,7 +5,7 @@ import { BaseTransportStats, TransportEvents, TransportObserverEvents, -} from './TransportInterface'; +} from './TransportTypes'; import { AppData } from './types'; export type DirectTransportOptions< diff --git a/node/src/PipeTransport.ts b/node/src/PipeTransport.ts index 2a0526c5b7..afbfad450c 100644 --- a/node/src/PipeTransport.ts +++ b/node/src/PipeTransport.ts @@ -10,14 +10,14 @@ import { PipeTransportEvents, PipeTransportObserver, PipeTransportObserverEvents, -} from './PipeTransportInterface'; +} from './PipeTransportTypes'; import { TransportInterface, TransportTuple, SctpState, -} from './TransportInterface'; +} from './TransportTypes'; import { - Transport, + TransportImpl, TransportConstructorOptions, parseBaseTransportDump, parseBaseTransportStats, @@ -25,9 +25,9 @@ import { parseTuple, parseTransportTraceEventData, } from './Transport'; -import { ProducerInterface } from './ProducerInterface'; -import { ConsumerInterface, ConsumerType } from './ConsumerInterface'; -import { Consumer } from './Consumer'; +import { ProducerInterface } from './ProducerTypes'; +import { ConsumerInterface, ConsumerType } from './ConsumerTypes'; +import { ConsumerImpl } from './Consumer'; import { RtpParameters, serializeRtpEncodingParameters, @@ -64,7 +64,7 @@ export type PipeTransportData = { const logger = new Logger('PipeTransport'); export class PipeTransport - extends Transport< + extends TransportImpl< PipeTransportAppData, PipeTransportEvents, PipeTransportObserver @@ -317,7 +317,7 @@ export class PipeTransport type: 'pipe' as ConsumerType, }; - const consumer: ConsumerInterface = new Consumer({ + const consumer: ConsumerInterface = new ConsumerImpl({ internal: { ...this.internal, consumerId, diff --git a/node/src/PipeTransportInterface.ts b/node/src/PipeTransportTypes.ts similarity index 97% rename from node/src/PipeTransportInterface.ts rename to node/src/PipeTransportTypes.ts index c690ecae6e..593923c88e 100644 --- a/node/src/PipeTransportInterface.ts +++ b/node/src/PipeTransportTypes.ts @@ -9,8 +9,8 @@ import { BaseTransportStats, TransportEvents, TransportObserverEvents, -} from './TransportInterface'; -import { ConsumerInterface } from './ConsumerInterface'; +} from './TransportTypes'; +import { ConsumerInterface } from './ConsumerTypes'; import { SrtpParameters } from './SrtpParameters'; import { SctpParameters, NumSctpStreams } from './SctpParameters'; import { Either, AppData } from './types'; diff --git a/node/src/PlainTransport.ts b/node/src/PlainTransport.ts index 8776132f24..0d55164252 100644 --- a/node/src/PlainTransport.ts +++ b/node/src/PlainTransport.ts @@ -8,14 +8,14 @@ import { PlainTransportEvents, PlainTransportObserver, PlainTransportObserverEvents, -} from './PlainTransportInterface'; +} from './PlainTransportTypes'; import { TransportInterface, TransportTuple, SctpState, -} from './TransportInterface'; +} from './TransportTypes'; import { - Transport, + TransportImpl, TransportConstructorOptions, parseSctpState, parseTuple, @@ -52,8 +52,8 @@ export type PlainTransportData = { const logger = new Logger('PlainTransport'); -export class PlainTransport - extends Transport< +export class PlainTransportImpl + extends TransportImpl< PlainTransportAppData, PlainTransportEvents, PlainTransportObserver diff --git a/node/src/PlainTransportInterface.ts b/node/src/PlainTransportTypes.ts similarity index 99% rename from node/src/PlainTransportInterface.ts rename to node/src/PlainTransportTypes.ts index 595930debf..eeebd2c682 100644 --- a/node/src/PlainTransportInterface.ts +++ b/node/src/PlainTransportTypes.ts @@ -9,7 +9,7 @@ import { BaseTransportStats, TransportEvents, TransportObserverEvents, -} from './TransportInterface'; +} from './TransportTypes'; import { SrtpParameters, SrtpCryptoSuite } from './SrtpParameters'; import { SctpParameters, NumSctpStreams } from './SctpParameters'; import { Either, AppData } from './types'; diff --git a/node/src/Producer.ts b/node/src/Producer.ts index 673cd32c43..0ba9dc39c8 100644 --- a/node/src/Producer.ts +++ b/node/src/Producer.ts @@ -12,7 +12,7 @@ import { ProducerEvents, ProducerObserver, ProducerObserverEvents, -} from './ProducerInterface'; +} from './ProducerTypes'; import { Channel } from './Channel'; import { TransportInternal } from './Transport'; import { MediaKind, RtpParameters, parseRtpParameters } from './RtpParameters'; @@ -41,7 +41,7 @@ type ProducerData = { consumableRtpParameters: RtpParameters; }; -export class Producer +export class ProducerImpl extends EnhancedEventEmitter implements ProducerInterface { diff --git a/node/src/ProducerInterface.ts b/node/src/ProducerTypes.ts similarity index 100% rename from node/src/ProducerInterface.ts rename to node/src/ProducerTypes.ts diff --git a/node/src/Router.ts b/node/src/Router.ts index ce3bab5239..8fe8c8031c 100644 --- a/node/src/Router.ts +++ b/node/src/Router.ts @@ -12,57 +12,57 @@ import { RouterEvents, RouterObserver, RouterObserverEvents, -} from './RouterInterface'; +} from './RouterTypes'; import { TransportInterface, TransportListenIp, TransportProtocol, -} from './TransportInterface'; +} from './TransportTypes'; import { portRangeToFbs, socketFlagsToFbs } from './Transport'; import { WebRtcTransportInterface, WebRtcTransportOptions, -} from './WebRtcTransportInterface'; +} from './WebRtcTransportTypes'; import { - WebRtcTransport, + WebRtcTransportImpl, parseWebRtcTransportDumpResponse, } from './WebRtcTransport'; import { PlainTransportInterface, PlainTransportOptions, -} from './PlainTransportInterface'; +} from './PlainTransportTypes'; import { - PlainTransport, + PlainTransportImpl, parsePlainTransportDumpResponse, } from './PlainTransport'; import { PipeTransportInterface, PipeTransportOptions, -} from './PipeTransportInterface'; +} from './PipeTransportTypes'; import { PipeTransport, parsePipeTransportDumpResponse } from './PipeTransport'; import { DirectTransportInterface, DirectTransportOptions, -} from './DirectTransportInterface'; +} from './DirectTransportTypes'; import { - DirectTransport, + DirectTransportImpl, parseDirectTransportDumpResponse, } from './DirectTransport'; -import { ProducerInterface } from './ProducerInterface'; -import { ConsumerInterface } from './ConsumerInterface'; -import { DataProducerInterface } from './DataProducerInterface'; -import { DataConsumerInterface } from './DataConsumerInterface'; -import { RtpObserverInterface } from './RtpObserverInterface'; +import { ProducerInterface } from './ProducerTypes'; +import { ConsumerInterface } from './ConsumerTypes'; +import { DataProducerInterface } from './DataProducerTypes'; +import { DataConsumerInterface } from './DataConsumerTypes'; +import { RtpObserverInterface } from './RtpObserverTypes'; import { ActiveSpeakerObserverInterface, ActiveSpeakerObserverOptions, -} from './ActiveSpeakerObserverInterface'; -import { ActiveSpeakerObserver } from './ActiveSpeakerObserver'; +} from './ActiveSpeakerObserverTypes'; +import { ActiveSpeakerObserverImpl } from './ActiveSpeakerObserver'; import { AudioLevelObserverInterface, AudioLevelObserverOptions, -} from './AudioLevelObserverInterface'; -import { AudioLevelObserver } from './AudioLevelObserver'; +} from './AudioLevelObserverTypes'; +import { AudioLevelObserverImpl } from './AudioLevelObserver'; import { RtpCapabilities } from './RtpParameters'; import { cryptoSuiteToFbs } from './SrtpParameters'; import { AppData } from './types'; @@ -96,7 +96,7 @@ type RouterData = { const logger = new Logger('Router'); -export class Router +export class RouterImpl extends EnhancedEventEmitter implements RouterInterface { @@ -509,7 +509,7 @@ export class Router const webRtcTransportData = parseWebRtcTransportDumpResponse(data); const transport: WebRtcTransportInterface = - new WebRtcTransport({ + new WebRtcTransportImpl({ internal: { ...this.#internal, transportId: transportId, @@ -682,7 +682,7 @@ export class Router const plainTransportData = parsePlainTransportDumpResponse(data); const transport: PlainTransportInterface = - new PlainTransport({ + new PlainTransportImpl({ internal: { ...this.#internal, transportId: transportId, @@ -921,7 +921,7 @@ export class Router const directTransportData = parseDirectTransportDumpResponse(data); const transport: DirectTransportInterface = - new DirectTransport({ + new DirectTransportImpl({ internal: { ...this.#internal, transportId: transportId, @@ -1301,7 +1301,7 @@ export class Router ); const activeSpeakerObserver: ActiveSpeakerObserverInterface = - new ActiveSpeakerObserver({ + new ActiveSpeakerObserverImpl({ internal: { ...this.#internal, rtpObserverId: rtpObserverId, @@ -1377,7 +1377,7 @@ export class Router ); const audioLevelObserver: AudioLevelObserverInterface = - new AudioLevelObserver({ + new AudioLevelObserverImpl({ internal: { ...this.#internal, rtpObserverId: rtpObserverId, diff --git a/node/src/RouterInterface.ts b/node/src/RouterTypes.ts similarity index 90% rename from node/src/RouterInterface.ts rename to node/src/RouterTypes.ts index a3e2a10498..c0f12abd87 100644 --- a/node/src/RouterInterface.ts +++ b/node/src/RouterTypes.ts @@ -3,36 +3,36 @@ import { TransportInterface, TransportListenInfo, TransportListenIp, -} from './TransportInterface'; +} from './TransportTypes'; import { WebRtcTransportInterface, WebRtcTransportOptions, -} from './WebRtcTransportInterface'; +} from './WebRtcTransportTypes'; import { PlainTransportInterface, PlainTransportOptions, -} from './PlainTransportInterface'; +} from './PlainTransportTypes'; import { PipeTransportInterface, PipeTransportOptions, -} from './PipeTransportInterface'; +} from './PipeTransportTypes'; import { DirectTransportInterface, DirectTransportOptions, -} from './DirectTransportInterface'; -import { ProducerInterface } from './ProducerInterface'; -import { ConsumerInterface } from './ConsumerInterface'; -import { DataProducerInterface } from './DataProducerInterface'; -import { DataConsumerInterface } from './DataConsumerInterface'; -import { RtpObserverInterface } from './RtpObserverInterface'; +} from './DirectTransportTypes'; +import { ProducerInterface } from './ProducerTypes'; +import { ConsumerInterface } from './ConsumerTypes'; +import { DataProducerInterface } from './DataProducerTypes'; +import { DataConsumerInterface } from './DataConsumerTypes'; +import { RtpObserverInterface } from './RtpObserverTypes'; import { ActiveSpeakerObserverInterface, ActiveSpeakerObserverOptions, -} from './ActiveSpeakerObserverInterface'; +} from './ActiveSpeakerObserverTypes'; import { AudioLevelObserverInterface, AudioLevelObserverOptions, -} from './AudioLevelObserverInterface'; +} from './AudioLevelObserverTypes'; import { RtpCapabilities, RtpCodecCapability } from './RtpParameters'; import { NumSctpStreams } from './SctpParameters'; import { Either, AppData } from './types'; diff --git a/node/src/RtpObserver.ts b/node/src/RtpObserver.ts index ba07f2af3d..b277b07d31 100644 --- a/node/src/RtpObserver.ts +++ b/node/src/RtpObserver.ts @@ -1,9 +1,9 @@ import { Logger } from './Logger'; import { EnhancedEventEmitter } from './enhancedEvents'; -import { RtpObserverEvents, RtpObserverObserver } from './RtpObserverInterface'; +import { RtpObserverEvents, RtpObserverObserver } from './RtpObserverTypes'; import { Channel } from './Channel'; import { RouterInternal } from './Router'; -import { ProducerInterface } from './ProducerInterface'; +import { ProducerInterface } from './ProducerTypes'; import { AppData } from './types'; import * as FbsRequest from './fbs/request'; import * as FbsRouter from './fbs/router'; @@ -22,7 +22,7 @@ type RtpObserverObserverInternal = RouterInternal & { const logger = new Logger('RtpObserver'); -export abstract class RtpObserver< +export abstract class RtpObserverImpl< RtpObserverAppData extends AppData = AppData, Events extends RtpObserverEvents = RtpObserverEvents, Observer extends RtpObserverObserver = RtpObserverObserver, diff --git a/node/src/RtpObserverInterface.ts b/node/src/RtpObserverTypes.ts similarity index 95% rename from node/src/RtpObserverInterface.ts rename to node/src/RtpObserverTypes.ts index 8f047bcf1c..52c7c81329 100644 --- a/node/src/RtpObserverInterface.ts +++ b/node/src/RtpObserverTypes.ts @@ -1,5 +1,5 @@ import { EnhancedEventEmitter } from './enhancedEvents'; -import { ProducerInterface } from './ProducerInterface'; +import { ProducerInterface } from './ProducerTypes'; import { AppData } from './types'; export type RtpObserverEvents = { diff --git a/node/src/Transport.ts b/node/src/Transport.ts index 2794ad6665..4ff00de575 100644 --- a/node/src/Transport.ts +++ b/node/src/Transport.ts @@ -18,29 +18,33 @@ import { TransportTraceEventData, TransportEvents, TransportObserver, -} from './TransportInterface'; +} from './TransportTypes'; import { Channel } from './Channel'; import { RouterInternal } from './Router'; import { WebRtcTransportData } from './WebRtcTransport'; import { PlainTransportData } from './PlainTransport'; import { PipeTransportData } from './PipeTransport'; import { DirectTransportData } from './DirectTransport'; -import { ProducerInterface, ProducerOptions } from './ProducerInterface'; -import { Producer, producerTypeFromFbs, producerTypeToFbs } from './Producer'; +import { ProducerInterface, ProducerOptions } from './ProducerTypes'; +import { + ProducerImpl, + producerTypeFromFbs, + producerTypeToFbs, +} from './Producer'; import { ConsumerInterface, ConsumerOptions, ConsumerType, ConsumerLayers, -} from './ConsumerInterface'; -import { Consumer } from './Consumer'; +} from './ConsumerTypes'; +import { ConsumerImpl } from './Consumer'; import { DataProducerInterface, DataProducerOptions, DataProducerType, -} from './DataProducerInterface'; +} from './DataProducerTypes'; import { - DataProducer, + DataProducerImpl, dataProducerTypeToFbs, parseDataProducerDumpResponse, } from './DataProducer'; @@ -48,9 +52,9 @@ import { DataConsumerInterface, DataConsumerOptions, DataConsumerType, -} from './DataConsumerInterface'; +} from './DataConsumerTypes'; import { - DataConsumer, + DataConsumerImpl, dataConsumerTypeToFbs, parseDataConsumerDumpResponse, } from './DataConsumer'; @@ -104,7 +108,7 @@ type TransportData = const logger = new Logger('Transport'); -export abstract class Transport< +export abstract class TransportImpl< TransportAppData extends AppData = AppData, Events extends TransportEvents = TransportEvents, Observer extends TransportObserver = TransportObserver, @@ -617,7 +621,7 @@ export abstract class Transport< consumableRtpParameters, }; - const producer: ProducerInterface = new Producer({ + const producer: ProducerInterface = new ProducerImpl({ internal: { ...this.internal, producerId, @@ -746,7 +750,7 @@ export abstract class Transport< type: pipe ? 'pipe' : (producer.type as ConsumerType), }; - const consumer: ConsumerInterface = new Consumer({ + const consumer: ConsumerInterface = new ConsumerImpl({ internal: { ...this.internal, consumerId, @@ -849,7 +853,7 @@ export abstract class Transport< const dump = parseDataProducerDumpResponse(produceDataResponse); const dataProducer: DataProducerInterface = - new DataProducer({ + new DataProducerImpl({ internal: { ...this.internal, dataProducerId, @@ -985,7 +989,7 @@ export abstract class Transport< const dump = parseDataConsumerDumpResponse(consumeDataResponse); const dataConsumer: DataConsumerInterface = - new DataConsumer({ + new DataConsumerImpl({ internal: { ...this.internal, dataConsumerId, diff --git a/node/src/TransportInterface.ts b/node/src/TransportTypes.ts similarity index 96% rename from node/src/TransportInterface.ts rename to node/src/TransportTypes.ts index 65cb0b1616..73c606d793 100644 --- a/node/src/TransportInterface.ts +++ b/node/src/TransportTypes.ts @@ -1,14 +1,14 @@ import { EnhancedEventEmitter } from './enhancedEvents'; -import { ProducerInterface, ProducerOptions } from './ProducerInterface'; -import { ConsumerInterface, ConsumerOptions } from './ConsumerInterface'; +import { ProducerInterface, ProducerOptions } from './ProducerTypes'; +import { ConsumerInterface, ConsumerOptions } from './ConsumerTypes'; import { DataProducerInterface, DataProducerOptions, -} from './DataProducerInterface'; +} from './DataProducerTypes'; import { DataConsumerInterface, DataConsumerOptions, -} from './DataConsumerInterface'; +} from './DataConsumerTypes'; import { SctpParameters } from './SctpParameters'; import { AppData } from './types'; diff --git a/node/src/WebRtcServer.ts b/node/src/WebRtcServer.ts index 1822492171..c516b7fa29 100644 --- a/node/src/WebRtcServer.ts +++ b/node/src/WebRtcServer.ts @@ -10,8 +10,8 @@ import { WebRtcServerEvents, WebRtcServerObserver, WebRtcServerObserverEvents, -} from './WebRtcServerInterface'; -import { WebRtcTransportInterface } from './WebRtcTransportInterface'; +} from './WebRtcServerTypes'; +import { WebRtcTransportInterface } from './WebRtcTransportTypes'; import { AppData } from './types'; import * as utils from './utils'; import { Body as RequestBody, Method } from './fbs/request'; @@ -24,7 +24,7 @@ type WebRtcServerInternal = { const logger = new Logger('WebRtcServer'); -export class WebRtcServer +export class WebRtcServerImpl extends EnhancedEventEmitter implements WebRtcServerInterface { diff --git a/node/src/WebRtcServerInterface.ts b/node/src/WebRtcServerTypes.ts similarity index 93% rename from node/src/WebRtcServerInterface.ts rename to node/src/WebRtcServerTypes.ts index fc3b527b27..5dbcaeb207 100644 --- a/node/src/WebRtcServerInterface.ts +++ b/node/src/WebRtcServerTypes.ts @@ -1,6 +1,6 @@ import { EnhancedEventEmitter } from './enhancedEvents'; -import { TransportListenInfo } from './TransportInterface'; -import { WebRtcTransportInterface } from './WebRtcTransportInterface'; +import { TransportListenInfo } from './TransportTypes'; +import { WebRtcTransportInterface } from './WebRtcTransportTypes'; import { AppData } from './types'; export type WebRtcServerOptions = diff --git a/node/src/WebRtcTransport.ts b/node/src/WebRtcTransport.ts index 14a4fde516..3a444cf665 100644 --- a/node/src/WebRtcTransport.ts +++ b/node/src/WebRtcTransport.ts @@ -19,14 +19,14 @@ import { WebRtcTransportEvents, WebRtcTransportObserver, WebRtcTransportObserverEvents, -} from './WebRtcTransportInterface'; +} from './WebRtcTransportTypes'; import { TransportInterface, TransportTuple, SctpState, -} from './TransportInterface'; +} from './TransportTypes'; import { - Transport, + TransportImpl, TransportConstructorOptions, parseSctpState, parseBaseTransportDump, @@ -70,8 +70,10 @@ export type WebRtcTransportData = { const logger = new Logger('WebRtcTransport'); -export class WebRtcTransport - extends Transport< +export class WebRtcTransportImpl< + WebRtcTransportAppData extends AppData = AppData, + > + extends TransportImpl< WebRtcTransportAppData, WebRtcTransportEvents, WebRtcTransportObserver diff --git a/node/src/WebRtcTransportInterface.ts b/node/src/WebRtcTransportTypes.ts similarity index 98% rename from node/src/WebRtcTransportInterface.ts rename to node/src/WebRtcTransportTypes.ts index 1b95cd68cc..1d713d5a0b 100644 --- a/node/src/WebRtcTransportInterface.ts +++ b/node/src/WebRtcTransportTypes.ts @@ -10,8 +10,8 @@ import { BaseTransportStats, TransportEvents, TransportObserverEvents, -} from './TransportInterface'; -import { WebRtcServerInterface } from './WebRtcServerInterface'; +} from './TransportTypes'; +import { WebRtcServerInterface } from './WebRtcServerTypes'; import { SctpParameters, NumSctpStreams } from './SctpParameters'; import { Either, AppData } from './types'; diff --git a/node/src/Worker.ts b/node/src/Worker.ts index 08fda4bd2a..236eac469f 100644 --- a/node/src/Worker.ts +++ b/node/src/Worker.ts @@ -14,15 +14,15 @@ import { WorkerEvents, WorkerObserver, WorkerObserverEvents, -} from './WorkerInterface'; +} from './WorkerTypes'; import { Channel } from './Channel'; import { WebRtcServerInterface, WebRtcServerOptions, -} from './WebRtcServerInterface'; -import { WebRtcServer } from './WebRtcServer'; -import { RouterInterface, RouterOptions } from './RouterInterface'; -import { Router } from './Router'; +} from './WebRtcServerTypes'; +import { WebRtcServerImpl } from './WebRtcServer'; +import { RouterInterface, RouterOptions } from './RouterTypes'; +import { RouterImpl } from './Router'; import { portRangeToFbs, socketFlagsToFbs } from './Transport'; import { RtpCodecCapability } from './RtpParameters'; import { AppData } from './types'; @@ -61,7 +61,7 @@ export const workerBin = process.env.MEDIASOUP_WORKER_BIN const logger = new Logger('Worker'); const workerLogger = new Logger('Worker'); -export class Worker +export class WorkerImpl extends EnhancedEventEmitter implements WorkerInterface { @@ -533,7 +533,7 @@ export class Worker ); const webRtcServer: WebRtcServerInterface = - new WebRtcServer({ + new WebRtcServerImpl({ internal: { webRtcServerId }, channel: this.#channel, appData, @@ -586,7 +586,7 @@ export class Worker ); const data = { rtpCapabilities }; - const router: RouterInterface = new Router({ + const router: RouterInterface = new RouterImpl({ internal: { routerId, }, diff --git a/node/src/WorkerInterface.ts b/node/src/WorkerTypes.ts similarity index 97% rename from node/src/WorkerInterface.ts rename to node/src/WorkerTypes.ts index 30b3696546..28df5d4b3a 100644 --- a/node/src/WorkerInterface.ts +++ b/node/src/WorkerTypes.ts @@ -2,8 +2,8 @@ import { EnhancedEventEmitter } from './enhancedEvents'; import { WebRtcServerInterface, WebRtcServerOptions, -} from './WebRtcServerInterface'; -import { RouterInterface, RouterOptions } from './RouterInterface'; +} from './WebRtcServerTypes'; +import { RouterInterface, RouterOptions } from './RouterTypes'; import { AppData } from './types'; export type WorkerLogLevel = 'debug' | 'warn' | 'error' | 'none'; diff --git a/node/src/index.ts b/node/src/index.ts index a781d44ddb..c0f389c6a2 100644 --- a/node/src/index.ts +++ b/node/src/index.ts @@ -1,7 +1,7 @@ import { Logger, LoggerEmitter } from './Logger'; import { EnhancedEventEmitter } from './enhancedEvents'; -import { WorkerInterface, WorkerSettings } from './WorkerInterface'; -import { Worker, workerBin } from './Worker'; +import { WorkerInterface, WorkerSettings } from './WorkerTypes'; +import { WorkerImpl, workerBin } from './Worker'; import * as utils from './utils'; import { supportedRtpCapabilities } from './supportedRtpCapabilities'; import { RtpCapabilities } from './RtpParameters'; @@ -126,7 +126,7 @@ export async function createWorker< throw new TypeError('if given, appData must be an object'); } - const worker: WorkerInterface = new Worker({ + const worker: WorkerInterface = new WorkerImpl({ logLevel, logTags, rtcMinPort, diff --git a/node/src/test/test-Consumer.ts b/node/src/test/test-Consumer.ts index f190163f92..e6f90b3492 100644 --- a/node/src/test/test-Consumer.ts +++ b/node/src/test/test-Consumer.ts @@ -2,7 +2,7 @@ import * as flatbuffers from 'flatbuffers'; import * as mediasoup from '../'; import { enhancedOnce } from '../enhancedEvents'; import { WorkerEvents, ConsumerEvents } from '../types'; -import { Consumer } from '../Consumer'; +import { ConsumerImpl } from '../Consumer'; import { UnsupportedError } from '../errors'; import * as utils from '../utils'; import { @@ -1054,7 +1054,7 @@ test('Consumer emits "score"', async () => { }); // API not exposed in the interface. - const channel = (audioConsumer as Consumer).channelForTesting; + const channel = (audioConsumer as ConsumerImpl).channelForTesting; const onScore = jest.fn(); audioConsumer.on('score', onScore); diff --git a/node/src/test/test-DirectTransport.ts b/node/src/test/test-DirectTransport.ts index cb8784f3bb..2380d96e18 100644 --- a/node/src/test/test-DirectTransport.ts +++ b/node/src/test/test-DirectTransport.ts @@ -1,6 +1,6 @@ import * as mediasoup from '../'; import { enhancedOnce } from '../enhancedEvents'; -import { DirectTransportEvents } from '../DirectTransportInterface'; +import { DirectTransportEvents } from '../DirectTransportTypes'; import { WorkerEvents } from '../types'; type TestContext = { diff --git a/node/src/test/test-Producer.ts b/node/src/test/test-Producer.ts index 6587ae781c..0402ce0f6b 100644 --- a/node/src/test/test-Producer.ts +++ b/node/src/test/test-Producer.ts @@ -2,7 +2,7 @@ import * as flatbuffers from 'flatbuffers'; import * as mediasoup from '../'; import { enhancedOnce } from '../enhancedEvents'; import { WorkerEvents, ProducerEvents } from '../types'; -import { Producer } from '../Producer'; +import { ProducerImpl } from '../Producer'; import { UnsupportedError } from '../errors'; import * as utils from '../utils'; import { @@ -728,7 +728,7 @@ test('Producer emits "score"', async () => { ); // API not exposed in the interface. - const channel = (videoProducer as Producer).channelForTesting; + const channel = (videoProducer as ProducerImpl).channelForTesting; const onScore = jest.fn(); videoProducer.on('score', onScore); diff --git a/node/src/test/test-Router.ts b/node/src/test/test-Router.ts index 81804755cd..f584e1dacb 100644 --- a/node/src/test/test-Router.ts +++ b/node/src/test/test-Router.ts @@ -1,6 +1,6 @@ import * as mediasoup from '../'; import { enhancedOnce } from '../enhancedEvents'; -import { Worker } from '../Worker'; +import { WorkerImpl } from '../Worker'; import { WorkerEvents, RouterEvents } from '../types'; import { InvalidStateError } from '../errors'; import * as utils from '../utils'; @@ -96,14 +96,14 @@ test('worker.createRouter() succeeds', async () => { }); // API not exposed in the interface. - expect((ctx.worker! as Worker).routersForTesting.size).toBe(1); + expect((ctx.worker! as WorkerImpl).routersForTesting.size).toBe(1); ctx.worker!.close(); expect(router.closed).toBe(true); // API not exposed in the interface. - expect((ctx.worker! as Worker).routersForTesting.size).toBe(0); + expect((ctx.worker! as WorkerImpl).routersForTesting.size).toBe(0); }, 2000); test('worker.createRouter() with wrong arguments rejects with TypeError', async () => { diff --git a/node/src/test/test-WebRtcServer.ts b/node/src/test/test-WebRtcServer.ts index 9dff5aa1df..10f695af21 100644 --- a/node/src/test/test-WebRtcServer.ts +++ b/node/src/test/test-WebRtcServer.ts @@ -1,10 +1,10 @@ import { pickPort } from 'pick-port'; import * as mediasoup from '../'; import { enhancedOnce } from '../enhancedEvents'; -import { Worker } from '../Worker'; +import { WorkerImpl } from '../Worker'; import { WorkerEvents, WebRtcServerEvents } from '../types'; -import { WebRtcServer } from '../WebRtcServer'; -import { Router } from '../Router'; +import { WebRtcServerImpl } from '../WebRtcServer'; +import { RouterImpl } from '../Router'; import { InvalidStateError } from '../errors'; type TestContext = { @@ -84,14 +84,14 @@ test('worker.createWebRtcServer() succeeds', async () => { }); // API not exposed in the interface. - expect((ctx.worker! as Worker).webRtcServersForTesting.size).toBe(1); + expect((ctx.worker! as WorkerImpl).webRtcServersForTesting.size).toBe(1); ctx.worker!.close(); expect(webRtcServer.closed).toBe(true); // API not exposed in the interface. - expect((ctx.worker! as Worker).webRtcServersForTesting.size).toBe(0); + expect((ctx.worker! as WorkerImpl).webRtcServersForTesting.size).toBe(0); }, 2000); test('worker.createWebRtcServer() with portRange succeeds', async () => { @@ -153,14 +153,14 @@ test('worker.createWebRtcServer() with portRange succeeds', async () => { }); // API not exposed in the interface. - expect((ctx.worker! as Worker).webRtcServersForTesting.size).toBe(1); + expect((ctx.worker! as WorkerImpl).webRtcServersForTesting.size).toBe(1); ctx.worker!.close(); expect(webRtcServer.closed).toBe(true); // API not exposed in the interface. - expect((ctx.worker! as Worker).webRtcServersForTesting.size).toBe(0); + expect((ctx.worker! as WorkerImpl).webRtcServersForTesting.size).toBe(0); }, 2000); test('worker.createWebRtcServer() without specifying port/portRange succeeds', async () => { @@ -209,14 +209,14 @@ test('worker.createWebRtcServer() without specifying port/portRange succeeds', a }); // API not exposed in the interface. - expect((ctx.worker! as Worker).webRtcServersForTesting.size).toBe(1); + expect((ctx.worker! as WorkerImpl).webRtcServersForTesting.size).toBe(1); ctx.worker!.close(); expect(webRtcServer.closed).toBe(true); // API not exposed in the interface. - expect((ctx.worker! as Worker).webRtcServersForTesting.size).toBe(0); + expect((ctx.worker! as WorkerImpl).webRtcServersForTesting.size).toBe(0); }, 2000); test('worker.createWebRtcServer() with wrong arguments rejects with TypeError', async () => { @@ -439,11 +439,11 @@ test('router.createWebRtcTransport() with webRtcServer succeeds and transport is expect(transport.iceSelectedTuple).toBeUndefined(); // API not exposed in the interface. - expect((webRtcServer as WebRtcServer).webRtcTransportsForTesting.size).toBe( - 1 - ); + expect( + (webRtcServer as WebRtcServerImpl).webRtcTransportsForTesting.size + ).toBe(1); // API not exposed in the interface. - expect((router as Router).transportsForTesting.size).toBe(1); + expect((router as RouterImpl).transportsForTesting.size).toBe(1); await expect(webRtcServer.dump()).resolves.toMatchObject({ id: webRtcServer.id, @@ -462,11 +462,11 @@ test('router.createWebRtcTransport() with webRtcServer succeeds and transport is expect(onObserverWebRtcTransportUnhandled).toHaveBeenCalledTimes(1); expect(onObserverWebRtcTransportUnhandled).toHaveBeenCalledWith(transport); // API not exposed in the interface. - expect((webRtcServer as WebRtcServer).webRtcTransportsForTesting.size).toBe( - 0 - ); + expect( + (webRtcServer as WebRtcServerImpl).webRtcTransportsForTesting.size + ).toBe(0); // API not exposed in the interface. - expect((router as Router).transportsForTesting.size).toBe(0); + expect((router as RouterImpl).transportsForTesting.size).toBe(0); await expect(webRtcServer.dump()).resolves.toMatchObject({ id: webRtcServer.id, @@ -543,11 +543,11 @@ test('router.createWebRtcTransport() with webRtcServer succeeds and webRtcServer expect(transport.iceSelectedTuple).toBeUndefined(); // API not exposed in the interface. - expect((webRtcServer as WebRtcServer).webRtcTransportsForTesting.size).toBe( - 1 - ); + expect( + (webRtcServer as WebRtcServerImpl).webRtcTransportsForTesting.size + ).toBe(1); // API not exposed in the interface. - expect((router as Router).transportsForTesting.size).toBe(1); + expect((router as RouterImpl).transportsForTesting.size).toBe(1); await expect(webRtcServer.dump()).resolves.toMatchObject({ id: webRtcServer.id, @@ -597,11 +597,11 @@ test('router.createWebRtcTransport() with webRtcServer succeeds and webRtcServer expect(transport.dtlsState).toBe('closed'); expect(transport.sctpState).toBe(undefined); // API not exposed in the interface. - expect((webRtcServer as WebRtcServer).webRtcTransportsForTesting.size).toBe( - 0 - ); + expect( + (webRtcServer as WebRtcServerImpl).webRtcTransportsForTesting.size + ).toBe(0); // API not exposed in the interface. - expect((router as Router).transportsForTesting.size).toBe(0); + expect((router as RouterImpl).transportsForTesting.size).toBe(0); await expect(ctx.worker!.dump()).resolves.toMatchObject({ pid: ctx.worker!.pid, diff --git a/node/src/test/test-WebRtcTransport.ts b/node/src/test/test-WebRtcTransport.ts index f43849f8a8..bba38bd7c2 100644 --- a/node/src/test/test-WebRtcTransport.ts +++ b/node/src/test/test-WebRtcTransport.ts @@ -3,8 +3,8 @@ import * as flatbuffers from 'flatbuffers'; import * as mediasoup from '../'; import { enhancedOnce } from '../enhancedEvents'; import { WorkerEvents, WebRtcTransportEvents } from '../types'; -import { WebRtcTransport } from '../WebRtcTransport'; -import { TransportTuple } from '../TransportInterface'; +import { WebRtcTransportImpl } from '../WebRtcTransport'; +import { TransportTuple } from '../TransportTypes'; import { serializeProtocol } from '../Transport'; import * as utils from '../utils'; import { @@ -670,7 +670,7 @@ test('WebRtcTransport events succeed', async () => { }); // API not exposed in the interface. - const channel = (webRtcTransport as WebRtcTransport).channelForTesting; + const channel = (webRtcTransport as WebRtcTransportImpl).channelForTesting; const onIceStateChange = jest.fn(); webRtcTransport.on('icestatechange', onIceStateChange); diff --git a/node/src/types.ts b/node/src/types.ts index cfe07698fb..d1006d7d47 100644 --- a/node/src/types.ts +++ b/node/src/types.ts @@ -1,24 +1,26 @@ export type { Observer, ObserverEvents, LogEventListeners } from './index'; +export type * from './WorkerTypes'; +export type * from './WebRtcServerTypes'; +export type * from './RouterTypes'; +export type * from './TransportTypes'; +export type * from './WebRtcTransportTypes'; +export type * from './PlainTransportTypes'; +export type * from './PipeTransportTypes'; +export type * from './DirectTransportTypes'; +export type * from './ProducerTypes'; +export type * from './ConsumerTypes'; +export type * from './DataProducerTypes'; +export type * from './DataConsumerTypes'; +export type * from './RtpObserverTypes'; +export type * from './ActiveSpeakerObserverTypes'; +export type * from './AudioLevelObserverTypes'; export type * from './RtpParameters'; export type * from './SctpParameters'; export type * from './SrtpParameters'; export type * from './scalabilityModes'; -export * from './WorkerInterface'; -export * from './WebRtcServerInterface'; -export * from './RouterInterface'; -export * from './TransportInterface'; -export * from './WebRtcTransportInterface'; -export * from './PlainTransportInterface'; -export * from './PipeTransportInterface'; -export * from './DirectTransportInterface'; -export * from './ProducerInterface'; -export * from './ConsumerInterface'; -export * from './DataProducerInterface'; -export * from './DataConsumerInterface'; -export * from './RtpObserverInterface'; -export * from './ActiveSpeakerObserverInterface'; -export * from './AudioLevelObserverInterface'; +// TODO: Here we are exporting real classes rather than types. This should +// be exported somehow else rather than in mediasoup.types namespace. export * from './errors'; type Only = { diff --git a/node/src/utils.ts b/node/src/utils.ts index c6e1d9748d..7ecfcc2e67 100644 --- a/node/src/utils.ts +++ b/node/src/utils.ts @@ -1,5 +1,5 @@ import { randomUUID, randomInt } from 'node:crypto'; -import { ProducerType } from './ProducerInterface'; +import { ProducerType } from './ProducerTypes'; import { Type as FbsRtpParametersType } from './fbs/rtp-parameters'; /**