/** * GraphQL Stream Viewer Helper Library * Enables live SSE event monitoring for the GraphQL Stream Viewer extension */ import type { HelperConfig, HelperConnection } from './types'; import { waitForExtension } from './messenger'; export type { HelperConfig, HelperConnection, SSEEventData, ConnectionEvent } from './types'; /** * Connect to the GraphQL Stream Viewer extension * This enables live SSE event monitoring * * @param config - Configuration options * @returns A connection object with disconnect method * * @example * ```typescript * import { connectDevTools } from '@graphql-stream-viewer/helper'; * * // Connect with default config * const connection = connectDevTools(); * * // Later, when you want to disconnect * connection.disconnect(); * ``` * * @example * ```typescript * // Connect with custom config * const connection = connectDevTools({ * debug: true, * captureHTTP: true, * urlFilter: (url) => url.includes('/api/graphql') * }); * ``` */ export declare function connectDevTools(config?: HelperConfig): HelperConnection; /** * Disconnect from the GraphQL Stream Viewer extension * This removes all wrappers and stops capturing events */ export declare function disconnect(): void; /** * Check if currently connected to the extension */ export declare function isConnected(): boolean; /** * Check if the GraphQL Stream Viewer extension is available * Note: This is a best-effort check */ export declare function checkExtensionAvailable(): boolean; /** * Wait for the extension to become available (with timeout) * Useful for ensuring the extension is loaded before connecting * * @param timeoutMs - Timeout in milliseconds (default: 5000) * @returns Promise that resolves to true if extension is available * * @example * ```typescript * import { waitForExtension, connectDevTools } from '@graphql-stream-viewer/helper'; * * async function setupDevTools() { * const available = await waitForExtension(); * if (available) { * connectDevTools({ debug: true }); * } * } * ``` */ export { waitForExtension }; /** * Get the current connection, if any */ export declare function getConnection(): HelperConnection | null; //# sourceMappingURL=index.d.ts.map