import { CommunicationEventType , Uuid } from ".." ; /**
 * Base generic communication event class
 */ export abstract class CommunicationEvent < T extends CommunicationEventData > { private static readonly EVENT_FILTER_REGEX = new RegExp ( /^[^\u0000+#/]+$/ ) ; internal abstract get eventType ( ) : CommunicationEventType ; internal get eventTypeFilter ( ) : string { return undefined ; } internal get responseEventType ( ) : CommunicationEventType { return undefined ; } internal eventRequest : CommunicationEvent < CommunicationEventData > = undefined ; private _eventSourceId : Uuid ; internal param eventData constructor ( private _eventData ) { } param name returns static isValidEventFilter ( name ) { return typeof name === "string" && CommunicationEvent . EVENT_FILTER_REGEX . test ( name ) ; } /**
     * Gets the object ID of the event source object.
     */ get sourceId ( ) { return this . _eventSourceId ; } internal set sourceId ( sourceId ) { this . _eventSourceId = sourceId ; } /**
     * Gets the event data of this event.
     */ get data ( ) { return this . _eventData ; } } /**
 * The base class for communication event data
 */ export abstract class CommunicationEventData { internal abstract toJsonObject ( ) ; } /**
 * Represents communication events that are topic-based and provide data in raw,
 * i.e. non-JSON format.
 */ export abstract class TopicEvent < T extends TopicEventData > extends CommunicationEvent < T > { get eventTypeFilter ( ) { return this . topic ; } /**
     * Publication topic for this topic-based event.
     */ topic : string ; /**
     * Binding-specific publication options.
     */ readonly options : { [ key ] : any ; } ; internal param topic param eventData param options constructor ( topic , eventData , options ? ) { super ( eventData ) ; this . topic = topic ; this . options = options ; } } /**
 * Represents communication event data for topic-based events.
 */ export abstract class TopicEventData extends CommunicationEventData { /**
     * Raw data string or Uint8Array (or Buffer in Node.js, a subclass thereof).
     *
     * For inbound events raw data is always of type `Uint8Array` (or Buffer in
     * Node.js, a subclass thereof). For publication events, data may also be a
     * string.
     */ payload : string | Uint8Array ; }