import { _ as prepareUtils, a as HumanizeErrorType, i as HumanizableError, m as SetPeerIdToSessionStorageType, s as IsConnectionFromRemoteType, t as GetPeerIdType } from "./common-DNqltYdj.js"; import EventEmitter from "eventemitter3"; import { Peer } from "peerjs"; declare namespace master_d_exports { export { PrepareMasterUtils, WrcMaster, WrcMasterEvents, prepare as default, prepareUtils }; } /** * The events a master emits. Typing them is what makes `on` and `off` tell you * the payload of the event you subscribed to; the pre-TypeScript declarations * exposed eventemitter3's untyped signatures instead. */ export interface WrcMasterEvents { "remote.connect": (payload: { id: string; }) => void; "remote.disconnect": (payload: { id: string; }) => void; data: (payload: { id: string; from: "remote"; }, data: unknown) => void; } export interface WrcMaster { sendTo(id: string, payload: unknown): void | Promise | null; sendAll(payload: unknown): void; on: EventEmitter["on"]; off: EventEmitter["off"]; } export interface PrepareMasterUtils { humanizeError: HumanizeErrorType; isConnectionFromRemote: IsConnectionFromRemoteType; getPeerId: GetPeerIdType; setPeerIdToSessionStorage: SetPeerIdToSessionStorageType; } export default function prepare({ humanizeError, isConnectionFromRemote, getPeerId, setPeerIdToSessionStorage }: PrepareMasterUtils): { humanizeError: (error: HumanizableError) => string; isConnectionFromRemote: (conn: { metadata?: unknown; }) => boolean; getPeerId: () => string | undefined; bindConnection(peer: Peer): Promise; }; //#endregion export { prepareUtils, master_d_exports as t }; //# sourceMappingURL=master.d.ts.map