2022-07-20 06:13:07 +00:00
|
|
|
/// <reference types="node" />
|
|
|
|
import { Buffer } from "buffer";
|
2023-02-01 12:55:30 +00:00
|
|
|
import { Client } from "@lumeweb/libkernel-universal";
|
|
|
|
import { ErrTuple } from "@siaweb/libweb";
|
|
|
|
export declare class SwarmClient extends Client {
|
|
|
|
private useDefaultSwarm;
|
2022-08-03 16:29:53 +00:00
|
|
|
private id;
|
2023-02-01 12:55:30 +00:00
|
|
|
get swarm(): number | undefined;
|
2022-08-03 16:29:53 +00:00
|
|
|
constructor(useDefaultDht?: boolean);
|
2023-02-01 12:55:30 +00:00
|
|
|
connect(pubkey: string | Uint8Array): Promise<Socket>;
|
2023-02-01 13:47:57 +00:00
|
|
|
init(): Promise<ErrTuple>;
|
2022-07-20 06:13:07 +00:00
|
|
|
ready(): Promise<ErrTuple>;
|
2022-07-20 07:27:17 +00:00
|
|
|
addRelay(pubkey: string): Promise<void>;
|
2022-07-20 22:03:37 +00:00
|
|
|
removeRelay(pubkey: string): Promise<void>;
|
|
|
|
clearRelays(): Promise<void>;
|
2022-08-14 11:33:04 +00:00
|
|
|
getRelays(): Promise<string[]>;
|
2023-02-01 19:08:26 +00:00
|
|
|
join(topic: Buffer): Promise<void>;
|
2022-07-20 06:13:07 +00:00
|
|
|
}
|
2023-02-01 12:55:30 +00:00
|
|
|
export declare class Socket extends Client {
|
2022-07-20 06:13:07 +00:00
|
|
|
private id;
|
|
|
|
private eventUpdates;
|
|
|
|
constructor(id: number);
|
|
|
|
on(eventName: string, listener: (...args: any[]) => void): this;
|
|
|
|
off(type: string, listener: any): this;
|
|
|
|
write(message: string | Buffer): void;
|
2022-09-01 00:38:27 +00:00
|
|
|
end(): void;
|
2022-07-20 06:13:07 +00:00
|
|
|
private ensureEvent;
|
|
|
|
private trackEvent;
|
|
|
|
}
|
2023-02-01 12:55:30 +00:00
|
|
|
export declare const createClient: (...args: any) => SwarmClient;
|
2022-07-20 06:13:07 +00:00
|
|
|
//# sourceMappingURL=index.d.ts.map
|