declare module "bittorrent-tracker" { import type { Duplex, WritableEvents } from "streamx"; export default class Client { constructor(options: { infoHash: Uint8Array; peerId: Uint8Array; announce: string[]; rtcConfig?: RTCConfiguration; getAnnounceOpts?: () => object; }); on( event: E, handler: TrackerClientEvents[E], ): void; start(): void; destroy(): void; } export type TrackerClientEvents = { update: (data: object) => void; peer: (peer: PeerConnection) => void; warning: (warning: unknown) => void; error: (error: unknown) => void; }; export type PeerEvents = { connect: () => void; } & WritableEvents; export type PeerConnection = Duplex & { id: string; idUtf8: string; initiator: boolean; on(event: E, handler: PeerEvents[E]): void; off(event: E, handler: PeerEvents[E]): void; send(data: string | ArrayBuffer): void; }; }