/** * Type definitions for GraphQL Stream Viewer Helper Library */ /** * Configuration options for the helper library */ export interface HelperConfig { /** * Enable SSE (Server-Sent Events) capture * @default true */ captureSSE?: boolean; /** * Enable HTTP GraphQL request capture * @default false */ captureHTTP?: boolean; /** * Enable debug logging * @default false */ debug?: boolean; /** * Custom filter function to determine if a URL should be captured * @param url - The request URL * @returns true to capture, false to ignore */ urlFilter?: (url: string) => boolean; } /** * SSE Event data captured from EventSource */ export interface SSEEventData { /** * Event type (e.g., 'message', 'error', 'open') */ type: string; /** * Event data payload */ data?: string; /** * Event ID */ id?: string; /** * Timestamp when event was captured */ timestamp: number; /** * The EventSource URL */ url: string; /** * Last event ID from EventSource */ lastEventId?: string; /** * Ready state of the EventSource */ readyState?: number; } /** * Connection lifecycle event */ export interface ConnectionEvent { /** * Connection event type */ type: 'open' | 'close' | 'error'; /** * The EventSource URL */ url: string; /** * Timestamp when event occurred */ timestamp: number; /** * Error details if type is 'error' */ error?: { message: string; stack?: string; }; } /** * Message sent from helper library to extension */ export interface HelperMessage { /** * Message type for routing */ type: 'GRAPHQL_SSE_EVENT' | 'GRAPHQL_SSE_CONNECTION' | 'GRAPHQL_HTTP_REQUEST'; /** * Payload data */ data: SSEEventData | ConnectionEvent | unknown; /** * Library version for compatibility checking */ version: string; /** * Source identifier */ source: 'graphql-stream-viewer-helper'; } /** * HTTP Request capture data */ export interface HTTPRequestData { /** * Request URL */ url: string; /** * HTTP method */ method: string; /** * Request headers */ headers?: Record; /** * Request body (GraphQL query) */ body?: string; /** * Response data */ response?: string; /** * Response status code */ status?: number; /** * Timestamp when request was made */ timestamp: number; } /** * Return type for the connection function */ export interface HelperConnection { /** * Disconnect and clean up */ disconnect: () => void; /** * Check if connected to extension */ isConnected: () => boolean; /** * Get current configuration */ getConfig: () => Readonly>; } //# sourceMappingURL=types.d.ts.map