From 638587f5a3475744f6463d7794de3d88cff257e8 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Sun, 14 Aug 2022 17:20:33 -0500 Subject: [PATCH] chore: define RoomConfig type --- src/react-app-env.d.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index 5f86bb0..def92d0 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -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