From 7b6ead14ac73ac83c3b5c9a94f7e8f6c5529b681 Mon Sep 17 00:00:00 2001 From: Danish Arora <35004822+danisharora099@users.noreply.github.com> Date: Wed, 16 Aug 2023 16:11:27 +0530 Subject: [PATCH] update: tsdoc (#1476) --- packages/interfaces/src/relay.ts | 7 +++++++ packages/utils/src/common/to_async_iterator.ts | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/packages/interfaces/src/relay.ts b/packages/interfaces/src/relay.ts index 5683b13b44..71c3b9b9c1 100644 --- a/packages/interfaces/src/relay.ts +++ b/packages/interfaces/src/relay.ts @@ -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; diff --git a/packages/utils/src/common/to_async_iterator.ts b/packages/utils/src/common/to_async_iterator.ts index 77d9c60c27..cc6241673b 100644 --- a/packages/utils/src/common/to_async_iterator.ts +++ b/packages/utils/src/common/to_async_iterator.ts @@ -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;