Skip to content

Commit

Permalink
fix: add esdoc @type field and reformat some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Molnar authored and snormore committed Feb 15, 2022
1 parent 17c24b2 commit 7f1c135
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
27 changes: 19 additions & 8 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,25 @@ export type ListMessagesOptions = {
endTime?: Date
}

// Network startup options
type CreateOptions = {
// bootstrap node multiaddrs
/**
* Network startup options
*/
export type CreateOptions = {
/** List of multiaddrs for boot nodes */
bootstrapAddrs?: string[]
// Allow for specifying different envs later
env?: keyof NodesList
// how long should we wait for the initial peer connection
// to declare the startup as successful or failed
/**
* How long we should wait for the initial peer connection
* to declare the startup as successful or failed
*/
waitForPeersTimeoutMs?: number
}

// Client is the central hub of interaction with the network,
// most relevant functionality is accessed through methods on the Client.
/**
* Client class initiates connection to the XMTP network.
* Should be created with `await Client.create(options)`
*/
export default class Client {
waku: Waku
address: string
Expand All @@ -58,6 +64,9 @@ export default class Client {
this._conversations = new Conversations(this)
}

/**
* @type {Conversations}
*/
get conversations(): Conversations {
return this._conversations
}
Expand Down Expand Up @@ -109,7 +118,9 @@ export default class Client {
return recipientKeys.length > 0 ? recipientKeys[0] : undefined
}

// send a message to the wallet identified by @peerAddress
/**
* Send a message to the wallet identified by @peerAddress
*/
async sendMessage(peerAddress: string, msgString: string): Promise<void> {
let topics: string[]
let recipient = this.contacts.get(peerAddress)
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import {
PrivateKeyBundle,
} from '../src/crypto'
import Stream from './Stream'
import Client from './Client'
import Client, { CreateOptions, ListMessagesOptions } from './Client'
import { Conversation, Conversations } from './conversations'

export {
Client,
Conversation,
Conversations,
CreateOptions,
ListMessagesOptions,
Message,
PrivateKey,
PrivateKeyBundle,
Expand Down

0 comments on commit 7f1c135

Please sign in to comment.