hyperswarm-web/dist/index.d.ts

25 lines
1.1 KiB
TypeScript

import DhtNode from "@hyperswarm/dht-relay";
import Hyperswarm from "hyperswarm";
import EventEmitter from "eventemitter2";
export default class HyperswarmWeb extends EventEmitter {
private _options;
private _relays;
private _activeRelay;
private _discovery;
constructor(opts?: any);
ready(): Promise<void>;
private ensureConnection;
private isServerAvailable;
connect(pubkey: string, options?: {}): Promise<DhtNode>;
get relays(): string[];
addRelay(pubkey: string): Promise<void>;
removeRelay(pubkey: string): boolean;
clearRelays(): void;
on(eventName: string | symbol, listener: (...args: any[]) => void): Hyperswarm;
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
off(eventName: string | symbol, listener: (...args: any[]) => void): Hyperswarm;
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
emit(eventName: string | symbol, ...args: any[]): boolean;
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
}
//# sourceMappingURL=index.d.ts.map