diff --git a/lib/Consumer.d.ts b/lib/Consumer.d.ts index 758790f1..6a2a3079 100644 --- a/lib/Consumer.d.ts +++ b/lib/Consumer.d.ts @@ -7,7 +7,17 @@ export declare type ConsumerOptions = { rtpParameters: RtpParameters; appData?: Record; }; -export declare class Consumer extends EnhancedEventEmitter { +export declare type ConsumerEvents = { + transportclose: []; + trackended: []; +}; +export declare type ConsumerObserverEvents = { + close: []; + pause: []; + resume: []; + trackended: []; +}; +export declare class Consumer extends EnhancedEventEmitter { private readonly _id; private readonly _localId; private readonly _producerId; @@ -17,7 +27,9 @@ export declare class Consumer extends EnhancedEventEmitter { private readonly _rtpParameters; private _paused; private readonly _appData; - protected readonly _observer: EnhancedEventEmitter; + protected readonly _observer: EnhancedEventEmitter; /** * @emits transportclose * @emits trackended @@ -87,7 +99,7 @@ export declare class Consumer extends EnhancedEventEmitter { * @emits resume * @emits trackended */ - get observer(): EnhancedEventEmitter; + get observer(): EnhancedEventEmitter; /** * Closes the Consumer. */ diff --git a/lib/Consumer.d.ts.map b/lib/Consumer.d.ts.map index e2346745..3452b073 100644 --- a/lib/Consumer.d.ts.map +++ b/lib/Consumer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Consumer.d.ts","sourceRoot":"","sources":["../src/Consumer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE3D,oBAAY,eAAe,GAC3B;IACC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAA;AAID,qBAAa,QAAS,SAAQ,oBAAoB;IAGjD,OAAO,CAAC,QAAQ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jC;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAGpB;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGrC;IAED;;OAEG;IAEH,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAG3C;IAED;;;;;;;OAOG;IACH,IAAI,QAAQ,IAAI,oBAAoB,CAAC,sBAAsB,CAAC,CAG3D;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;IAiBb;;OAEG;IACH,eAAe,IAAI,IAAI;IAiBvB;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC;IAQzC;;OAEG;IACH,KAAK,IAAI,IAAI;IAoBb;;OAEG;IACH,MAAM,IAAI,IAAI;IAoBd,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,aAAa;CAUrB"} \ No newline at end of file diff --git a/lib/DataConsumer.d.ts b/lib/DataConsumer.d.ts index d6696b79..8dca5b58 100644 --- a/lib/DataConsumer.d.ts +++ b/lib/DataConsumer.d.ts @@ -8,14 +8,26 @@ export declare type DataConsumerOptions = { protocol?: string; appData?: Record; }; -export declare class DataConsumer extends EnhancedEventEmitter { +export declare type DataConsumerEvents = { + transportclose: []; + open: []; + error: [Error]; + close: []; + message: [string | Blob | ArrayBuffer]; +}; +export declare type DataConsumerObserverEvents = { + close: []; +}; +export declare class DataConsumer extends EnhancedEventEmitter { private readonly _id; private readonly _dataProducerId; private readonly _dataChannel; private _closed; private readonly _sctpStreamParameters; private readonly _appData; - protected readonly _observer: EnhancedEventEmitter; + protected readonly _observer: EnhancedEventEmitter; /** * @emits transportclose * @emits open @@ -80,7 +92,7 @@ export declare class DataConsumer extends EnhancedEventEmitter { * * @emits close */ - get observer(): EnhancedEventEmitter; + get observer(): EnhancedEventEmitter; /** * Closes the DataConsumer. */ diff --git a/lib/DataConsumer.d.ts.map b/lib/DataConsumer.d.ts.map index 3a2445f3..7fd54a9c 100644 --- a/lib/DataConsumer.d.ts.map +++ b/lib/DataConsumer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"DataConsumer.d.ts","sourceRoot":"","sources":["../src/DataConsumer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,oBAAY,mBAAmB,GAC/B;IACC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAA;AAID,qBAAa,YAAa,SAAQ,oBAAoB;IAGrD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAE7B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IAEzC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAiB;IAE9C,OAAO,CAAC,OAAO,CAAS;IAExB,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAuB;IAE7D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0B;IAEnD,SAAS,CAAC,QAAQ,CAAC,SAAS,uBAA8B;IAE1D;;;;;;;OAOG;gBAEF,EACC,EAAE,EACF,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,OAAO,EACP,EACD;QACC,EAAE,EAAE,MAAM,CAAC;QACX,cAAc,EAAE,MAAM,CAAC;QACvB,WAAW,EAAE,cAAc,CAAC;QAC5B,oBAAoB,EAAE,oBAAoB,CAAC;QAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC;IAgBF;;OAEG;IACH,IAAI,EAAE,IAAI,MAAM,CAGf;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,MAAM,CAG3B;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAGpB;IAED;;OAEG;IACH,IAAI,oBAAoB,IAAI,oBAAoB,CAG/C;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,mBAAmB,CAGpC;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAGlB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAGrB;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,UAAU,CAG3B;IAED;;OAEG;IACH,IAAI,UAAU,CAAC,UAAU,EAAE,UAAU,EAGpC;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGrC;IAED;;OAEG;IAEH,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAG3C;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,oBAAoB,CAGnC;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;IAiBb;;OAEG;IACH,eAAe,IAAI,IAAI;IAiBvB,OAAO,CAAC,kBAAkB;CAyD1B"} \ No newline at end of file +{"version":3,"file":"DataConsumer.d.ts","sourceRoot":"","sources":["../src/DataConsumer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,oBAAY,mBAAmB,GAC/B;IACC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAA;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AAI,MAAM,CAGlB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAGrB;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,UAAU,CAG3B;IAED;;OAEG;IACH,IAAI,UAAU,CAAC,UAAU,EAAE,UAAU,EAGpC;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGrC;IAED;;OAEG;IAEH,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAG3C;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,oBAAoB,CAAC,0BAA0B,CAAC,CAG/D;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;IAiBb;;OAEG;IACH,eAAe,IAAI,IAAI;IAiBvB,OAAO,CAAC,kBAAkB;CAyD1B"} \ No newline at end of file diff --git a/lib/DataProducer.d.ts b/lib/DataProducer.d.ts index c8585e7e..45ec054a 100644 --- a/lib/DataProducer.d.ts +++ b/lib/DataProducer.d.ts @@ -8,13 +8,25 @@ export declare type DataProducerOptions = { protocol?: string; appData?: Record; }; -export declare class DataProducer extends EnhancedEventEmitter { +export declare type DataProducerEvents = { + transportclose: []; + open: []; + error: [Error]; + close: []; + bufferedamountlow: []; +}; +export declare type DataProducerObserverEvents = { + close: []; +}; +export declare class DataProducer extends EnhancedEventEmitter { private readonly _id; private readonly _dataChannel; private _closed; private readonly _sctpStreamParameters; private readonly _appData; - protected readonly _observer: EnhancedEventEmitter; + protected readonly _observer: EnhancedEventEmitter; /** * @emits transportclose * @emits open @@ -78,7 +90,7 @@ export declare class DataProducer extends EnhancedEventEmitter { * * @emits close */ - get observer(): EnhancedEventEmitter; + get observer(): EnhancedEventEmitter; /** * Closes the DataProducer. */ diff --git a/lib/DataProducer.d.ts.map b/lib/DataProducer.d.ts.map index c8df099a..f29fca6d 100644 --- a/lib/DataProducer.d.ts.map +++ b/lib/DataProducer.d.ts.map @@ -1 +1 @@ -{"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,KAAK,IAAI,MAAM,CAGlB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAGrB;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,MAAM,CAG3B;IAED;;OAEG;IACH,IAAI,0BAA0B,IAAI,MAAM,CAGvC;IAED;;OAEG;IACH,IAAI,0BAA0B,CAAC,0BAA0B,EAAE,MAAM,EAGhE;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGrC;IAED;;OAEG;IAEH,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAG3C;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,oBAAoB,CAGnC;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;IAiBb;;OAEG;IACH,eAAe,IAAI,IAAI;IAiBvB;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAUrB,OAAO,CAAC,kBAAkB;CAkE1B"} \ No newline at end of file +{"version":3,"file":"DataProducer.d.ts","sourceRoot":"","sources":["../src/DataProducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,oBAAY,mBAAmB,GAC/B;IACC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAA;AAED,oBAAY,kBAAkB,GAC9B;IACC,cAAc,EAAE,EAAE,CAAC;IACnB,IAAI,EAAE,EAAE,CAAC;IACT,KAAK,EAAE,CAAC,KAAK,C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AAE,OAAO,CAAC,CAGrC;IAED;;OAEG;IAEH,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAG3C;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,oBAAoB,CAAC,0BAA0B,CAAC,CAG/D;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;IAiBb;;OAEG;IACH,eAAe,IAAI,IAAI;IAiBvB;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAUrB,OAAO,CAAC,kBAAkB;CAkE1B"} \ No newline at end of file diff --git a/lib/Device.d.ts b/lib/Device.d.ts index 7304305d..3c687800 100644 --- a/lib/Device.d.ts +++ b/lib/Device.d.ts @@ -28,7 +28,13 @@ export declare class Device { private _recvRtpCapabilities?; private readonly _canProduceByKind; private _sctpCapabilities?; - protected readonly _observer: EnhancedEventEmitter; + protected readonly _observer: EnhancedEventEmitter<{ + [x: string]: any[]; + }, { + [x: string]: any[]; + } & { + [x: `@${string}`]: any[]; + }>; /** * Create a new Device to connect to mediasoup server. * diff --git a/lib/Device.d.ts.map b/lib/Device.d.ts.map index 5fe20f22..af89ebb3 100644 --- a/lib/Device.d.ts.map +++ b/lib/Device.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../src/Device.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAoB,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAoB,MAAM,6BAA6B,CAAC;AAU/E,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIpD,oBAAY,kBAAkB,GAC3B,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,GACX,UA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a,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,EAAE,gBAAgB,GACjB,SAAS;IAoBZ;;;;;OAKG;IACH,mBAAmB,CAClB,EACC,EAAE,EACF,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,EAAE,gBAAgB,GACjB,SAAS;IAoBZ,OAAO,CAAC,gBAAgB;CAuDxB"} \ No newline at end of file +{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../src/Device.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAoB,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAoB,MAAM,6BAA6B,CAAC;AAU/E,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIpD,oBAAY,kBAAkB,GAC3B,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,GACX,UAAU,GACV,UAAU,GACV,QAAQ,GACR,aAAa,CAAC;AAEjB,oBAAY,aAAa,GACzB;IACC;;OAEG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAOF,wBAAgB,YAAY,IAAI,kBAAkB,GAAG,SAAS,CA0H7D;AAED,qBAAa,MAAM;IAGlB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IAEjD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC,OAAO,CAAC,OAAO,CAAS;IAExB,OAAO,CAAC,wBAAwB,CAAC,CAAM;IAEvC,OAAO,CAAC,oBAAoB,CAAC,CAAkB;IAG/C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IAErD,OAAO,CAAC,iBAAiB,CAAC,CAAmB;IAE7C,SAAS,CAAC,QAAQ,CAAC,SAAS;;;;;;OAA8B;IAE1D;;;;OAIG;gBACS,EAAE,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,GAAE,aAAkB;IA8FxE;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAGxB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAGpB;IAED;;;;OAIG;IACH,IAAI,eAAe,IAAI,eAAe,CAMrC;IAED;;;;OAIG;IACH,IAAI,gBAAgB,IAAI,gBAAgB,CAMvC;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,oBAAoB,CAGnC;IAED;;OAEG;IACG,IAAI,CACT,EAAE,qBAAqB,EAAE,EACzB;QAAE,qBAAqB,EAAE,eAAe,CAAA;KAAE,GACxC,OAAO,CAAC,IAAI,CAAC;IA4EhB;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO;IAUpC;;;;;OAKG;IACH,mBAAmB,CAClB,EACC,EAAE,EACF,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,EAAE,gBAAgB,GACjB,SAAS;IAoBZ;;;;;OAKG;IACH,mBAAmB,CAClB,EACC,EAAE,EACF,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,EAAE,gBAAgB,GACjB,SAAS;IAoBZ,OAAO,CAAC,gBAAgB;CAuDxB"} \ No newline at end of file diff --git a/lib/Device.js b/lib/Device.js index 5045f159..d98ad5eb 100644 --- a/lib/Device.js +++ b/lib/Device.js @@ -2,11 +2,7 @@ /* global RTCRtpTransceiver */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/EnhancedEventEmitter.d.ts b/lib/EnhancedEventEmitter.d.ts index bee9ff77..80da5863 100644 --- a/lib/EnhancedEventEmitter.d.ts +++ b/lib/EnhancedEventEmitter.d.ts @@ -1,8 +1,19 @@ /// import { EventEmitter } from 'events'; -export declare class EnhancedEventEmitter extends EventEmitter { +declare type Events = Record; +declare type InternalEvents = Record<`@${string}`, any[]>; +export declare class EnhancedEventEmitter extends EventEmitter { constructor(); - safeEmit(event: string, ...args: any[]): boolean; - safeEmitAsPromise(event: string, ...args: any[]): Promise; + safeEmit(event: K, ...args: E[K]): boolean; + safeEmitAsPromise(event: K, ...args: [ + ] extends E[K] ? unknown[] : [E[K][0]]): Promise; + on(event: K, listener: (...args: E[K]) => void): this; + off(event: K, listener: (...args: E[K]) => void): this; + addListener(event: K, listener: (...args: E[K]) => void): this; + prependListener(event: K, listener: (...args: E[K]) => void): this; + once(event: K, listener: (...args: E[K]) => void): this; + prependOnceListener(event: K, listener: (...args: E[K]) => void): this; + removeListener(event: K, listener: (...args: E[K]) => void): this; } +export {}; //# sourceMappingURL=EnhancedEventEmitter.d.ts.map \ No newline at end of file diff --git a/lib/EnhancedEventEmitter.d.ts.map b/lib/EnhancedEventEmitter.d.ts.map index 0def633a..0cf07454 100644 --- a/lib/EnhancedEventEmitter.d.ts.map +++ b/lib/EnhancedEventEmitter.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"EnhancedEventEmitter.d.ts","sourceRoot":"","sources":["../src/EnhancedEventEmitter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAKtC,qBAAa,oBAAqB,SAAQ,YAAY;;IAQrD,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO;IAkB1C,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAkBpE"} \ No newline at end of file +{"version":3,"file":"EnhancedEventEmitter.d.ts","sourceRoot":"","sources":["../src/EnhancedEventEmitter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAKtC,aAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAA;AACnC,aAAK,cAAc,GAAG,MAAM,CAAC,IAAI,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;AAEjD,qBAAa,oBAAoB,CAAC,YAAY,SAAS,MAAM,GAAG,MAAM,EACtE,CAAC,SAAS,YAAY,GAAG,YAAY,GAAG,cAAc,CAAE,SAAQ,YAAY;;IAQ3E,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO;IAkBhE,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EACpE;KAAE,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACxC,OAAO,CAAC,GAAG,CAAC;IAmBZ,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;IAO1E,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;IAO3E,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;IAMnF,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;IAOvF,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;IAM5E,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EACvD,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;IAOlC,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;CAMtF"} \ No newline at end of file diff --git a/lib/EnhancedEventEmitter.js b/lib/EnhancedEventEmitter.js index 9c0a0f53..07df1650 100644 --- a/lib/EnhancedEventEmitter.js +++ b/lib/EnhancedEventEmitter.js @@ -30,5 +30,33 @@ class EnhancedEventEmitter extends events_1.EventEmitter { } }); } + on(event, listener) { + super.on(event, listener); + return this; + } + off(event, listener) { + super.off(event, listener); + return this; + } + addListener(event, listener) { + super.on(event, listener); + return this; + } + prependListener(event, listener) { + super.prependListener(event, listener); + return this; + } + once(event, listener) { + super.once(event, listener); + return this; + } + prependOnceListener(event, listener) { + super.prependOnceListener(event, listener); + return this; + } + removeListener(event, listener) { + super.off(event, listener); + return this; + } } exports.EnhancedEventEmitter = EnhancedEventEmitter; diff --git a/lib/Producer.d.ts b/lib/Producer.d.ts index 7be444dd..f21e33eb 100644 --- a/lib/Producer.d.ts +++ b/lib/Producer.d.ts @@ -21,7 +21,17 @@ export declare type ProducerCodecOptions = { videoGoogleMaxBitrate?: number; videoGoogleMinBitrate?: number; }; -export declare class Producer extends EnhancedEventEmitter { +export declare type ProducerEvents = { + transportclose: []; + trackended: []; +}; +export declare type ProducerObserverEvents = { + close: []; + pause: []; + resume: []; + trackended: []; +}; +export declare class Producer extends EnhancedEventEmitter { private readonly _id; private readonly _localId; private _closed; @@ -35,7 +45,9 @@ export declare class Producer extends EnhancedEventEmitter { private _disableTrackOnPause; private _zeroRtpOnPause; private readonly _appData; - protected readonly _observer: EnhancedEventEmitter; + protected readonly _observer: EnhancedEventEmitter; /** * @emits transportclose * @emits trackended @@ -110,7 +122,7 @@ export declare class Producer extends EnhancedEventEmitter { * @emits resume * @emits trackended */ - get observer(): EnhancedEventEmitter; + get observer(): EnhancedEventEmitter; /** * Closes the Producer. */ diff --git a/lib/Producer.d.ts.map b/lib/Producer.d.ts.map index 8ee71512..89ae5799 100644 --- a/lib/Producer.d.ts.map +++ b/lib/Producer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Producer.d.ts","sourceRoot":"","sources":["../src/Producer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,MAAM,iBAAiB,CAAC;A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H,eAAe,IAAI,IAAI;IAiBvB;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC;IAQzC;;OAEG;IACH,KAAK,IAAI,IAAI;IA4Bb;;OAEG;IACH,MAAM,IAAI,IAAI;IA4Bd;;OAEG;IACG,YAAY,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAsDhF;;OAEG;IACG,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB7D;;OAEG;IACG,wBAAwB,CAC7B,MAAM,EAAE,wBAAwB,GAC9B,OAAO,CAAC,IAAI,CAAC;IAUhB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,aAAa;CAgBrB"} \ No newline at end of file diff --git a/lib/Transport.d.ts b/lib/Transport.d.ts index edd0febc..5a2c3123 100644 --- a/lib/Transport.d.ts +++ b/lib/Transport.d.ts @@ -4,7 +4,8 @@ import { Producer, ProducerOptions } from './Producer'; import { Consumer, ConsumerOptions } from './Consumer'; import { DataProducer, DataProducerOptions } from './DataProducer'; import { DataConsumer, DataConsumerOptions } from './DataConsumer'; -import { SctpParameters } from './SctpParameters'; +import { SctpParameters, SctpStreamParameters } from './SctpParameters'; +import { MediaKind, RtpParameters } from './RtpParameters'; interface InternalTransportOptions extends TransportOptions { direction: 'send' | 'recv'; handlerFactory: HandlerFactory; @@ -100,7 +101,33 @@ export declare type PlainRtpParameters = { ipVersion: 4 | 6; port: number; }; -export declare class Transport extends EnhancedEventEmitter { +export declare type TransportProduceParameters = { + kind: MediaKind; + rtpParameters: RtpParameters; + appData: AppData; +}; +export declare type TransportProduceDataParameters = { + sctpStreamParameters: SctpStreamParameters; + label: string; + protocol: string; + appData: AppData; +}; +export declare type TransportEvents = { + connect: [{ + dtlsParameters: DtlsParameters; + }, Function, Function]; + produce: [TransportProduceParameters, Function, Function]; + producedata: [TransportProduceDataParameters, Function, Function]; + connectionstatechange: [ConnectionState]; +}; +export declare type TransportObserverEvents = { + close: []; + newproducer: [Producer]; + newconsumer: [Consumer]; + newdataproducer: [DataProducer]; + newdataconsumer: [DataConsumer]; +}; +export declare class Transport extends EnhancedEventEmitter { private readonly _id; private _closed; private readonly _direction; @@ -122,7 +149,9 @@ export declare class Transport extends EnhancedEventEmitter { private _consumerPauseInProgress; private _pendingResumeConsumers; private _consumerResumeInProgress; - protected readonly _observer: EnhancedEventEmitter; + protected readonly _observer: EnhancedEventEmitter; /** * @emits connect - (transportLocalParameters: any, callback: Function, errback: Function) * @emits connectionstatechange - (connectionState: ConnectionState) @@ -167,7 +196,7 @@ export declare class Transport extends EnhancedEventEmitter { * @emits newdataproducer - (dataProducer: DataProducer) * @emits newdataconsumer - (dataProducer: DataProducer) */ - get observer(): EnhancedEventEmitter; + get observer(): EnhancedEventEmitter; /** * Close the Transport. */ diff --git a/lib/Transport.d.ts.map b/lib/Transport.d.ts.map index 1e221424..2ac7bd4d 100644 --- a/lib/Transport.d.ts.map +++ b/lib/Transport.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Transport.d.ts","sourceRoot":"","sources":["../src/Transport.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAyB,MAAM,6BAA6B,CAAC;AACtG,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,UAAU,wBAAyB,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GAC9B,OAAO,CAAC,IAAI,CAAC;IAehB;;OAEG;IACG,gBAAgB,CACrB,EAAE,UAAU,EAAE,GACd;QAAE,UAAU,CAAC,EAAE,YAAY,EAAE,CAAA;KAAO,GAClC,OAAO,CAAC,IAAI,CAAC;IAehB;;OAEG;IACG,OAAO,CACZ,EACC,KAAK,EACL,SAAS,EACT,YAAY,EACZ,KAAK,EACL,UAAiB,EACjB,mBAA0B,EAC1B,cAAsB,EACtB,OAAY,EACZ,GAAE,eAAoB,GACrB,OAAO,CAAC,QAAQ,CAAC;IAgIpB;;OAEG;IACG,OAAO,CACZ,EACC,EAAE,EACF,UAAU,EACV,IAAI,EACJ,aAAa,EACb,OAAY,EACZ,EAAE,eAAe,GAChB,OAAO,CAAC,QAAQ,CAAC;IAkDpB;;OAEG;IACG,WAAW,CAChB,EACC,OAAc,EACd,iBAAiB,EACjB,cAAc,EACd,KAAU,EACV,QAAa,EACb,OAAY,EACZ,GAAE,mBAAwB,GACzB,OAAO,CAAC,YAAY,CAAC;IA4DxB;;OAEG;IACG,WAAW,CAChB,EACC,EAAE,EACF,cAAc,EACd,oBAAoB,EACpB,KAAU,EACV,QAAa,EACb,OAAY,EACZ,EAAE,mBAAmB,GACpB,OAAO,CAAC,YAAY,CAAC;IA0DlB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IAoH9C,sBAAsB;IAsCtB,uBAAuB;IAsCvB,cAAc,IAAI,IAAI;IAkCtB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAuDzC,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAgEzC,mBAAmB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;IAQrD,mBAAmB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;CAOrD"} \ No newline at end of file +{"version":3,"file":"Transport.d.ts","sourceRoot":"","sources":["../src/Transport.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB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;IAQrD,mBAAmB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;CAOrD"} \ No newline at end of file diff --git a/lib/Transport.js b/lib/Transport.js index fd4a57a7..b6976d69 100644 --- a/lib/Transport.js +++ b/lib/Transport.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/Chrome55.js b/lib/handlers/Chrome55.js index 5b6e999e..a0f5ce67 100644 --- a/lib/handlers/Chrome55.js +++ b/lib/handlers/Chrome55.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/Chrome67.js b/lib/handlers/Chrome67.js index c7617f54..5aa46886 100644 --- a/lib/handlers/Chrome67.js +++ b/lib/handlers/Chrome67.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/Chrome70.js b/lib/handlers/Chrome70.js index 8fa39f85..04a258f6 100644 --- a/lib/handlers/Chrome70.js +++ b/lib/handlers/Chrome70.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/Chrome74.js b/lib/handlers/Chrome74.js index cfe67281..220b722b 100644 --- a/lib/handlers/Chrome74.js +++ b/lib/handlers/Chrome74.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/Edge11.js b/lib/handlers/Edge11.js index a35b9f53..d5e2a8b5 100644 --- a/lib/handlers/Edge11.js +++ b/lib/handlers/Edge11.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/FakeHandler.js b/lib/handlers/FakeHandler.js index c6457a2a..ea8e2feb 100644 --- a/lib/handlers/FakeHandler.js +++ b/lib/handlers/FakeHandler.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/Firefox60.js b/lib/handlers/Firefox60.js index ff662fa4..4be59a86 100644 --- a/lib/handlers/Firefox60.js +++ b/lib/handlers/Firefox60.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/ReactNative.js b/lib/handlers/ReactNative.js index 96716ca0..b182f4b6 100644 --- a/lib/handlers/ReactNative.js +++ b/lib/handlers/ReactNative.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/Safari11.js b/lib/handlers/Safari11.js index 1e908dd5..5fd16886 100644 --- a/lib/handlers/Safari11.js +++ b/lib/handlers/Safari11.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/Safari12.js b/lib/handlers/Safari12.js index 1b03823e..a0a4f934 100644 --- a/lib/handlers/Safari12.js +++ b/lib/handlers/Safari12.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/ortc/edgeUtils.js b/lib/handlers/ortc/edgeUtils.js index c8a790b3..797e4fb9 100644 --- a/lib/handlers/ortc/edgeUtils.js +++ b/lib/handlers/ortc/edgeUtils.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/sdp/MediaSection.js b/lib/handlers/sdp/MediaSection.js index 54e4a20d..c59868fb 100644 --- a/lib/handlers/sdp/MediaSection.js +++ b/lib/handlers/sdp/MediaSection.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/sdp/RemoteSdp.js b/lib/handlers/sdp/RemoteSdp.js index 43465e83..2ed213c4 100644 --- a/lib/handlers/sdp/RemoteSdp.js +++ b/lib/handlers/sdp/RemoteSdp.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/handlers/sdp/commonUtils.js b/lib/handlers/sdp/commonUtils.js index 4eddcdbe..92e24c7a 100644 --- a/lib/handlers/sdp/commonUtils.js +++ b/lib/handlers/sdp/commonUtils.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/index.js b/lib/index.js index 7ba3a889..7e116449 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/ortc.js b/lib/ortc.js index bb03fe21..7c08e531 100644 --- a/lib/ortc.js +++ b/lib/ortc.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/lib/types.js b/lib/types.js index b6aa8ad3..fac9dc1a 100644 --- a/lib/types.js +++ b/lib/types.js @@ -1,11 +1,7 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/src/Consumer.ts b/src/Consumer.ts index 8195cb90..be781d47 100644 --- a/src/Consumer.ts +++ b/src/Consumer.ts @@ -12,9 +12,23 @@ export type ConsumerOptions = appData?: Record; } +export type ConsumerEvents = +{ + transportclose: []; + trackended: []; +} + +export type ConsumerObserverEvents = +{ + close: []; + pause: []; + resume: []; + trackended: []; +} + const logger = new Logger('Consumer'); -export class Consumer extends EnhancedEventEmitter +export class Consumer extends EnhancedEventEmitter { // Id. private readonly _id: string; @@ -35,7 +49,7 @@ export class Consumer extends EnhancedEventEmitter // App custom data. private readonly _appData: Record; // Observer instance. - protected readonly _observer = new EnhancedEventEmitter(); + protected readonly _observer = new EnhancedEventEmitter(); /** * @emits transportclose @@ -180,7 +194,7 @@ export class Consumer extends EnhancedEventEmitter * @emits resume * @emits trackended */ - get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter { return this._observer; } diff --git a/src/DataConsumer.ts b/src/DataConsumer.ts index 75863936..ae036472 100644 --- a/src/DataConsumer.ts +++ b/src/DataConsumer.ts @@ -12,9 +12,23 @@ export type DataConsumerOptions = appData?: Record; } +export type DataConsumerEvents = +{ + transportclose: []; + open: []; + error: [Error]; + close: []; + message: [string|Blob|ArrayBuffer]; +} + +export type DataConsumerObserverEvents = +{ + close: []; +} + const logger = new Logger('DataConsumer'); -export class DataConsumer extends EnhancedEventEmitter +export class DataConsumer extends EnhancedEventEmitter { // Id. private readonly _id: string; @@ -29,7 +43,7 @@ export class DataConsumer extends EnhancedEventEmitter // App custom data. private readonly _appData: Record; // Observer instance. - protected readonly _observer = new EnhancedEventEmitter(); + protected readonly _observer = new EnhancedEventEmitter(); /** * @emits transportclose @@ -163,7 +177,7 @@ export class DataConsumer extends EnhancedEventEmitter * * @emits close */ - get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter { return this._observer; } diff --git a/src/DataProducer.ts b/src/DataProducer.ts index eda160a8..fc71c9c4 100644 --- a/src/DataProducer.ts +++ b/src/DataProducer.ts @@ -13,9 +13,23 @@ export type DataProducerOptions = appData?: Record; } +export type DataProducerEvents = +{ + transportclose: []; + open: []; + error: [Error]; + close: []; + bufferedamountlow: []; +} + +export type DataProducerObserverEvents = +{ + close: []; +} + const logger = new Logger('DataProducer'); -export class DataProducer extends EnhancedEventEmitter +export class DataProducer extends EnhancedEventEmitter { // Id. private readonly _id: string; @@ -28,7 +42,7 @@ export class DataProducer extends EnhancedEventEmitter // App custom data. private readonly _appData: Record; // Observer instance. - protected readonly _observer = new EnhancedEventEmitter(); + protected readonly _observer = new EnhancedEventEmitter(); /** * @emits transportclose @@ -159,7 +173,7 @@ export class DataProducer extends EnhancedEventEmitter * * @emits close */ - get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter { return this._observer; } diff --git a/src/EnhancedEventEmitter.ts b/src/EnhancedEventEmitter.ts index 471105f2..a6114ce2 100644 --- a/src/EnhancedEventEmitter.ts +++ b/src/EnhancedEventEmitter.ts @@ -3,7 +3,11 @@ import { Logger } from './Logger'; const logger = new Logger('EnhancedEventEmitter'); -export class EnhancedEventEmitter extends EventEmitter +type Events = Record +type InternalEvents = Record<`@${string}`, any[]> + +export class EnhancedEventEmitter extends EventEmitter { constructor() { @@ -11,7 +15,7 @@ export class EnhancedEventEmitter extends EventEmitter this.setMaxListeners(Infinity); } - safeEmit(event: string, ...args: any[]): boolean + safeEmit(event: K, ...args: E[K]): boolean { const numListeners = this.listenerCount(event); @@ -29,7 +33,9 @@ export class EnhancedEventEmitter extends EventEmitter } } - async safeEmitAsPromise(event: string, ...args: any[]): Promise + async safeEmitAsPromise(event: K, ...args: + [] extends E[K] ? unknown[] : [E[K][0]]): + Promise { return new Promise((resolve, reject) => { @@ -47,4 +53,52 @@ export class EnhancedEventEmitter extends EventEmitter } }); } + + on(event: K, listener: (...args: E[K]) => void) + { + super.on(event, listener as (...args: any[]) => void); + + return this; + } + + off(event: K, listener: (...args: E[K]) => void) + { + super.off(event, listener as (...args: any[]) => void); + + return this; + } + + addListener(event: K, listener: (...args: E[K]) => void) + { + super.on(event, listener as (...args: any[]) => void); + + return this; + } + prependListener(event: K, listener: (...args: E[K]) => void) + { + super.prependListener(event, listener as (...args: any[]) => void); + + return this; + } + + once(event: K, listener: (...args: E[K]) => void) + { + super.once(event, listener as (...args: any[]) => void); + + return this; + } + prependOnceListener(event: K, + listener: (...args: E[K]) => void) + { + super.prependOnceListener(event, listener as (...args: any[]) => void); + + return this; + } + + removeListener(event: K, listener: (...args: E[K]) => void) + { + super.off(event, listener as (...args: any[]) => void); + + return this; + } } diff --git a/src/Producer.ts b/src/Producer.ts index 2f0733f0..c187e7e0 100644 --- a/src/Producer.ts +++ b/src/Producer.ts @@ -34,9 +34,23 @@ export type ProducerCodecOptions = videoGoogleMinBitrate?: number; } +export type ProducerEvents = +{ + transportclose: []; + trackended: []; +} + +export type ProducerObserverEvents = +{ + close: []; + pause: []; + resume: []; + trackended: []; +} + const logger = new Logger('Producer'); -export class Producer extends EnhancedEventEmitter +export class Producer extends EnhancedEventEmitter { // Id. private readonly _id: string; @@ -65,7 +79,7 @@ export class Producer extends EnhancedEventEmitter // App custom data. private readonly _appData: Record; // Observer instance. - protected readonly _observer = new EnhancedEventEmitter(); + protected readonly _observer = new EnhancedEventEmitter(); /** * @emits transportclose @@ -224,7 +238,7 @@ export class Producer extends EnhancedEventEmitter * @emits resume * @emits trackended */ - get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter { return this._observer; } diff --git a/src/Transport.ts b/src/Transport.ts index e3719800..64af6cd1 100644 --- a/src/Transport.ts +++ b/src/Transport.ts @@ -9,7 +9,8 @@ import { Producer, ProducerOptions } from './Producer'; import { Consumer, ConsumerOptions } from './Consumer'; import { DataProducer, DataProducerOptions } from './DataProducer'; import { DataConsumer, DataConsumerOptions } from './DataConsumer'; -import { SctpParameters } from './SctpParameters'; +import { SctpParameters, SctpStreamParameters } from './SctpParameters'; +import { MediaKind, RtpParameters } from './RtpParameters'; interface InternalTransportOptions extends TransportOptions { @@ -148,9 +149,41 @@ export type PlainRtpParameters = port: number; }; +export type TransportProduceParameters = +{ + kind: MediaKind; + rtpParameters: RtpParameters; + appData: AppData; +} + +export type TransportProduceDataParameters = +{ + sctpStreamParameters: SctpStreamParameters; + label: string; + protocol: string; + appData: AppData; +} + +export type TransportEvents = +{ + connect: [{ dtlsParameters: DtlsParameters }, Function, Function]; + produce: [TransportProduceParameters, Function, Function]; + producedata: [TransportProduceDataParameters, Function, Function]; + connectionstatechange: [ConnectionState]; +} + +export type TransportObserverEvents = +{ + close: []; + newproducer: [Producer]; + newconsumer: [Consumer]; + newdataproducer: [DataProducer]; + newdataconsumer: [DataConsumer]; +} + const logger = new Logger('Transport'); -export class Transport extends EnhancedEventEmitter +export class Transport extends EnhancedEventEmitter { // Id. private readonly _id: string; @@ -196,7 +229,7 @@ export class Transport extends EnhancedEventEmitter // Consumer resume in progress flag. private _consumerResumeInProgress = false; // Observer instance. - protected readonly _observer = new EnhancedEventEmitter(); + protected readonly _observer = new EnhancedEventEmitter(); /** * @emits connect - (transportLocalParameters: any, callback: Function, errback: Function) @@ -330,7 +363,7 @@ export class Transport extends EnhancedEventEmitter * @emits newdataproducer - (dataProducer: DataProducer) * @emits newdataconsumer - (dataProducer: DataProducer) */ - get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter { return this._observer; } @@ -533,7 +566,7 @@ export class Transport extends EnhancedEventEmitter const { id } = await this.safeEmitAsPromise( 'produce', { - kind : track.kind, + kind : track.kind as MediaKind, rtpParameters, appData });