瀏覽代碼

feat(TS) Migrate SampleSdpStrings to TS

master
Naman Jain 3 月之前
父節點
當前提交
d0526517ce
沒有連結到貢獻者的電子郵件帳戶。
共有 4 個檔案被更改,包括 20 行新增21 行删除
  1. 1
    2
      modules/sdp/LocalSdpMunger.spec.js
  2. 1
    1
      modules/sdp/RtxModifier.spec.js
  3. 1
    1
      modules/sdp/SDPUtil.spec.js
  4. 17
    17
      modules/sdp/SampleSdpStrings.ts

+ 1
- 2
modules/sdp/LocalSdpMunger.spec.js 查看文件

@@ -1,10 +1,9 @@
1
-
2 1
 import * as transform from 'sdp-transform';
3 2
 
4 3
 import { MockPeerConnection } from '../RTC/MockClasses';
5 4
 
6 5
 import LocalSdpMunger from './LocalSdpMunger';
7
-import { default as SampleSdpStrings } from './SampleSdpStrings.js';
6
+import { default as SampleSdpStrings } from './SampleSdpStrings';
8 7
 
9 8
 /**
10 9
  * Returns the associated ssrc lines for a given media type.

+ 1
- 1
modules/sdp/RtxModifier.spec.js 查看文件

@@ -3,7 +3,7 @@ import * as transform from 'sdp-transform';
3 3
 
4 4
 import RtxModifier from './RtxModifier.js';
5 5
 import SDPUtil from './SDPUtil';
6
-import { default as SampleSdpStrings } from './SampleSdpStrings.js';
6
+import { default as SampleSdpStrings } from './SampleSdpStrings';
7 7
 
8 8
 /**
9 9
  * Returns the number of video ssrcs in the given sdp

+ 1
- 1
modules/sdp/SDPUtil.spec.js 查看文件

@@ -1,5 +1,5 @@
1 1
 import SDPUtil from './SDPUtil';
2
-import { default as SampleSdpStrings } from './SampleSdpStrings.js';
2
+import { default as SampleSdpStrings } from './SampleSdpStrings';
3 3
 
4 4
 describe('SDPUtil', () => {
5 5
     it('should parse an ice ufrag correctly', () => {

modules/sdp/SampleSdpStrings.js → modules/sdp/SampleSdpStrings.ts 查看文件

@@ -1,4 +1,4 @@
1
-/* eslint-disable max-len*/
1
+/* eslint-disable max-len */
2 2
 import * as transform from 'sdp-transform';
3 3
 
4 4
 // A generic sdp session block
@@ -571,66 +571,66 @@ const sdpFirefoxStr = baseSessionSdp + baseAudioMLineSdp + videoMlineFF;
571 571
 const sdpFirefoxP2pStr = baseSessionSdp + baseAudioMLineSdp + videoLineP2pFF;
572 572
 
573 573
 export default {
574
-    get simulcastSdpStr() {
574
+    get simulcastSdpStr(): string {
575 575
         return simulcastSdpStr;
576 576
     },
577 577
 
578
-    get simulcastDifferentSsrcSdpStr() {
578
+    get simulcastDifferentSsrcSdpStr(): string {
579 579
         return simulcastDifferentSsrcSdpStr;
580 580
     },
581 581
 
582
-    get simulcastSdp() {
582
+    get simulcastSdp(): transform.SessionDescription {
583 583
         return transform.parse(simulcastSdpStr);
584 584
     },
585 585
 
586
-    get simulcastNoRtxSdp() {
586
+    get simulcastNoRtxSdp(): transform.SessionDescription {
587 587
         return transform.parse(simulcastNoRtxSdpStr);
588 588
     },
589 589
 
590
-    get simulcastRtxSdp() {
590
+    get simulcastRtxSdp(): transform.SessionDescription {
591 591
         return transform.parse(simulcastRtxSdpStr);
592 592
     },
593 593
 
594
-    get simulcastRtxSdpReplacedTrack() {
594
+    get simulcastRtxSdpReplacedTrack(): transform.SessionDescription {
595 595
         return transform.parse(simulcastRtxSdpTrackReplaced);
596 596
     },
597 597
 
598
-    get plainVideoSdp() {
598
+    get plainVideoSdp(): transform.SessionDescription {
599 599
         return transform.parse(plainVideoSdpStr);
600 600
     },
601 601
 
602
-    get rtxVideoSdp() {
602
+    get rtxVideoSdp(): transform.SessionDescription {
603 603
         return transform.parse(rtxVideoSdpStr);
604 604
     },
605 605
 
606
-    get multiCodecVideoSdp() {
606
+    get multiCodecVideoSdp(): transform.SessionDescription {
607 607
         return transform.parse(multiCodecVideoSdpStr);
608 608
     },
609 609
 
610
-    get flexFecSdp() {
610
+    get flexFecSdp(): transform.SessionDescription {
611 611
         return transform.parse(flexFecSdpStr);
612 612
     },
613 613
 
614
-    get recvOnlySdpStr() {
614
+    get recvOnlySdpStr(): string {
615 615
         return recvOnlySdpStr;
616 616
     },
617 617
 
618
-    get recvOnlySdpStrChrome() {
618
+    get recvOnlySdpStrChrome(): string {
619 619
         return recvOnlySdpStrChrome;
620 620
     },
621 621
 
622
-    get recvOnlySdp() {
622
+    get recvOnlySdp(): transform.SessionDescription {
623 623
         return transform.parse(recvOnlySdpStr);
624 624
     },
625 625
 
626
-    get firefoxSdp() {
626
+    get firefoxSdp(): transform.SessionDescription {
627 627
         return transform.parse(sdpFirefoxStr);
628 628
     },
629 629
 
630
-    get firefoxP2pSdp() {
630
+    get firefoxP2pSdp(): transform.SessionDescription {
631 631
         return transform.parse(sdpFirefoxP2pStr);
632 632
     }
633 633
 
634 634
 };
635 635
 
636
-/* eslint-enable max-len*/
636
+/* eslint-enable max-len */

Loading…
取消
儲存