chore: define RoomConfig type

This commit is contained in:
Jeremy Kahn 2022-08-14 17:20:33 -05:00
parent a86e2d6592
commit 638587f5a3

View File

@ -2,7 +2,28 @@
// TODO: Contribute this to DefinitelyTyped
declare module 'trystero' {
export interface RoomConfig {}
interface BitTorrentRoomConfig {
trackerUrls?: string[]
trackerRedundancy?: number
}
interface FirebaseRoomConfig {
firebaseApp?: string
rootPath?: string
}
interface IpfsRoomConfig {
swarmAddresses?: string
}
export interface BaseRoomConfig {
appId: string
password?: string
rtcConfig?: RTCConfiguration
}
export type RoomConfig = BaseRoomConfig &
(BitTorrentRoomConfig | FirebaseRoomConfig | IpfsRoomConfig)
export type PeerActionData = any