import { z } from 'zod'; export declare enum WSMessageType { CONNECT = "connect", DISCONNECT = "disconnect", PING = "ping", PONG = "pong", AUTH = "auth", AUTH_SUCCESS = "auth_success", AUTH_ERROR = "auth_error", REQUEST = "request", RESPONSE = "response", EVENT = "event", ERROR = "error", SUBSCRIBE = "subscribe", UNSUBSCRIBE = "unsubscribe", SUBSCRIPTION_UPDATE = "subscription_update" } export declare const wsBaseMessageSchema: z.ZodObject<{ type: z.ZodNativeEnum; id: z.ZodOptional; timestamp: z.ZodDefault; }, "strip", z.ZodTypeAny, { type: WSMessageType; timestamp: string; id?: string | undefined; }, { type: WSMessageType; id?: string | undefined; timestamp?: string | undefined; }>; export declare const wsAuthMessageSchema: z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodLiteral; data: z.ZodObject<{ token: z.ZodString; apiKey: z.ZodOptional; }, "strip", z.ZodTypeAny, { token: string; apiKey?: string | undefined; }, { token: string; apiKey?: string | undefined; }>; }, "strip", z.ZodTypeAny, { type: WSMessageType.AUTH; timestamp: string; data: { token: string; apiKey?: string | undefined; }; id?: string | undefined; }, { type: WSMessageType.AUTH; data: { token: string; apiKey?: string | undefined; }; id?: string | undefined; timestamp?: string | undefined; }>; export declare const wsAuthSuccessMessageSchema: z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodLiteral; data: z.ZodObject<{ userId: z.ZodOptional; sessionId: z.ZodOptional; roles: z.ZodOptional>; permissions: z.ZodOptional>; scopes: z.ZodOptional>; }, "strip", z.ZodTypeAny, { userId?: string | undefined; roles?: string[] | undefined; sessionId?: string | undefined; permissions?: string[] | undefined; scopes?: string[] | undefined; }, { userId?: string | undefined; roles?: string[] | undefined; sessionId?: string | undefined; permissions?: string[] | undefined; scopes?: string[] | undefined; }>; }, "strip", z.ZodTypeAny, { type: WSMessageType.AUTH_SUCCESS; timestamp: string; data: { userId?: string | undefined; roles?: string[] | undefined; sessionId?: string | undefined; permissions?: string[] | undefined; scopes?: string[] | undefined; }; id?: string | undefined; }, { type: WSMessageType.AUTH_SUCCESS; data: { userId?: string | undefined; roles?: string[] | undefined; sessionId?: string | undefined; permissions?: string[] | undefined; scopes?: string[] | undefined; }; id?: string | undefined; timestamp?: string | undefined; }>; export declare const wsAuthErrorMessageSchema: z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodLiteral; error: z.ZodOptional; }, "strip", z.ZodTypeAny, { code: string; message: string; details?: unknown; }, { code: string; message: string; details?: unknown; }>>; }, "strip", z.ZodTypeAny, { type: WSMessageType.AUTH_ERROR; timestamp: string; error?: { code: string; message: string; details?: unknown; } | undefined; id?: string | undefined; }, { type: WSMessageType.AUTH_ERROR; error?: { code: string; message: string; details?: unknown; } | undefined; id?: string | undefined; timestamp?: string | undefined; }>; export declare const wsRequestMessageSchema: z.ZodObject<{ timestamp: z.ZodDefault; } & { type: z.ZodLiteral; id: z.ZodString; method: z.ZodString; path: z.ZodString; data: z.ZodOptional; headers: z.ZodOptional>; }, "strip", z.ZodTypeAny, { path: string; type: WSMessageType.REQUEST; id: string; method: string; timestamp: string; headers?: Record | undefined; data?: unknown; }, { path: string; type: WSMessageType.REQUEST; id: string; method: string; headers?: Record | undefined; timestamp?: string | undefined; data?: unknown; }>; export declare const wsResponseMessageSchema: z.ZodObject<{ timestamp: z.ZodDefault; } & { type: z.ZodLiteral; id: z.ZodString; status: z.ZodNumber; data: z.ZodOptional; error: z.ZodOptional; }, "strip", z.ZodTypeAny, { code: string; message: string; details?: unknown; }, { code: string; message: string; details?: unknown; }>>; }, "strip", z.ZodTypeAny, { type: WSMessageType.RESPONSE; status: number; id: string; timestamp: string; error?: { code: string; message: string; details?: unknown; } | undefined; data?: unknown; }, { type: WSMessageType.RESPONSE; status: number; id: string; error?: { code: string; message: string; details?: unknown; } | undefined; timestamp?: string | undefined; data?: unknown; }>; export declare const wsEventMessageSchema: z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodLiteral; event: z.ZodString; data: z.ZodUnknown; }, "strip", z.ZodTypeAny, { type: WSMessageType.EVENT; timestamp: string; event: string; id?: string | undefined; data?: unknown; }, { type: WSMessageType.EVENT; event: string; id?: string | undefined; timestamp?: string | undefined; data?: unknown; }>; export declare const wsErrorMessageSchema: z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodLiteral; error: z.ZodObject<{ code: z.ZodString; message: z.ZodString; details: z.ZodOptional; }, "strip", z.ZodTypeAny, { code: string; message: string; details?: unknown; }, { code: string; message: string; details?: unknown; }>; }, "strip", z.ZodTypeAny, { type: WSMessageType.ERROR; error: { code: string; message: string; details?: unknown; }; timestamp: string; id?: string | undefined; }, { type: WSMessageType.ERROR; error: { code: string; message: string; details?: unknown; }; id?: string | undefined; timestamp?: string | undefined; }>; export declare const wsSubscriptionMessageSchema: z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodEnum<[WSMessageType.SUBSCRIBE, WSMessageType.UNSUBSCRIBE]>; topic: z.ZodString; filters: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: WSMessageType.SUBSCRIBE | WSMessageType.UNSUBSCRIBE; timestamp: string; topic: string; id?: string | undefined; filters?: Record | undefined; }, { type: WSMessageType.SUBSCRIBE | WSMessageType.UNSUBSCRIBE; topic: string; id?: string | undefined; timestamp?: string | undefined; filters?: Record | undefined; }>; export declare const wsSubscriptionUpdateSchema: z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodLiteral; topic: z.ZodString; data: z.ZodUnknown; }, "strip", z.ZodTypeAny, { type: WSMessageType.SUBSCRIPTION_UPDATE; timestamp: string; topic: string; id?: string | undefined; data?: unknown; }, { type: WSMessageType.SUBSCRIPTION_UPDATE; topic: string; id?: string | undefined; timestamp?: string | undefined; data?: unknown; }>; export declare const wsPingPongMessageSchema: z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodEnum<[WSMessageType.PING, WSMessageType.PONG]>; }, "strip", z.ZodTypeAny, { type: WSMessageType.PING | WSMessageType.PONG; timestamp: string; id?: string | undefined; }, { type: WSMessageType.PING | WSMessageType.PONG; id?: string | undefined; timestamp?: string | undefined; }>; export declare const wsMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodLiteral; data: z.ZodObject<{ token: z.ZodString; apiKey: z.ZodOptional; }, "strip", z.ZodTypeAny, { token: string; apiKey?: string | undefined; }, { token: string; apiKey?: string | undefined; }>; }, "strip", z.ZodTypeAny, { type: WSMessageType.AUTH; timestamp: string; data: { token: string; apiKey?: string | undefined; }; id?: string | undefined; }, { type: WSMessageType.AUTH; data: { token: string; apiKey?: string | undefined; }; id?: string | undefined; timestamp?: string | undefined; }>, z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodLiteral; data: z.ZodObject<{ userId: z.ZodOptional; sessionId: z.ZodOptional; roles: z.ZodOptional>; permissions: z.ZodOptional>; scopes: z.ZodOptional>; }, "strip", z.ZodTypeAny, { userId?: string | undefined; roles?: string[] | undefined; sessionId?: string | undefined; permissions?: string[] | undefined; scopes?: string[] | undefined; }, { userId?: string | undefined; roles?: string[] | undefined; sessionId?: string | undefined; permissions?: string[] | undefined; scopes?: string[] | undefined; }>; }, "strip", z.ZodTypeAny, { type: WSMessageType.AUTH_SUCCESS; timestamp: string; data: { userId?: string | undefined; roles?: string[] | undefined; sessionId?: string | undefined; permissions?: string[] | undefined; scopes?: string[] | undefined; }; id?: string | undefined; }, { type: WSMessageType.AUTH_SUCCESS; data: { userId?: string | undefined; roles?: string[] | undefined; sessionId?: string | undefined; permissions?: string[] | undefined; scopes?: string[] | undefined; }; id?: string | undefined; timestamp?: string | undefined; }>, z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodLiteral; error: z.ZodOptional; }, "strip", z.ZodTypeAny, { code: string; message: string; details?: unknown; }, { code: string; message: string; details?: unknown; }>>; }, "strip", z.ZodTypeAny, { type: WSMessageType.AUTH_ERROR; timestamp: string; error?: { code: string; message: string; details?: unknown; } | undefined; id?: string | undefined; }, { type: WSMessageType.AUTH_ERROR; error?: { code: string; message: string; details?: unknown; } | undefined; id?: string | undefined; timestamp?: string | undefined; }>, z.ZodObject<{ timestamp: z.ZodDefault; } & { type: z.ZodLiteral; id: z.ZodString; method: z.ZodString; path: z.ZodString; data: z.ZodOptional; headers: z.ZodOptional>; }, "strip", z.ZodTypeAny, { path: string; type: WSMessageType.REQUEST; id: string; method: string; timestamp: string; headers?: Record | undefined; data?: unknown; }, { path: string; type: WSMessageType.REQUEST; id: string; method: string; headers?: Record | undefined; timestamp?: string | undefined; data?: unknown; }>, z.ZodObject<{ timestamp: z.ZodDefault; } & { type: z.ZodLiteral; id: z.ZodString; status: z.ZodNumber; data: z.ZodOptional; error: z.ZodOptional; }, "strip", z.ZodTypeAny, { code: string; message: string; details?: unknown; }, { code: string; message: string; details?: unknown; }>>; }, "strip", z.ZodTypeAny, { type: WSMessageType.RESPONSE; status: number; id: string; timestamp: string; error?: { code: string; message: string; details?: unknown; } | undefined; data?: unknown; }, { type: WSMessageType.RESPONSE; status: number; id: string; error?: { code: string; message: string; details?: unknown; } | undefined; timestamp?: string | undefined; data?: unknown; }>, z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodLiteral; event: z.ZodString; data: z.ZodUnknown; }, "strip", z.ZodTypeAny, { type: WSMessageType.EVENT; timestamp: string; event: string; id?: string | undefined; data?: unknown; }, { type: WSMessageType.EVENT; event: string; id?: string | undefined; timestamp?: string | undefined; data?: unknown; }>, z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodLiteral; error: z.ZodObject<{ code: z.ZodString; message: z.ZodString; details: z.ZodOptional; }, "strip", z.ZodTypeAny, { code: string; message: string; details?: unknown; }, { code: string; message: string; details?: unknown; }>; }, "strip", z.ZodTypeAny, { type: WSMessageType.ERROR; error: { code: string; message: string; details?: unknown; }; timestamp: string; id?: string | undefined; }, { type: WSMessageType.ERROR; error: { code: string; message: string; details?: unknown; }; id?: string | undefined; timestamp?: string | undefined; }>, z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodEnum<[WSMessageType.SUBSCRIBE, WSMessageType.UNSUBSCRIBE]>; topic: z.ZodString; filters: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: WSMessageType.SUBSCRIBE | WSMessageType.UNSUBSCRIBE; timestamp: string; topic: string; id?: string | undefined; filters?: Record | undefined; }, { type: WSMessageType.SUBSCRIBE | WSMessageType.UNSUBSCRIBE; topic: string; id?: string | undefined; timestamp?: string | undefined; filters?: Record | undefined; }>, z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodLiteral; topic: z.ZodString; data: z.ZodUnknown; }, "strip", z.ZodTypeAny, { type: WSMessageType.SUBSCRIPTION_UPDATE; timestamp: string; topic: string; id?: string | undefined; data?: unknown; }, { type: WSMessageType.SUBSCRIPTION_UPDATE; topic: string; id?: string | undefined; timestamp?: string | undefined; data?: unknown; }>, z.ZodObject<{ id: z.ZodOptional; timestamp: z.ZodDefault; } & { type: z.ZodEnum<[WSMessageType.PING, WSMessageType.PONG]>; }, "strip", z.ZodTypeAny, { type: WSMessageType.PING | WSMessageType.PONG; timestamp: string; id?: string | undefined; }, { type: WSMessageType.PING | WSMessageType.PONG; id?: string | undefined; timestamp?: string | undefined; }>]>; export type WSMessage = z.infer; export type WSAuthMessage = z.infer; export type WSRequestMessage = z.infer; export type WSResponseMessage = z.infer; export type WSEventMessage = z.infer; export type WSErrorMessage = z.infer; export type WSSubscriptionMessage = z.infer; export type WSSubscriptionUpdate = z.infer; export type WSPingPongMessage = z.infer; export interface WSConnectionState { id: string; authenticated: boolean; userId?: string; sessionId?: string; roles?: string[]; permissions?: string[]; scopes?: string[]; subscriptions: Set; lastActivity: Date; connectedAt: Date; remoteAddress?: string; userAgent?: string; protocol?: string; metadata?: Record; } export interface WSClientOptions { url: string; token?: string; apiKey?: string; reconnect?: boolean; reconnectInterval?: number; maxReconnectAttempts?: number; heartbeatInterval?: number; requestTimeout?: number; } //# sourceMappingURL=websocket.d.ts.map