feat: genericize makeAction

This commit is contained in:
Jeremy Kahn 2022-08-14 17:23:05 -05:00
parent 638587f5a3
commit 4eb1d05b92

View File

@ -25,20 +25,18 @@ declare module 'trystero' {
export type RoomConfig = BaseRoomConfig &
(BitTorrentRoomConfig | FirebaseRoomConfig | IpfsRoomConfig)
export type PeerActionData = any
export interface Room {
makeAction: (
makeAction: <T>(
namespace: string
) => [
(
data: PeerActionData,
data: T,
targetPeers?: string[],
metadata?: Record,
progress: (percent: number, peerId: string) => void
) => void,
(data: PeerActionData, peerId: string, metadata?: Record) => void,
(data: T, peerId: string, metadata?: Record) => void,
(percent: number, peerId: string, metadata?: Record) => void
]