declare abstract class Line { abstract toSdpLine(): string; } declare type BandwidthType = 'CT' | 'AS' | 'TIAS'; declare class BandwidthLine extends Line { bandwidthType: BandwidthType; bandwidth: number; private static BW_TYPE_REGEX; private static regex; constructor(bandwidthType: BandwidthType, bandwidth: number); static fromSdpLine(line: string): BandwidthLine | undefined; toSdpLine(): string; } declare class BundleGroupLine extends Line { mids: Array; private static regex; constructor(mids: Array); static fromSdpLine(line: string): BundleGroupLine | undefined; toSdpLine(): string; } declare class CandidateLine extends Line { foundation: string; componentId: number; transport: string; priority: number; connectionAddress: string; port: number; candidateType: string; relAddr?: string; relPort?: number; candidateExtensions?: string; private static ICE_CHARS; private static regex; constructor(foundation: string, componentId: number, transport: string, priority: number, connectionAddress: string, port: number, candidateType: string, relAddr?: string, relPort?: number, candidateExtensions?: string); static fromSdpLine(line: string): CandidateLine | undefined; toSdpLine(): string; } declare class ConnectionLine extends Line { netType: string; addrType: string; ipAddr: string; private static regex; constructor(netType: string, addrType: string, ipAddr: string); static fromSdpLine(line: string): ConnectionLine | undefined; toSdpLine(): string; } declare class ContentLine extends Line { values: Array; private static regex; constructor(values: Array); static fromSdpLine(line: string): ContentLine | undefined; toSdpLine(): string; } declare type MediaDirection = 'sendrecv' | 'sendonly' | 'recvonly' | 'inactive'; declare class DirectionLine extends Line { direction: MediaDirection; private static regex; constructor(direction: MediaDirection); static fromSdpLine(line: string): DirectionLine | undefined; toSdpLine(): string; } declare type ExtMapDirection = 'sendonly' | 'recvonly' | 'sendrecv' | 'inactive'; declare class ExtMapLine extends Line { id: number; direction?: 'sendonly' | 'recvonly' | 'sendrecv' | 'inactive'; uri: string; extensionAttributes?: string; private static EXTMAP_DIRECTION; private static regex; constructor(id: number, uri: string, direction?: ExtMapDirection, extensionAttributes?: string); static fromSdpLine(line: string): ExtMapLine | undefined; toSdpLine(): string; } declare class FingerprintLine extends Line { fingerprint: string; private static regex; constructor(fingerprint: string); static fromSdpLine(line: string): FingerprintLine | undefined; toSdpLine(): string; } declare class PayloadTypeRef { readonly value: number | '*'; constructor(value: number | '*'); matches(pt: number): boolean; isWildcard(): boolean; toString(): string; } declare function parseFmtpParams(fmtpParams: string): Map; declare class FmtpLine extends Line { payloadType: PayloadTypeRef; params: Map; private static regex; constructor(payloadType: PayloadTypeRef, params: Map); static fromSdpLine(line: string): FmtpLine | undefined; toSdpLine(): string; } declare class IceOptionsLine extends Line { options: Array; private static regex; constructor(options: Array); static fromSdpLine(line: string): IceOptionsLine | undefined; toSdpLine(): string; } declare class IcePwdLine extends Line { pwd: string; private static regex; constructor(pwd: string); static fromSdpLine(line: string): IcePwdLine | undefined; toSdpLine(): string; } declare class IceUfragLine extends Line { ufrag: string; private static regex; constructor(ufrag: string); static fromSdpLine(line: string): IceUfragLine | undefined; toSdpLine(): string; } declare class MaxMessageSizeLine extends Line { maxMessageSize: number; private static regex; constructor(maxMessageSize: number); static fromSdpLine(line: string): MaxMessageSizeLine | undefined; toSdpLine(): string; } declare type MediaType = 'audio' | 'video' | 'application'; declare class MediaLine extends Line { type: MediaType; port: number; protocol: string; formats: Array; private static MEDIA_TYPE; private static regex; constructor(type: MediaType, port: number, protocol: string, formats: Array); static fromSdpLine(line: string): MediaLine | undefined; toSdpLine(): string; } declare class MidLine extends Line { mid: string; private static regex; constructor(mid: string); static fromSdpLine(line: string): MidLine | undefined; toSdpLine(): string; } declare class OriginLine extends Line { username: string; sessionId: string; sessionVersion: number; netType: string; addrType: string; ipAddr: string; private static regex; constructor(username: string, sessionId: string, sessionVersion: number, netType: string, addrType: string, ipAddr: string); static fromSdpLine(line: string): OriginLine | undefined; toSdpLine(): string; } declare class RidLine extends Line { id: string; direction: 'send' | 'recv'; params?: string; private static RID_ID; private static RID_DIRECTION; private static regex; constructor(id: string, direction: 'send' | 'recv', params?: string); static fromSdpLine(line: string): RidLine | undefined; toSdpLine(): string; } declare class RtcpMuxLine extends Line { private static regex; static fromSdpLine(line: string): RtcpMuxLine | undefined; toSdpLine(): string; } declare class RtcpFbLine extends Line { payloadType: PayloadTypeRef; feedback: string; private static regex; constructor(payloadType: PayloadTypeRef, feedback: string); static fromSdpLine(line: string): RtcpFbLine | undefined; toSdpLine(): string; } declare class RtpMapLine extends Line { payloadType: PayloadTypeRef; encodingName: string; clockRate: number; encodingParams?: string; private static NON_SLASH_TOKEN; private static regex; constructor(payloadType: PayloadTypeRef, encodingName: string, clockRate: number, encodingParams?: string); static fromSdpLine(line: string): RtpMapLine | undefined; toSdpLine(): string; } declare class SctpPortLine extends Line { port: number; private static regex; constructor(port: number); static fromSdpLine(line: string): SctpPortLine | undefined; toSdpLine(): string; } declare class SessionInformationLine extends Line { info: string; private static regex; constructor(info: string); static fromSdpLine(line: string): SessionInformationLine | undefined; toSdpLine(): string; } declare class SessionNameLine extends Line { name: string; private static regex; constructor(name: string); static fromSdpLine(line: string): SessionNameLine | undefined; toSdpLine(): string; } declare type Setup = 'actpass' | 'active' | 'passive'; declare class SetupLine extends Line { setup: Setup; private static regex; constructor(setup: Setup); static fromSdpLine(line: string): SetupLine | undefined; toSdpLine(): string; } declare class SimulcastLayer { id: string; paused: boolean; constructor(id: string, paused: boolean); toString(): string; } declare class SimulcastLayerList { layers: Array>; addLayer(layer: SimulcastLayer): void; addLayerWithAlternatives(alternatives: Array): void; get length(): number; get(index: number): Array | undefined; static fromString(str: string): SimulcastLayerList; toString(): string; } declare class SimulcastLine extends Line { sendLayers: SimulcastLayerList; recvLayers: SimulcastLayerList; private static regex; constructor(sendLayers: SimulcastLayerList, recvLayers: SimulcastLayerList); static fromSdpLine(line: string): SimulcastLine | undefined; toSdpLine(): string; } declare class SsrcLine extends Line { ssrcId: number; attribute: string; attributeValue: string | undefined; attributeData: string | undefined; private static regex; constructor(ssrcId: number, attribute: string, attributeValue?: string | undefined, attributeData?: string | undefined); static fromSdpLine(line: string): SsrcLine | undefined; toSdpLine(): string; } declare type SsrcGroupSemantics = 'SIM' | 'FID' | 'FEC'; declare class SsrcGroupLine extends Line { semantics: SsrcGroupSemantics; ssrcs: number[]; private static regex; constructor(semantics: SsrcGroupSemantics, ssrcs: number[]); static fromSdpLine(line: string): SsrcGroupLine | undefined; toSdpLine(): string; } declare class TimingLine extends Line { startTime: number; stopTime: number; private static regex; constructor(startTime: number, stopTime: number); static fromSdpLine(line: string): TimingLine | undefined; toSdpLine(): string; } declare class VersionLine extends Line { version: number; private static regex; constructor(version: number); static fromSdpLine(line: string): VersionLine | undefined; toSdpLine(): string; } interface SdpBlock { addLine(line: Line): boolean; toLines(): Array; } declare class IceInfo implements SdpBlock { ufrag?: IceUfragLine; pwd?: IcePwdLine; options?: IceOptionsLine; candidates: Array; addLine(line: Line): boolean; toLines(): Array; } declare abstract class MediaDescription implements SdpBlock { type: MediaType; port: number; protocol: string; mid?: string; iceInfo: IceInfo; fingerprint?: string; setup?: Setup; bandwidth?: BandwidthLine; connection?: ConnectionLine; content?: ContentLine; otherLines: Array; constructor(type: MediaType, port: number, protocol: string); abstract toLines(): Array; findOtherLine T>(ty: U): T | undefined; addLine(line: Line): boolean; } declare class ApplicationMediaDescription extends MediaDescription { sctpPort?: number; maxMessageSize?: number; fmts: Array; constructor(mediaLine: MediaLine); toLines(): Array; addLine(line: Line): boolean; } declare class CodecInfo implements SdpBlock { pt: number; name?: string; clockRate?: number; encodingParams?: string; fmtParams: Map; feedback: Array; primaryCodecPt?: number; constructor(pt: number); addLine(line: Line): boolean; toLines(): Array; } declare class CodecStore { private codecs; private wildcardFeedback; get(pt: number): CodecInfo | undefined; set(pt: number, codec: CodecInfo): void; has(pt: number): boolean; delete(pt: number): void; forEach(cb: (codec: CodecInfo, pt: number, map: Map) => void): void; values(): IterableIterator; entries(): IterableIterator<[number, CodecInfo]>; payloadTypeExists(pt: PayloadTypeRef): boolean; addLine(line: RtpMapLine | FmtpLine | RtcpFbLine): void; getFeedback(pt: number): string[]; removeFeedback(feedback: string): void; toLines(): Line[]; } declare class AvMediaDescription extends MediaDescription { pts: Array; extMaps: Map; rids: Array; simulcast?: SimulcastLine; codecs: CodecStore; direction?: MediaDirection; rtcpMux: boolean; ssrcs: Array; ssrcGroups: Array; constructor(mediaLine: MediaLine); toLines(): Array; addLine(line: Line): boolean; getCodecByPt(pt: number): CodecInfo | undefined; removePt(pt: number): void; addExtension({ uri, direction, attributes, id, }: { uri: string; direction?: ExtMapDirection; attributes?: string; id?: number; }): void; } declare class SessionDescription implements SdpBlock { version?: VersionLine; origin?: OriginLine; sessionName?: SessionNameLine; information?: SessionInformationLine; connection?: ConnectionLine; timing?: TimingLine; bandwidth?: BandwidthLine; groups: Array; otherLines: Array; addLine(line: Line): boolean; toLines(): Array; } declare class Sdp { session: SessionDescription; media: Array; get avMedia(): AvMediaDescription[]; toString(): string; } declare type Parser = (line: string) => Line | undefined; declare type LineType = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'; declare class Grammar { parsers: Map; addParser(lineType: LineType, parser: Parser): void; getParsers(lineType: LineType): Parser[]; } declare class SdpGrammar extends Grammar { constructor(); } declare const DefaultSdpGrammar: SdpGrammar; declare function parseToModel(lines: Array): Sdp; declare function parseToLines(sdp: string, grammar: Grammar): Array; declare function parse(sdp: string, grammar?: Grammar): Sdp; declare function disableRtcpFbValue(sdpOrAv: Sdp | AvMediaDescription, rtcpFbValue: string): void; declare function disableRemb(sdpOrAv: Sdp | AvMediaDescription): void; declare function disableTwcc(sdpOrAv: Sdp | AvMediaDescription): void; declare function removeCodec(sdpOrAv: Sdp | AvMediaDescription, codecName: string): void; declare function retainCodecs(av: AvMediaDescription, predicate: (codecInfo: CodecInfo) => boolean): boolean; declare function retainCodecsByCodecName(av: AvMediaDescription, allowedCodecNames: Array): boolean; declare function retainCandidates(sdpOrMedia: Sdp | MediaDescription, predicate: (candidate: CandidateLine) => boolean): boolean; declare function retainCandidatesByTransportType(sdpOrMedia: Sdp | MediaDescription, allowedTransportTypes: Array): boolean; declare const NUM = "\\d+"; declare const SDP_TOKEN = "[!#$%&'*+\\-.^_`{|}~a-zA-Z0-9]+"; declare const ANY_NON_WS = "\\S+"; declare const SP = "\\s"; declare const WS = "\\w*"; declare const REST = ".+"; declare function hasCodec(codecName: string, mLine: AvMediaDescription): boolean; export { ANY_NON_WS, ApplicationMediaDescription, AvMediaDescription, BandwidthLine, BandwidthType, BundleGroupLine, CandidateLine, CodecInfo, CodecStore, ConnectionLine, ContentLine, DefaultSdpGrammar, DirectionLine, ExtMapDirection, ExtMapLine, FingerprintLine, FmtpLine, Grammar, IceInfo, IceOptionsLine, IcePwdLine, IceUfragLine, Line, MaxMessageSizeLine, MediaDescription, MediaDirection, MediaLine, MediaType, MidLine, NUM, OriginLine, PayloadTypeRef, REST, RidLine, RtcpFbLine, RtcpMuxLine, RtpMapLine, SDP_TOKEN, SP, SctpPortLine, Sdp, SdpBlock, SessionDescription, SessionInformationLine, SessionNameLine, Setup, SetupLine, SimulcastLayer, SimulcastLayerList, SimulcastLine, SsrcGroupLine, SsrcLine, TimingLine, VersionLine, WS, disableRemb, disableRtcpFbValue, disableTwcc, hasCodec, parse, parseFmtpParams, parseToLines, parseToModel, removeCodec, retainCandidates, retainCandidatesByTransportType, retainCodecs, retainCodecsByCodecName };