@wdio/browserstack-service
Version:
WebdriverIO service for better Browserstack integration
70 lines • 2.79 kB
TypeScript
import { SDKClient, grpcChannel } from '@browserstack/wdio-browserstack-service';
import type { TestFrameworkEventRequest, TestSessionEventRequest, LogCreatedEventRequest, DriverInitRequest, FetchDriverExecuteParamsEventRequest, ConnectBinSessionResponse, StartBinSessionResponse, TestFrameworkEventResponse, TestSessionEventResponse, LogCreatedEventResponse, DriverInitResponse, FetchDriverExecuteParamsEventResponse } from '@browserstack/wdio-browserstack-service';
import { BStackLogger } from './cliLogger.js';
/**
* GrpcClient - Singleton class for managing gRPC client connections
*
* This class uses the singleton pattern to ensure only one gRPC client instance exists
* throughout the application lifecycle.
*/
export declare class GrpcClient {
#private;
binSessionId: string | undefined;
listenAddress: string | undefined;
channel: grpcChannel | null;
client: SDKClient | null;
logger: typeof BStackLogger;
constructor();
/**
* Get the singleton instance of GrpcClient
* @returns {GrpcClient} The singleton instance
*/
static getInstance(): GrpcClient;
/**
* Initialize the gRPC client connection
* @param {string} host The gRPC server host
* @param {number} port The gRPC server port
*/
init(params: Record<string, string>): void;
/**
* Connect to the gRPC server
* @returns {void}
*/
connect(): void;
startBinSession(wdioConfig: string): Promise<StartBinSessionResponse>;
/**
* Connect to the bin session
* @returns {Promise<Object>} The response from the gRPC call
*/
connectBinSession(): Promise<ConnectBinSessionResponse>;
/**
* Stop the bin session
* @returns {Promise<void>}
* @private
*/
stopBinSession(): Promise<unknown>;
testSessionEvent(data: Omit<TestSessionEventRequest, 'binSessionId'>): Promise<TestSessionEventResponse>;
/**
*
* Send TestFrameworkEvent
*/
testFrameworkEvent(data: Omit<TestFrameworkEventRequest, 'binSessionId'>): Promise<TestFrameworkEventResponse>;
/**
*
* Send driverInitEvent
*/
driverInitEvent(data: Omit<DriverInitRequest, 'binSessionId'>): Promise<DriverInitResponse>;
logCreatedEvent(data: Omit<LogCreatedEventRequest, 'binSessionId'>): Promise<LogCreatedEventResponse>;
fetchDriverExecuteParamsEvent(data: Omit<FetchDriverExecuteParamsEventRequest, 'binSessionId'>): Promise<FetchDriverExecuteParamsEventResponse>;
/**
* Get the gRPC channel
* @returns {grpc.Channel} The gRPC channel
*/
getClient(): SDKClient | null;
/**
* Get the gRPC channel
* @returns {grpc.Channel} The gRPC channel
*/
getChannel(): grpcChannel | null;
}
//# sourceMappingURL=grpcClient.d.ts.map