import type * as Ably from "ably"; import { type ChalkInstance } from "chalk"; export declare function formatProgress(message: string): string; export declare function formatSuccess(message: string): string; export declare function formatWarning(message: string): string; export declare function formatListening(description: string): string; export declare function formatResource(name: string): string; export declare function formatTimestamp(ts: string): string; /** * Format a message timestamp (from Ably message.timestamp) to ISO string. * Falls back to current time if timestamp is not provided. */ export declare function formatMessageTimestamp(timestamp: number | Date | undefined | null): string; /** * Format a count with a singular/plural label. * E.g. countLabel(3, "message") → "3 messages" (with cyan count) */ export declare function formatCountLabel(count: number, singular: string, plural?: string): string; /** * Show a limit warning when results may be truncated. * Returns null if count < limit. */ export declare function formatLimitWarning(count: number, limit: number, resourceName: string): string | null; /** Client identity display — cyan-blue for client IDs in event output */ export declare function formatClientId(id: string): string; /** Event type/action display — yellow for event type labels */ export declare function formatEventType(type: string): string; /** Field label display — dim text with colon for structured output fields */ export declare function formatLabel(text: string): string; /** Record heading — bold text for list item headings */ export declare function formatHeading(text: string): string; /** Index number display — dim bracketed number for history/list ordering */ export declare function formatIndex(n: number): string; /** Device push state display — green for ACTIVE, yellow for FAILING, red for FAILED */ export declare function formatDeviceState(state: string): string; export interface MessageDisplayFields { action?: string; channel: string; clientId?: string; data: unknown; event?: string; id?: string; indexPrefix?: string; sequencePrefix?: string; serial?: string; timestamp: number; version?: Ably.MessageVersion; annotations?: Ably.MessageAnnotations; } export declare function formatMessagesOutput(messages: MessageDisplayFields[]): string; export interface PresenceDisplayFields { id?: string; timestamp: number; action: string; channel: string; clientId?: string; connectionId?: string; data?: unknown; } export declare function formatPresenceOutput(messages: PresenceDisplayFields[]): string; export interface AnnotationDisplayFields { id?: string; timestamp: number; channel: string; type: string; action?: string; name?: string; clientId?: string; count?: number; serial?: string; data?: unknown; encoding?: string; messageSerial?: string; extras?: unknown; indexPrefix?: string; } export declare function formatAnnotationsOutput(annotations: AnnotationDisplayFields[]): string; export declare enum JsonRecordType { Error = "error", Event = "event", Log = "log", Result = "result", Status = "status" } /** * Build a typed JSON envelope record. * - "result" and "error" types include `success: boolean` * - "event" and "log" types include only `type` and `command` * - Data fields are spread into the record. For "result" types, data can * override `success` (e.g. partial-success batch results). For "error" * types, `success` is always `false` and cannot be overridden by data. */ export declare function buildJsonRecord(type: JsonRecordType, command: string, data: Record): Record; /** * Format a JSON record as a string. Compact single-line for `json` mode * (NDJSON-friendly), pretty-printed for `prettyJson` mode. */ export declare function formatJsonString(data: Record, options: { json?: boolean; prettyJson?: boolean; }): string; export declare function formatPresenceAction(action: string): { symbol: string; color: ChalkInstance; };