Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: convert enums to types #323

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ export interface ProxyServer {
password?: string;
}

export const enum RelayType {
TurnUdp = 'TurnUdp',
TurnTcp = 'TurnTcp',
TurnTls = 'TurnTls',
}
export type RelayType = 'TurnUdp' | 'TurnTcp' | 'TurnTls'

export interface IceServer {
hostname: string;
Expand Down Expand Up @@ -80,13 +76,7 @@ export interface RtcConfig {
}

// Lowercase to match the description type string from libdatachannel
export enum DescriptionType {
Unspec = 'unspec',
Offer = 'offer',
Answer = 'answer',
Pranswer = 'pranswer',
Rollback = 'rollback',
}
export type DescriptionType = 'unspec' | 'offer' | 'answer' | 'pranswer' | 'rollback'

export type RTCSdpType = 'answer' | 'offer' | 'pranswer' | 'rollback';

Expand Down Expand Up @@ -118,10 +108,4 @@ export interface SelectedCandidateInfo {
}

// Must be same as rtc enum class Direction
export const enum Direction {
SendOnly = 'SendOnly',
RecvOnly = 'RecvOnly',
SendRecv = 'SendRecv',
Inactive = 'Inactive',
Unknown = 'Unknown',
}
export type Direction = 'SendOnly' | 'RecvOnly' | 'SendRecv' | 'Inactive' | 'Unknown'
Loading