Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Nov 8, 2024
1 parent 1fac13e commit 90b2265
Show file tree
Hide file tree
Showing 46 changed files with 311 additions and 372 deletions.
6 changes: 3 additions & 3 deletions node/src/ActiveSpeakerObserver.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
ActiveSpeakerObserverInterface,
ActiveSpeakerObserver,
ActiveSpeakerObserverDominantSpeaker,
ActiveSpeakerObserverEvents,
ActiveSpeakerObserverObserver,
ActiveSpeakerObserverObserverEvents,
} from './ActiveSpeakerObserverTypes';
import { RtpObserverInterface } from './RtpObserverTypes';
import { RtpObserver } from './RtpObserverTypes';
import { RtpObserverImpl, RtpObserverConstructorOptions } from './RtpObserver';
import { AppData } from './types';
import { Event, Notification } from './fbs/notification';
Expand All @@ -26,7 +26,7 @@ export class ActiveSpeakerObserverImpl<
ActiveSpeakerObserverEvents,
ActiveSpeakerObserverObserver
>
implements RtpObserverInterface, ActiveSpeakerObserverInterface
implements RtpObserver, ActiveSpeakerObserver
{
/**
* @private
Expand Down
10 changes: 5 additions & 5 deletions node/src/ActiveSpeakerObserverTypes.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { EnhancedEventEmitter } from './enhancedEvents';
import {
RtpObserverInterface,
RtpObserver,
RtpObserverEvents,
RtpObserverObserverEvents,
} from './RtpObserverTypes';
import { ProducerInterface } from './ProducerTypes';
import { Producer } from './ProducerTypes';
import { AppData } from './types';

export type ActiveSpeakerObserverOptions<
Expand All @@ -22,7 +22,7 @@ export type ActiveSpeakerObserverDominantSpeaker = {
/**
* The audio Producer instance.
*/
producer: ProducerInterface;
producer: Producer;
};

export type ActiveSpeakerObserverEvents = RtpObserverEvents & {
Expand All @@ -36,9 +36,9 @@ export type ActiveSpeakerObserverObserverEvents = RtpObserverObserverEvents & {
dominantspeaker: [ActiveSpeakerObserverDominantSpeaker];
};

export interface ActiveSpeakerObserverInterface<
export interface ActiveSpeakerObserver<
ActiveSpeakerObserverAppData extends AppData = AppData,
> extends RtpObserverInterface<
> extends RtpObserver<
ActiveSpeakerObserverAppData,
ActiveSpeakerObserverEvents,
ActiveSpeakerObserverObserver
Expand Down
12 changes: 5 additions & 7 deletions node/src/AudioLevelObserver.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
AudioLevelObserverInterface,
AudioLevelObserver,
AudioLevelObserverVolume,
AudioLevelObserverEvents,
AudioLevelObserverObserver,
AudioLevelObserverObserverEvents,
} from './AudioLevelObserverTypes';
import { RtpObserverInterface } from './RtpObserverTypes';
import { RtpObserver } from './RtpObserverTypes';
import { RtpObserverImpl, RtpObserverConstructorOptions } from './RtpObserver';
import { ProducerInterface } from './ProducerTypes';
import { Producer } from './ProducerTypes';
import { AppData } from './types';
import * as utils from './utils';
import { Event, Notification } from './fbs/notification';
Expand All @@ -28,7 +28,7 @@ export class AudioLevelObserverImpl<
AudioLevelObserverEvents,
AudioLevelObserverObserver
>
implements RtpObserverInterface, AudioLevelObserverInterface
implements RtpObserver, AudioLevelObserver
{
/**
* @private
Expand Down Expand Up @@ -80,9 +80,7 @@ export class AudioLevelObserverImpl<
volume,
})
)
.filter(
({ producer }: { producer: ProducerInterface }) => producer
);
.filter(({ producer }: { producer: Producer }) => producer);

if (volumes.length > 0) {
this.safeEmit('volumes', volumes);
Expand Down
10 changes: 5 additions & 5 deletions node/src/AudioLevelObserverTypes.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { EnhancedEventEmitter } from './enhancedEvents';
import {
RtpObserverInterface,
RtpObserver,
RtpObserverEvents,
RtpObserverObserverEvents,
} from './RtpObserverTypes';
import { ProducerInterface } from './ProducerTypes';
import { Producer } from './ProducerTypes';
import { AppData } from './types';

export type AudioLevelObserverOptions<
Expand Down Expand Up @@ -36,7 +36,7 @@ export type AudioLevelObserverVolume = {
/**
* The audio Producer instance.
*/
producer: ProducerInterface;
producer: Producer;

/**
* The average volume (in dBvo from -127 to 0) of the audio Producer in the
Expand All @@ -58,9 +58,9 @@ export type AudioLevelObserverObserverEvents = RtpObserverObserverEvents & {
silence: [];
};

export interface AudioLevelObserverInterface<
export interface AudioLevelObserver<
AudioLevelObserverAppData extends AppData = AppData,
> extends RtpObserverInterface<
> extends RtpObserver<
AudioLevelObserverAppData,
AudioLevelObserverEvents,
AudioLevelObserverObserver
Expand Down
4 changes: 2 additions & 2 deletions node/src/Consumer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
ConsumerInterface,
Consumer,
ConsumerType,
ConsumerScore,
ConsumerLayers,
Expand Down Expand Up @@ -60,7 +60,7 @@ const logger = new Logger('Consumer');

export class ConsumerImpl<ConsumerAppData extends AppData = AppData>
extends EnhancedEventEmitter<ConsumerEvents>
implements ConsumerInterface
implements Consumer
{
// Internal data.
readonly #internal: ConsumerInternal;
Expand Down
2 changes: 1 addition & 1 deletion node/src/ConsumerTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export type ConsumerObserverEvents = {
trace: [ConsumerTraceEventData];
};

export interface ConsumerInterface<ConsumerAppData extends AppData = AppData>
export interface Consumer<ConsumerAppData extends AppData = AppData>
extends EnhancedEventEmitter<ConsumerEvents> {
/**
* Consumer id.
Expand Down
4 changes: 2 additions & 2 deletions node/src/DataConsumer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
DataConsumerInterface,
DataConsumer,
DataConsumerType,
DataConsumerDump,
DataConsumerStat,
Expand Down Expand Up @@ -40,7 +40,7 @@ const logger = new Logger('DataConsumer');

export class DataConsumerImpl<DataConsumerAppData extends AppData = AppData>
extends EnhancedEventEmitter<DataConsumerEvents>
implements DataConsumerInterface
implements DataConsumer
{
// Internal data.
readonly #internal: DataConsumerInternal;
Expand Down
5 changes: 2 additions & 3 deletions node/src/DataConsumerTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ export type DataConsumerObserverEvents = {
resume: [];
};

export interface DataConsumerInterface<
DataConsumerAppData extends AppData = AppData,
> extends EnhancedEventEmitter<DataConsumerEvents> {
export interface DataConsumer<DataConsumerAppData extends AppData = AppData>
extends EnhancedEventEmitter<DataConsumerEvents> {
/**
* DataConsumer id.
*/
Expand Down
4 changes: 2 additions & 2 deletions node/src/DataProducer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
DataProducerInterface,
DataProducer,
DataProducerType,
DataProducerDump,
DataProducerStat,
Expand Down Expand Up @@ -36,7 +36,7 @@ const logger = new Logger('DataProducer');

export class DataProducerImpl<DataProducerAppData extends AppData = AppData>
extends EnhancedEventEmitter<DataProducerEvents>
implements DataProducerInterface
implements DataProducer
{
// Internal data.
readonly #internal: DataProducerInternal;
Expand Down
5 changes: 2 additions & 3 deletions node/src/DataProducerTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ export type DataProducerObserverEvents = {
resume: [];
};

export interface DataProducerInterface<
DataProducerAppData extends AppData = AppData,
> extends EnhancedEventEmitter<DataProducerEvents> {
export interface DataProducer<DataProducerAppData extends AppData = AppData>
extends EnhancedEventEmitter<DataProducerEvents> {
/**
* DataProducer id.
*/
Expand Down
6 changes: 3 additions & 3 deletions node/src/DirectTransport.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
DirectTransportInterface,
DirectTransport,
DirectTransportDump,
DirectTransportStat,
DirectTransportEvents,
DirectTransportObserver,
DirectTransportObserverEvents,
} from './DirectTransportTypes';
import { TransportInterface, BaseTransportDump } from './TransportTypes';
import { Transport, BaseTransportDump } from './TransportTypes';
import {
TransportImpl,
TransportConstructorOptions,
Expand Down Expand Up @@ -44,7 +44,7 @@ export class DirectTransportImpl<
DirectTransportEvents,
DirectTransportObserver
>
implements TransportInterface, DirectTransportInterface
implements Transport, DirectTransport
{
// DirectTransport data.
// eslint-disable-next-line no-unused-private-class-members
Expand Down
6 changes: 3 additions & 3 deletions node/src/DirectTransportTypes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EnhancedEventEmitter } from './enhancedEvents';
import {
TransportInterface,
Transport,
BaseTransportDump,
BaseTransportStats,
TransportEvents,
Expand Down Expand Up @@ -40,9 +40,9 @@ export type DirectTransportObserverEvents = TransportObserverEvents & {
rtcp: [Buffer];
};

export interface DirectTransportInterface<
export interface DirectTransport<
DirectTransportAppData extends AppData = AppData,
> extends TransportInterface<
> extends Transport<
DirectTransportAppData,
DirectTransportEvents,
DirectTransportObserver
Expand Down
24 changes: 9 additions & 15 deletions node/src/PipeTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@ import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import * as ortc from './ortc';
import {
PipeTransportInterface,
PipeTransport,
PipeConsumerOptions,
PipeTransportDump,
PipeTransportStat,
PipeTransportEvents,
PipeTransportObserver,
PipeTransportObserverEvents,
} from './PipeTransportTypes';
import {
TransportInterface,
TransportTuple,
SctpState,
} from './TransportTypes';
import { Transport, TransportTuple, SctpState } from './TransportTypes';
import {
TransportImpl,
TransportConstructorOptions,
Expand All @@ -25,8 +21,8 @@ import {
parseTuple,
parseTransportTraceEventData,
} from './Transport';
import { ProducerInterface } from './ProducerTypes';
import { ConsumerInterface, ConsumerType } from './ConsumerTypes';
import { Producer } from './ProducerTypes';
import { Consumer, ConsumerType } from './ConsumerTypes';
import { ConsumerImpl } from './Consumer';
import {
RtpParameters,
Expand Down Expand Up @@ -63,13 +59,13 @@ export type PipeTransportData = {

const logger = new Logger('PipeTransport');

export class PipeTransport<PipeTransportAppData extends AppData = AppData>
export class PipeTransportImpl<PipeTransportAppData extends AppData = AppData>
extends TransportImpl<
PipeTransportAppData,
PipeTransportEvents,
PipeTransportObserver
>
implements TransportInterface, PipeTransportInterface
implements Transport, PipeTransport
{
// PipeTransport data.
readonly #data: PipeTransportData;
Expand Down Expand Up @@ -215,9 +211,7 @@ export class PipeTransport<PipeTransportAppData extends AppData = AppData>
async consume<ConsumerAppData extends AppData = AppData>({
producerId,
appData,
}: PipeConsumerOptions<ConsumerAppData>): Promise<
ConsumerInterface<ConsumerAppData>
> {
}: PipeConsumerOptions<ConsumerAppData>): Promise<Consumer<ConsumerAppData>> {
logger.debug('consume()');

if (!producerId || typeof producerId !== 'string') {
Expand Down Expand Up @@ -268,7 +262,7 @@ export class PipeTransport<PipeTransportAppData extends AppData = AppData>
type: 'pipe' as ConsumerType,
};

const consumer: ConsumerInterface<ConsumerAppData> = new ConsumerImpl({
const consumer: Consumer<ConsumerAppData> = new ConsumerImpl({
internal: {
...this.internal,
consumerId,
Expand Down Expand Up @@ -383,7 +377,7 @@ function createConsumeRequest({
}: {
builder: flatbuffers.Builder;
consumerId: string;
producer: ProducerInterface;
producer: Producer;
rtpParameters: RtpParameters;
}): number {
// Build the request.
Expand Down
13 changes: 5 additions & 8 deletions node/src/PipeTransportTypes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EnhancedEventEmitter } from './enhancedEvents';
import {
TransportInterface,
Transport,
TransportListenInfo,
TransportListenIp,
TransportTuple,
Expand All @@ -10,7 +10,7 @@ import {
TransportEvents,
TransportObserverEvents,
} from './TransportTypes';
import { ConsumerInterface } from './ConsumerTypes';
import { Consumer } from './ConsumerTypes';
import { SrtpParameters } from './SrtpParameters';
import { SctpParameters, NumSctpStreams } from './SctpParameters';
import { Either, AppData } from './types';
Expand Down Expand Up @@ -119,9 +119,8 @@ export type PipeTransportObserverEvents = TransportObserverEvents & {
sctpstatechange: [SctpState];
};

export interface PipeTransportInterface<
PipeTransportAppData extends AppData = AppData,
> extends TransportInterface<
export interface PipeTransport<PipeTransportAppData extends AppData = AppData>
extends Transport<
PipeTransportAppData,
PipeTransportEvents,
PipeTransportObserver
Expand Down Expand Up @@ -190,7 +189,5 @@ export interface PipeTransportInterface<
consume<ConsumerAppData extends AppData = AppData>({
producerId,
appData,
}: PipeConsumerOptions<ConsumerAppData>): Promise<
ConsumerInterface<ConsumerAppData>
>;
}: PipeConsumerOptions<ConsumerAppData>): Promise<Consumer<ConsumerAppData>>;
}
Loading

0 comments on commit 90b2265

Please sign in to comment.