UNPKG

diffusion

Version:

Diffusion JavaScript client

53 lines (52 loc) 1.49 kB
"use strict"; /** * @module Conversation */ Object.defineProperty(exports, "__esModule", { value: true }); exports.ONEWAY_CID = exports.ConversationId = void 0; var Long = require("long"); /** * A conversation ID */ var ConversationId = /** @class */ (function () { /** * Construct the conversation ID with a value * * @param val the value of the conversation ID */ function ConversationId(val) { this.val = val; } /** * Create a new ConversationID from a string * * @param val a string representation of the ID * @return a new ConversationID */ ConversationId.fromString = function (val) { return new ConversationId(Long.fromString(val, false)); }; /** * Convert the conversation ID to a string * * @return the string representation of the ID */ ConversationId.prototype.toString = function () { return this.val.toString(10); }; /** * Check equality of the ConversationId with another. * * @param other another conversation ID * @return `true` if the two conversation ID contain the same value */ ConversationId.prototype.equals = function (other) { return other.val && this.val.equals(other.val); }; return ConversationId; }()); exports.ConversationId = ConversationId; /** * A special conversation ID for one-way conversations */ exports.ONEWAY_CID = new ConversationId(Long.fromNumber(0));