import { BStackLogger } from './cliLogger.js'; import type { ChildProcess } from 'node:child_process'; import type { StartBinSessionResponse } from '@browserstack/wdio-browserstack-service'; import type BaseModule from './modules/baseModule.js'; import type { Options } from '@wdio/types'; import WdioMochaTestFramework from './frameworks/wdioMochaTestFramework.js'; import WdioAutomationFramework from './frameworks/wdioAutomationFramework.js'; import type { BrowserstackConfig, BrowserstackOptions } from '../types.js'; /** * BrowserstackCLI - Singleton class for managing CLI operations * * This class uses the singleton pattern to ensure only one instance exists * throughout the application lifecycle. */ export declare class BrowserstackCLI { #private; static enabled: boolean; initialized: boolean; config: Record; wdioConfig: string; cliArgs: object; browserstackConfig: Options.Testrunner | {}; process: ChildProcess | null; isMainConnected: boolean; isChildConnected: boolean; binSessionId: string | null; modules: Record; testFramework: WdioMochaTestFramework | null; cliParams: Record | null; automationFramework: WdioAutomationFramework | null; SDK_CLI_BIN_PATH: string | null; logger: typeof BStackLogger; options: BrowserstackConfig & BrowserstackOptions | {}; constructor(); /** * Get the singleton instance of BrowserstackCLI * @returns {BrowserstackCLI} The singleton instance */ static getInstance(): BrowserstackCLI; /** * Bootstrap the CLI * Initializes and starts the CLI based on environment settings * @returns {Promise} */ bootstrap(options: BrowserstackConfig & BrowserstackOptions, config?: Options.Testrunner, wdioConfig?: string): Promise; /** * Start as a main process * @returns {Promise} */ startMain(): Promise; /** * Load modules * @param {Object} startBinResponse - StartBinSession response */ loadModules(startBinResponse: StartBinSessionResponse): void; /** * Configure modules * @returns {Promise} */ configureModules(): Promise; /** * Start the CLI process and return a promise that resolves when it's ready * @returns {Promise} * @throws {Error} If the process fails to start */ start(): Promise; /** * Stop the CLI * @returns {Promise} */ stop(): Promise; /** * Unconfigure modules * @returns {Promise} * @private */ unConfigureModules(): Promise; /** * Load CLI parameters from the output * @param {Object} params - Parameters parsed from CLI output * @private */ loadCliParams(params: Record): void; /** * Start as a child process with the specified binSessionId * @param {string} binSessionId - session ID to connect to the CLI process * @returns {Promise} */ startChild(binSessionId: string): Promise; /** * Check if the CLI is running * @returns {boolean} True if the CLI is running */ isRunning(): boolean; /** * Get the Browserstack configuration * @returns {Object} The Browserstack configuration */ getBrowserstackConfig(): {} | Options.Testrunner; /** * Set the Browserstack configuration * @param {Object} * @returns {void} */ setBrowserstackConfig(browserstackConfig: Options.Testrunner): void; /** * Get the CLI binary path * @returns {string} The CLI binary path */ getCliBinPath(): Promise; /** * Check if the CLI is enabled * @returns {boolean} True if the CLI is enabled */ isCliEnabled(): boolean; /** * Get the configuration * @returns {Object} The configuration */ getConfig(): Record; /** * Set the configuration * @param {Object} * @returns {void} */ setConfig(response: StartBinSessionResponse): void; /** * Setup the test framework * @returns {void} */ setupTestFramework(): void; /** * Setup the automation framework * @returns {void} */ setupAutomationFramework(): void; /** * Get the test framework * @returns {Object} The test framework */ getTestFramework(): WdioMochaTestFramework | null; /** * Get the automation framework * @returns {Object} The automation framework */ getAutomationFramework(): WdioAutomationFramework | null; } //# sourceMappingURL=index.d.ts.map