import { TOPIC, STATE_REGISTRY_TOPIC, MONITORING_ACTION, STATE_ACTION, CONNECTION_ACTION, AUTH_ACTION, EVENT_ACTION, RPC_ACTION, PRESENCE_ACTION, RECORD_ACTION, LOCK_ACTION, CLUSTER_ACTION, RecordData, RPCResult, EventData, AuthData, PARSER_ACTION } from './all'; export type ALL_ACTIONS = MONITORING_ACTION | STATE_ACTION | CLUSTER_ACTION | LOCK_ACTION | RPC_ACTION | EVENT_ACTION | RECORD_ACTION | PRESENCE_ACTION | CONNECTION_ACTION | AUTH_ACTION | PARSER_ACTION; export declare const ACTIONS: { [index: number]: any; }; export interface Message { topic: TOPIC | STATE_REGISTRY_TOPIC; action: ALL_ACTIONS; name?: string; isError?: boolean; isAck?: boolean; data?: string | Buffer; parsedData?: RecordData | RPCResult | EventData | AuthData; parseError?: false; subscription?: string; originalTopic?: TOPIC | STATE_REGISTRY_TOPIC; originalAction?: ALL_ACTIONS; names?: Array; reason?: string; url?: string; protocolVersion?: string; sdkVersion?: string; sdkType?: string; isWriteAck?: boolean; correlationId?: string; path?: string; version?: number; versions?: { [index: string]: number; }; checksum?: number; fullState?: Array; serverName?: string; registryTopic?: TOPIC; leaderScore?: number; role?: string; locked?: boolean; } export interface StateMessage extends Message { topic: TOPIC.STATE_REGISTRY; registryTopic: TOPIC; } export interface BulkSubscriptionMessage extends Message { names: Array; correlationId: string; } export interface SubscriptionMessage extends Message { name: string; } export interface EventMessage extends SubscriptionMessage { topic: TOPIC.EVENT; action: EVENT_ACTION; } export interface RPCMessage extends SubscriptionMessage { topic: TOPIC.RPC; action: RPC_ACTION; correlationId: string; requestorName?: string; requestorData?: string; } export interface PresenceMessage extends Message { topic: TOPIC.PRESENCE; action: PRESENCE_ACTION; correlationId: string; } export interface ListenMessage extends SubscriptionMessage { topic: TOPIC.RECORD | TOPIC.EVENT; action: RECORD_ACTION | EVENT_ACTION; subscription: string; raw?: string; } export interface RecordMessage extends SubscriptionMessage { topic: TOPIC.RECORD; action: RECORD_ACTION; } export interface RecordWriteMessage extends RecordMessage { topic: TOPIC.RECORD; version: number; isWriteAck: boolean; path?: string; name: string; } export interface RecordAckMessage extends RecordMessage { topic: TOPIC.RECORD; path?: string; data: any; } export interface MonitoringMessage extends Message { topic: TOPIC.MONITORING; } export interface LockMessage extends Message { topic: TOPIC.LOCK; action: LOCK_ACTION; name: string; locked: boolean; } export interface ClusterMessage extends Message { topic: TOPIC.CLUSTER; action: CLUSTER_ACTION; serverName: string; } export interface ParseError { parseError: boolean; action: PRESENCE_ACTION; parsedMessage: Message; raw?: Buffer; description?: string; } export type ParseResult = Message | ParseError;