JSLib Reference Manual / Exports / Channel

Class: Channel#

Channel Class

Join a channel, returns channel object.

Currently, you must have an identity when connecting, because every single message is signed by sender. TODO is to look at how to provide a ‘listening’ mode on channels.

Most classes in SB follow the “ready” template: objects can be used right away, but they decide for themselves if they’re ready or not.

Hierarchy#

Table of contents#

Constructors#

Properties#

Accessors#

Methods#

Constructors#

constructor#

new Channel(sbServer, key?, channelId?)

Parameters#

Name

Type

sbServer

SBServer

key?

JsonWebKey

channelId?

string

Overrides#

SB384.constructor

Properties#

admin#

admin: boolean = false


adminData#

Optional Abstract adminData: Dictionary<any>


channelReady#

channelReady: Promise<Channel>

Param

server to join

Param

key to use to join (optional)

Param

the Channel Name to find on that server (optional)


locked#

Optional locked: boolean = false


motd#

Optional motd: string = ''


owner#

owner: boolean = false


ready#

ready: Promise<SB384>

Inherited from#

SB384.ready


sb384Ready#

sb384Ready: Promise<SB384>

Inherited from#

SB384.sb384Ready


userName#

userName: string = ''


verifiedGuest#

verifiedGuest: boolean = false

Accessors#

_id#

get _id(): string

Returns#

string

Inherited from#

SB384._id


api#

get api(): ChannelApi

Returns#

ChannelApi


channelId#

get channelId(): undefined | string

Returns#

undefined | string


channelSignKey#

get channelSignKey(): CryptoKey

Returns#

CryptoKey


exportable_privateKey#

get exportable_privateKey(): JsonWebKey

Returns#

JsonWebKey

Inherited from#

SB384.exportable_privateKey


exportable_pubKey#

get exportable_pubKey(): JsonWebKey

Returns#

JsonWebKey

Inherited from#

SB384.exportable_pubKey


keys#

get keys(): ChannelKeys

Returns#

ChannelKeys


ownerChannelId#

get ownerChannelId(): string

Returns#

string

Inherited from#

SB384.ownerChannelId


privateKey#

get privateKey(): CryptoKey

Returns#

CryptoKey

Inherited from#

SB384.privateKey


readyFlag#

get readyFlag(): boolean

Returns#

boolean

Overrides#

SB384.readyFlag


sbServer#

get sbServer(): SBServer

Returns#

SBServer

Methods#

send#

Abstract send(m, messageType?): Promise<string>

Parameters#

Name

Type

m

string | SBMessage

messageType?

"string" | "SBMessage"

Returns#

Promise<string>