import { DataConnection } from "peerjs"; export type Message = { conn?: DataConnection; id: string; data: Data; }; export type Reducer = (message: Message, state: State) => void; export interface Channel { id: string; state: State; send: (data: Data) => void; receive: (message: Message) => void; } type ChannelType = "stream" | "sync"; export type Channels = { receive: (message: Message) => void; greet: (conn: DataConnection) => void; useChannel: (id: string, type: ChannelType, reducer: Reducer) => Channel; }; export declare const useChannels: (connections: Map) => Channels; export {};