From 4eb1d05b92acb60cb2bb948a5598938b605a5f50 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Sun, 14 Aug 2022 17:23:05 -0500 Subject: [PATCH] feat: genericize makeAction --- src/react-app-env.d.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index def92d0..cfadd2d 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -25,20 +25,18 @@ declare module 'trystero' { export type RoomConfig = BaseRoomConfig & (BitTorrentRoomConfig | FirebaseRoomConfig | IpfsRoomConfig) - export type PeerActionData = any - export interface Room { - makeAction: ( + makeAction: ( 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 ]