Global

Members

contentType

Get the MIME type of the card.
Source:

size

Get the size of the card in bytes when serialized as JSON.
Source:

Methods

checkTagUniqueness(tag, caller) → {Promise}

Check if the given tag is unique by asking the server.
Source:
Parameters:
Name Type Description
tag string tag to check.
caller string identifier of the caller.
Returns:
Type:
Promise
promise to be resolved with true if the tag is unique, false otherwise.

deleteDatabase()

Delete persistent cache.
Source:

initDatabase() → {Promise}

Initialize persistent cache: open or create/upgrade if needed.
Source:
Returns:
Type:
Promise
promise to be resolved/rejected when the DB is initialized.

isChannelTopicName(name) → {boolean}

Check if the topic name is a name of a channel.
Source:
Parameters:
Name Type Description
name string topic name to check.
Returns:
Type:
boolean
true if the name is a name of a channel, false otherwise.

isCommTopicName(name) → {boolean}

Check if the given topic name is a name of a communication topic, i.e. P2P or group.
Source:
Parameters:
Name Type Description
name string Name of the topic to test.
Returns:
Type:
boolean
true if the name is a name of a p2p or group topic, false otherwise.

isEmpty() → {boolean}

Check if buffer is empty.
Source:
Returns:
Type:
boolean
true if the buffer is empty, false otherwise.

isGroupTopicName(name) → {boolean}

Check if the given topic name is a name of a group topic.
Source:
Parameters:
Name Type Description
name string Name of the topic to test.
Returns:
Type:
boolean
true if the name is a name of a group topic, false otherwise.

isMeTopicName(name) → {boolean}

Check if the given topic name is a name of a 'me' topic.
Source:
Parameters:
Name Type Description
name string Name of the topic to test.
Returns:
Type:
boolean
true if the name is a name of a 'me' topic, false otherwise.

isNewGroupTopicName(name) → {boolean}

Check if the topic name is a name of a new topic.
Source:
Parameters:
Name Type Description
name string topic name to check.
Returns:
Type:
boolean
true if the name is a name of a new topic, false otherwise.

isP2PTopicName(name) → {boolean}

Check if the given topic name is a name of a p2p topic.
Source:
Parameters:
Name Type Description
name string Name of the topic to test.
Returns:
Type:
boolean
true if the name is a name of a p2p topic, false otherwise.

isSelfTopicName(name) → {boolean}

Check if the given topic name is a name of a 'slf' topic.
Source:
Parameters:
Name Type Description
name string Name of the topic to test.
Returns:
Type:
boolean
true if the name is a name of a 'slf' topic, false otherwise.

isSubscribed() → {boolean}

Check if the topic is subscribed.
Source:
Returns:
Type:
boolean
True is topic is attached/subscribed, false otherwise.

jsonHelper()

Converts numeric values to strings.
Source:

maxDelId(topicName) → {Promise}

Retrieve the latest 'clear' ID for the given topic.
Source:
Parameters:
Name Type Description
topicName string
Returns:
Type:
Promise
promise resolved/rejected on operation completion.

merge(that)

Merge another card into this one.
Source:
Parameters:
Name Type Description
that Object Card object to merge.

subscribe(getParamsopt, setParamsopt) → {Promise}

Request topic to subscribe. Wrapper for Tinode#subscribe.
Source:
Parameters:
Name Type Attributes Description
getParams Tinode.GetQuery <optional>
get query parameters.
setParams Tinode.SetParams <optional>
set parameters.
Returns:
Type:
Promise
Promise to be resolved/rejected when the server responds to the request.

topicType(name) → {string}

Determine topic type from topic's name: grp, p2p, me, fnd, sys.
Source:
Parameters:
Name Type Description
name string Name of the topic to test.
Returns:
Type:
string
One of "me", "fnd", "sys", "grp", "p2p" or undefined.

toString()

Custom formatter
Source:

Type Definitions

contactFilter(contact) → {boolean}

Source:
Parameters:
Name Type Description
contact Object contact to check for inclusion.
Returns:
Type:
boolean
true if contact should be processed, false to exclude it.

onData(data)

Source:
Parameters:
Name Type Description
data Data Data packet