forked from Shiloh/remnantchat
feat: genericize makeAction
This commit is contained in:
parent
638587f5a3
commit
4eb1d05b92
8
src/react-app-env.d.ts
vendored
8
src/react-app-env.d.ts
vendored
@ -25,20 +25,18 @@ declare module 'trystero' {
|
|||||||
export type RoomConfig = BaseRoomConfig &
|
export type RoomConfig = BaseRoomConfig &
|
||||||
(BitTorrentRoomConfig | FirebaseRoomConfig | IpfsRoomConfig)
|
(BitTorrentRoomConfig | FirebaseRoomConfig | IpfsRoomConfig)
|
||||||
|
|
||||||
export type PeerActionData = any
|
|
||||||
|
|
||||||
export interface Room {
|
export interface Room {
|
||||||
makeAction: (
|
makeAction: <T>(
|
||||||
namespace: string
|
namespace: string
|
||||||
) => [
|
) => [
|
||||||
(
|
(
|
||||||
data: PeerActionData,
|
data: T,
|
||||||
targetPeers?: string[],
|
targetPeers?: string[],
|
||||||
metadata?: Record,
|
metadata?: Record,
|
||||||
progress: (percent: number, peerId: string) => void
|
progress: (percent: number, peerId: string) => void
|
||||||
) => void,
|
) => void,
|
||||||
|
|
||||||
(data: PeerActionData, peerId: string, metadata?: Record) => void,
|
(data: T, peerId: string, metadata?: Record) => void,
|
||||||
|
|
||||||
(percent: number, peerId: string, metadata?: Record) => void
|
(percent: number, peerId: string, metadata?: Record) => void
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user