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#
-
↳
Channel
Table of contents#
Constructors#
Properties#
Accessors#
Methods#
Constructors#
constructor#
• new Channel(sbServer, key?, channelId?)
Parameters#
Name |
Type |
|---|---|
|
|
|
|
|
|
Overrides#
Properties#
#ChannelReadyFlag#
• Private #ChannelReadyFlag: boolean = false
#SB384ReadyFlag#
• Private #SB384ReadyFlag: boolean = false
Inherited from#
#api#
• Private #api: ChannelApi
#channelId#
• Private Optional #channelId: string
#exportable_privateKey#
• Private #exportable_privateKey: null | JsonWebKey = null
Inherited from#
#exportable_pubKey#
• Private #exportable_pubKey: null | JsonWebKey = null
Inherited from#
#keyPair#
• Private #keyPair: null | CryptoKeyPair = null
Inherited from#
#ownerChannelId#
• Private #ownerChannelId: null | string = null
Inherited from#
#privateKey#
• Private #privateKey: null | CryptoKey = null
Inherited from#
#sbServer#
• Private #sbServer: SBServer
admin#
• admin: boolean = false
adminData#
• Optional Abstract adminData: Dictionary<any>
channelReady#
• channelReady: Promise<Channel>
locked#
• Optional locked: boolean = false
motd#
• Optional motd: string = ''
owner#
• owner: boolean = false
ready#
• ready: Promise<Channel>
Param
server to join
Param
key to use to join (optional)
Param
(the :term:Channel Name) to find on that server (optional)
Overrides#
sb384Ready#
• sb384Ready: Promise<SB384>
Inherited from#
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
exportable_privateKey#
• get exportable_privateKey(): null | JsonWebKey
Returns#
null | JsonWebKey
Inherited from#
SB384.exportable_privateKey
exportable_pubKey#
• get exportable_pubKey(): null | JsonWebKey
Returns#
null | JsonWebKey
Inherited from#
SB384.exportable_pubKey
keyPair#
• get keyPair(): null | CryptoKeyPair
Returns#
null | CryptoKeyPair
Inherited from#
SB384.keyPair
keys#
• Abstract get keys(): ChannelKeys
Returns#
onMessage#
• Abstract set onMessage(f): void
Parameters#
Name |
Type |
|---|---|
|
|
Returns#
void
ownerChannelId#
• get ownerChannelId(): null | string
Returns#
null | string
Inherited from#
SB384.ownerChannelId
privateKey#
• get privateKey(): null | CryptoKey
Returns#
null | CryptoKey
Inherited from#
SB384.privateKey
readyFlag#
• get readyFlag(): boolean
Returns#
boolean
Overrides#
SB384.readyFlag
sbServer#
• get sbServer(): SBServer
Returns#
Methods#
#generateRoomHash#
▸ Private #generateRoomHash(channelBytes): Promise<string>
Parameters#
Name |
Type |
|---|---|
|
|
Returns#
Promise<string>
Inherited from#
#generateRoomId#
▸ Private #generateRoomId(x, y): Promise<string>
Parameters#
Name |
Type |
|---|---|
|
|
|
|
Returns#
Promise<string>
Inherited from#
send#
▸ Abstract send(m, messageType?): Promise<string>
Parameters#
Name |
Type |
|---|---|
|
|
|
|
Returns#
Promise<string>