Skip to content

Commit

Permalink
Use import type when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Nov 8, 2024
1 parent fd1f37f commit a4ee487
Show file tree
Hide file tree
Showing 53 changed files with 212 additions and 200 deletions.
6 changes: 3 additions & 3 deletions node/src/ActiveSpeakerObserver.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
import type {
ActiveSpeakerObserver,
ActiveSpeakerObserverDominantSpeaker,
ActiveSpeakerObserverEvents,
ActiveSpeakerObserverObserver,
ActiveSpeakerObserverObserverEvents,
} from './ActiveSpeakerObserverTypes';
import { RtpObserver } from './RtpObserverTypes';
import type { RtpObserver } from './RtpObserverTypes';
import { RtpObserverImpl, RtpObserverConstructorOptions } from './RtpObserver';
import { AppData } from './types';
import type { AppData } from './types';
import { Event, Notification } from './fbs/notification';
import * as FbsActiveSpeakerObserver from './fbs/active-speaker-observer';

Expand Down
8 changes: 4 additions & 4 deletions node/src/ActiveSpeakerObserverTypes.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { EnhancedEventEmitter } from './enhancedEvents';
import {
import type { EnhancedEventEmitter } from './enhancedEvents';
import type {
RtpObserver,
RtpObserverEvents,
RtpObserverObserverEvents,
} from './RtpObserverTypes';
import { Producer } from './ProducerTypes';
import { AppData } from './types';
import type { Producer } from './ProducerTypes';
import type { AppData } from './types';

export type ActiveSpeakerObserverOptions<
ActiveSpeakerObserverAppData extends AppData = AppData,
Expand Down
8 changes: 4 additions & 4 deletions node/src/AudioLevelObserver.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
import type {
AudioLevelObserver,
AudioLevelObserverVolume,
AudioLevelObserverEvents,
AudioLevelObserverObserver,
AudioLevelObserverObserverEvents,
} from './AudioLevelObserverTypes';
import { RtpObserver } from './RtpObserverTypes';
import type { RtpObserver } from './RtpObserverTypes';
import { RtpObserverImpl, RtpObserverConstructorOptions } from './RtpObserver';
import { Producer } from './ProducerTypes';
import { AppData } from './types';
import type { Producer } from './ProducerTypes';
import type { AppData } from './types';
import * as fbsUtils from './fbsUtils';
import { Event, Notification } from './fbs/notification';
import * as FbsAudioLevelObserver from './fbs/audio-level-observer';
Expand Down
8 changes: 4 additions & 4 deletions node/src/AudioLevelObserverTypes.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { EnhancedEventEmitter } from './enhancedEvents';
import {
import type { EnhancedEventEmitter } from './enhancedEvents';
import type {
RtpObserver,
RtpObserverEvents,
RtpObserverObserverEvents,
} from './RtpObserverTypes';
import { Producer } from './ProducerTypes';
import { AppData } from './types';
import type { Producer } from './ProducerTypes';
import type { AppData } from './types';

export type AudioLevelObserverOptions<
AudioLevelObserverAppData extends AppData = AppData,
Expand Down
10 changes: 5 additions & 5 deletions node/src/Consumer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
import type {
Consumer,
ConsumerType,
ConsumerScore,
Expand All @@ -23,15 +23,15 @@ import {
ConsumerObserverEvents,
} from './ConsumerTypes';
import { Channel } from './Channel';
import { TransportInternal } from './Transport';
import { ProducerStat } from './ProducerTypes';
import { MediaKind, RtpParameters } from './rtpParametersTypes';
import type { TransportInternal } from './Transport';
import type { ProducerStat } from './ProducerTypes';
import type { MediaKind, RtpParameters } from './rtpParametersTypes';
import {
parseRtpEncodingParameters,
parseRtpParameters,
} from './rtpParametersFbsUtils';
import { parseRtpStreamStats } from './RtpStream';
import { AppData } from './types';
import type { AppData } from './types';
import * as fbsUtils from './fbsUtils';
import { Event, Notification } from './fbs/notification';
import { TraceDirection as FbsTraceDirection } from './fbs/common';
Expand Down
10 changes: 5 additions & 5 deletions node/src/ConsumerTypes.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { EnhancedEventEmitter } from './enhancedEvents';
import { ProducerStat } from './ProducerTypes';
import {
import type { EnhancedEventEmitter } from './enhancedEvents';
import type { ProducerStat } from './ProducerTypes';
import type {
MediaKind,
RtpCapabilities,
RtpEncodingParameters,
RtpParameters,
} from './rtpParametersTypes';
import { RtpStreamSendStats } from './RtpStream';
import { AppData } from './types';
import type { RtpStreamSendStats } from './RtpStream';
import type { AppData } from './types';

export type ConsumerOptions<ConsumerAppData extends AppData = AppData> = {
/**
Expand Down
8 changes: 4 additions & 4 deletions node/src/DataConsumer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
import type {
DataConsumer,
DataConsumerType,
DataConsumerDump,
Expand All @@ -10,10 +10,10 @@ import {
DataConsumerObserverEvents,
} from './DataConsumerTypes';
import { Channel } from './Channel';
import { TransportInternal } from './Transport';
import { SctpStreamParameters } from './sctpParametersTypes';
import type { TransportInternal } from './Transport';
import type { SctpStreamParameters } from './sctpParametersTypes';
import { parseSctpStreamParameters } from './sctpParametersFbsUtils';
import { AppData } from './types';
import type { AppData } from './types';
import * as fbsUtils from './fbsUtils';
import { Event, Notification } from './fbs/notification';
import * as FbsTransport from './fbs/transport';
Expand Down
6 changes: 3 additions & 3 deletions node/src/DataConsumerTypes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EnhancedEventEmitter } from './enhancedEvents';
import { SctpStreamParameters } from './sctpParametersTypes';
import { AppData } from './types';
import type { EnhancedEventEmitter } from './enhancedEvents';
import type { SctpStreamParameters } from './sctpParametersTypes';
import type { AppData } from './types';

export type DataConsumerOptions<DataConsumerAppData extends AppData = AppData> =
{
Expand Down
8 changes: 4 additions & 4 deletions node/src/DataProducer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
import type {
DataProducer,
DataProducerType,
DataProducerDump,
Expand All @@ -10,10 +10,10 @@ import {
DataProducerObserverEvents,
} from './DataProducerTypes';
import { Channel } from './Channel';
import { TransportInternal } from './Transport';
import { SctpStreamParameters } from './sctpParametersTypes';
import type { TransportInternal } from './Transport';
import type { SctpStreamParameters } from './sctpParametersTypes';
import { parseSctpStreamParameters } from './sctpParametersFbsUtils';
import { AppData } from './types';
import type { AppData } from './types';
import * as FbsTransport from './fbs/transport';
import * as FbsNotification from './fbs/notification';
import * as FbsRequest from './fbs/request';
Expand Down
6 changes: 3 additions & 3 deletions node/src/DataProducerTypes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EnhancedEventEmitter } from './enhancedEvents';
import { SctpStreamParameters } from './sctpParametersTypes';
import { AppData } from './types';
import type { EnhancedEventEmitter } from './enhancedEvents';
import type { SctpStreamParameters } from './sctpParametersTypes';
import type { AppData } from './types';

export type DataProducerOptions<DataProducerAppData extends AppData = AppData> =
{
Expand Down
8 changes: 4 additions & 4 deletions node/src/DirectTransport.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
import type {
DirectTransport,
DirectTransportDump,
DirectTransportStat,
DirectTransportEvents,
DirectTransportObserver,
DirectTransportObserverEvents,
} from './DirectTransportTypes';
import { Transport, BaseTransportDump } from './TransportTypes';
import type { Transport, BaseTransportDump } from './TransportTypes';
import {
TransportImpl,
TransportConstructorOptions,
parseBaseTransportDump,
parseBaseTransportStats,
parseTransportTraceEventData,
} from './Transport';
import { SctpParameters } from './sctpParametersTypes';
import { AppData } from './types';
import type { SctpParameters } from './sctpParametersTypes';
import type { AppData } from './types';
import { UnsupportedError } from './errors';
import { Event, Notification } from './fbs/notification';
import * as FbsDirectTransport from './fbs/direct-transport';
Expand Down
6 changes: 3 additions & 3 deletions node/src/DirectTransportTypes.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { EnhancedEventEmitter } from './enhancedEvents';
import {
import type { EnhancedEventEmitter } from './enhancedEvents';
import type {
Transport,
BaseTransportDump,
BaseTransportStats,
TransportEvents,
TransportObserverEvents,
} from './TransportTypes';
import { AppData } from './types';
import type { AppData } from './types';

export type DirectTransportOptions<
DirectTransportAppData extends AppData = AppData,
Expand Down
16 changes: 8 additions & 8 deletions node/src/PipeTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as flatbuffers from 'flatbuffers';
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import * as ortc from './ortc';
import {
import type {
PipeTransport,
PipeConsumerOptions,
PipeTransportDump,
Expand All @@ -11,7 +11,7 @@ import {
PipeTransportObserver,
PipeTransportObserverEvents,
} from './PipeTransportTypes';
import { Transport, TransportTuple, SctpState } from './TransportTypes';
import type { Transport, TransportTuple, SctpState } from './TransportTypes';
import {
TransportImpl,
TransportConstructorOptions,
Expand All @@ -21,21 +21,21 @@ import {
parseTuple,
parseTransportTraceEventData,
} from './Transport';
import { Producer } from './ProducerTypes';
import { Consumer, ConsumerType } from './ConsumerTypes';
import type { Producer } from './ProducerTypes';
import type { Consumer, ConsumerType } from './ConsumerTypes';
import { ConsumerImpl } from './Consumer';
import { RtpParameters } from './rtpParametersTypes';
import type { RtpParameters } from './rtpParametersTypes';
import {
serializeRtpEncodingParameters,
serializeRtpParameters,
} from './rtpParametersFbsUtils';
import { SctpParameters } from './sctpParametersTypes';
import { SrtpParameters } from './srtpParametersTypes';
import type { SctpParameters } from './sctpParametersTypes';
import type { SrtpParameters } from './srtpParametersTypes';
import {
parseSrtpParameters,
serializeSrtpParameters,
} from './srtpParametersFbsUtils';
import { AppData } from './types';
import type { AppData } from './types';
import { generateUUIDv4 } from './utils';
import { MediaKind as FbsMediaKind } from './fbs/rtp-parameters/media-kind';
import * as FbsRtpParameters from './fbs/rtp-parameters';
Expand Down
12 changes: 6 additions & 6 deletions node/src/PipeTransportTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EnhancedEventEmitter } from './enhancedEvents';
import {
import type { EnhancedEventEmitter } from './enhancedEvents';
import type {
Transport,
TransportListenInfo,
TransportListenIp,
Expand All @@ -10,10 +10,10 @@ import {
TransportEvents,
TransportObserverEvents,
} from './TransportTypes';
import { Consumer } from './ConsumerTypes';
import { SrtpParameters } from './srtpParametersTypes';
import { SctpParameters, NumSctpStreams } from './sctpParametersTypes';
import { Either, AppData } from './types';
import type { Consumer } from './ConsumerTypes';
import type { SrtpParameters } from './srtpParametersTypes';
import type { SctpParameters, NumSctpStreams } from './sctpParametersTypes';
import type { Either, AppData } from './types';

export type PipeTransportOptions<
PipeTransportAppData extends AppData = AppData,
Expand Down
10 changes: 5 additions & 5 deletions node/src/PlainTransport.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as flatbuffers from 'flatbuffers';
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
import type {
PlainTransport,
PlainTransportDump,
PlainTransportStat,
PlainTransportEvents,
PlainTransportObserver,
PlainTransportObserverEvents,
} from './PlainTransportTypes';
import { Transport, TransportTuple, SctpState } from './TransportTypes';
import type { Transport, TransportTuple, SctpState } from './TransportTypes';
import {
TransportImpl,
TransportConstructorOptions,
Expand All @@ -19,13 +19,13 @@ import {
parseBaseTransportStats,
parseTransportTraceEventData,
} from './Transport';
import { SctpParameters } from './sctpParametersTypes';
import { SrtpParameters } from './srtpParametersTypes';
import type { SctpParameters } from './sctpParametersTypes';
import type { SrtpParameters } from './srtpParametersTypes';
import {
parseSrtpParameters,
serializeSrtpParameters,
} from './srtpParametersFbsUtils';
import { AppData } from './types';
import type { AppData } from './types';
import { Event, Notification } from './fbs/notification';
import * as FbsRequest from './fbs/request';
import * as FbsTransport from './fbs/transport';
Expand Down
10 changes: 5 additions & 5 deletions node/src/PlainTransportTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EnhancedEventEmitter } from './enhancedEvents';
import {
import type { EnhancedEventEmitter } from './enhancedEvents';
import type {
Transport,
TransportListenInfo,
TransportListenIp,
Expand All @@ -10,9 +10,9 @@ import {
TransportEvents,
TransportObserverEvents,
} from './TransportTypes';
import { SrtpParameters, SrtpCryptoSuite } from './srtpParametersTypes';
import { SctpParameters, NumSctpStreams } from './sctpParametersTypes';
import { Either, AppData } from './types';
import type { SrtpParameters, SrtpCryptoSuite } from './srtpParametersTypes';
import type { SctpParameters, NumSctpStreams } from './sctpParametersTypes';
import type { Either, AppData } from './types';

export type PlainTransportOptions<
PlainTransportAppData extends AppData = AppData,
Expand Down
8 changes: 4 additions & 4 deletions node/src/Producer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import {
import type {
Producer,
ProducerType,
ProducerScore,
Expand All @@ -14,11 +14,11 @@ import {
ProducerObserverEvents,
} from './ProducerTypes';
import { Channel } from './Channel';
import { TransportInternal } from './Transport';
import { MediaKind, RtpParameters } from './rtpParametersTypes';
import type { TransportInternal } from './Transport';
import type { MediaKind, RtpParameters } from './rtpParametersTypes';
import { parseRtpParameters } from './rtpParametersFbsUtils';
import { parseRtpStreamRecvStats } from './RtpStream';
import { AppData } from './types';
import type { AppData } from './types';
import * as fbsUtils from './fbsUtils';
import { Event, Notification } from './fbs/notification';
import { TraceDirection as FbsTraceDirection } from './fbs/common';
Expand Down
8 changes: 4 additions & 4 deletions node/src/ProducerTypes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EnhancedEventEmitter } from './enhancedEvents';
import { MediaKind, RtpParameters } from './rtpParametersTypes';
import { RtpStreamRecvStats } from './RtpStream';
import { AppData } from './types';
import type { EnhancedEventEmitter } from './enhancedEvents';
import type { MediaKind, RtpParameters } from './rtpParametersTypes';
import type { RtpStreamRecvStats } from './RtpStream';
import type { AppData } from './types';

export type ProducerOptions<ProducerAppData extends AppData = AppData> = {
/**
Expand Down
Loading

0 comments on commit a4ee487

Please sign in to comment.