update: tsdoc (#1476)

This commit is contained in:
Danish Arora 2023-08-16 16:11:27 +05:30 committed by GitHub
parent 5ad0210477
commit 7b6ead14ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -4,6 +4,13 @@ import type { PeerIdStr, TopicStr } from "@chainsafe/libp2p-gossipsub/types";
import { IReceiver } from "./receiver.js";
import type { ISender } from "./sender.js";
/**
* Interface representing the Relay API, providing control and information about the GossipSub protocol.
*
* @property gossipSub - The GossipSub instance used for managing pub/sub behavior.
* @property start - Function to start the relay, returning a Promise that resolves when initialization is complete.
* @property getMeshPeers - Function to retrieve the mesh peers for a given topic or all topics if none is specified. Returns an array of peer IDs as strings.
*/
interface IRelayAPI {
readonly gossipSub: GossipSub;
start: () => Promise<void>;

View File

@ -7,6 +7,12 @@ import type {
Unsubscribe,
} from "@waku/interfaces";
/**
* Options for configuring the behavior of an iterator.
*
* @property timeoutMs - Optional timeout in milliseconds. If specified, the iterator will terminate after this time period.
* @property iteratorDelay - Optional delay in milliseconds between each iteration. Can be used to control the rate of iteration.
*/
type IteratorOptions = {
timeoutMs?: number;
iteratorDelay?: number;