import http from 'node:http'; import localtunnel from 'localtunnel'; type Tunnel = Awaited>; type LocaltunnelOptions = Parameters[0]; interface DevToolsOptions { prefix?: string; subdomain?: string | null; auth?: { user: string | null; pass: string | null; }; localtunnel?: Partial; [key: string]: unknown; } /** * Base class handling common stuff * * @ignore */ declare class DevToolsCommon { opts: DevToolsOptions; wsUrl: string; wsHost: string; wsPort: string; constructor(webSocketDebuggerUrl: string, opts?: DevToolsOptions); fetchVersion(): Promise; fetchList(): Promise; } /** * Convenience functions for local remote debugging sessions. * * @ignore */ declare class DevToolsLocal extends DevToolsCommon { constructor(webSocketDebuggerUrl: string, opts?: Record); get url(): string; getUrlForPageId(pageId: string): string; } /** * Create a proxy + tunnel to make a local devTools session accessible from the internet. * * - These devtools pages support screencasting the browser screen * - Proxy supports both http and websockets * - Proxy patches Host header to bypass devtools bug preventing non-localhost/ip access * - Proxy rewrites URLs, so links on the devtools index page will work * - Has a convenience function to return a deep link to a debug a specific page * - Supports basic auth ;-) * * @todo No idea how long-living a tunnel connection is yet, we might want to add keep-alive/reconnect capabilities * * @ignore */ declare class DevToolsTunnel extends DevToolsCommon { server: http.Server | null; tunnel: Tunnel | null; tunnelHost: string | null; proxyServer: any; constructor(webSocketDebuggerUrl: string, opts?: DevToolsOptions); get defaults(): Required; get url(): string; getUrlForPageId(pageId: string): string; create(): Promise; close(): this; _generateSubdomain(prefix: string): string; _createBasicAuth(user: string, pass: string): any; /** * `fetch` used by the index page doesn't include credentials by default. * * LOVELY * THANKS * <3 * * @ignore */ _modifyFetchToIncludeCredentials(body: string): string | undefined; _modifyJSONResponse(body: string): string | undefined; _createProxyServer(targetHost: string | undefined, targetPort: string): any; _createServer(port: number, auth?: any): Promise; _createTunnel(options: LocaltunnelOptions): Promise; } export { DevToolsCommon, DevToolsLocal, DevToolsTunnel }; //# sourceMappingURL=RemoteDevTools.d.ts.map