2022-07-20 05:59:16 +00:00
|
|
|
import DhtNode from "@hyperswarm/dht-relay";
|
2023-01-31 10:10:34 +00:00
|
|
|
import Hyperswarm from "hyperswarm";
|
2023-01-31 10:43:58 +00:00
|
|
|
import EventEmitter from "eventemitter2";
|
2023-01-31 10:10:34 +00:00
|
|
|
export default class HyperswarmWeb extends EventEmitter {
|
2022-07-20 05:59:16 +00:00
|
|
|
private _options;
|
2022-06-27 22:22:53 +00:00
|
|
|
private _relays;
|
2023-01-31 10:10:34 +00:00
|
|
|
private _activeRelay;
|
|
|
|
private _discovery;
|
2023-01-31 11:58:39 +00:00
|
|
|
private _queuedEmActions;
|
2023-02-01 13:15:36 +00:00
|
|
|
private _connectionMutex;
|
2023-01-31 10:10:34 +00:00
|
|
|
constructor(opts?: any);
|
2022-07-20 05:59:16 +00:00
|
|
|
ready(): Promise<void>;
|
2023-01-31 10:10:34 +00:00
|
|
|
private ensureConnection;
|
|
|
|
private isServerAvailable;
|
|
|
|
connect(pubkey: string, options?: {}): Promise<DhtNode>;
|
2022-06-27 22:22:53 +00:00
|
|
|
get relays(): string[];
|
2023-01-31 10:10:34 +00:00
|
|
|
addRelay(pubkey: string): Promise<void>;
|
2022-06-27 22:22:53 +00:00
|
|
|
removeRelay(pubkey: string): boolean;
|
|
|
|
clearRelays(): void;
|
2023-01-31 10:10:34 +00:00
|
|
|
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;
|
2023-01-31 11:58:39 +00:00
|
|
|
private _processOrQueueAction;
|
|
|
|
private _processQueuedActions;
|
2022-06-27 22:22:53 +00:00
|
|
|
}
|
|
|
|
//# sourceMappingURL=index.d.ts.map
|