UNPKG

@donation-alerts/api

Version:
40 lines (39 loc) 1.14 kB
import { __decorate } from "tslib"; import { DataObject, rawDataSymbol, ReadDocumentation } from '@donation-alerts/common'; /** * Represents a Donation Alerts Centrifugo private channel. * * @remarks * This class provides access to a private channel's data, including its name (`channel`) * and the token required to connect to this channel (`token`). */ let DonationAlertsCentrifugoChannel = class DonationAlertsCentrifugoChannel extends DataObject { /** * The private channel name. * * @example * `$alerts:donation_12345`. */ get channel() { return this[rawDataSymbol].channel; } /** * The Centrifugo connection token. * * @remarks * This token is required to establish a connection to the respective private channel. */ get token() { return this[rawDataSymbol].token; } toJSON() { return { channel: this.channel, token: this.token, }; } }; DonationAlertsCentrifugoChannel = __decorate([ ReadDocumentation('api') ], DonationAlertsCentrifugoChannel); export { DonationAlertsCentrifugoChannel };