import type { Capabilities, Services, FunctionProperties, ThenArg } from '@wdio/types'; import CommandHandler from './commands.js'; import type Auditor from './auditor.js'; import type { DevtoolsConfig, EnablePerformanceAuditsOptions, PWAAudits } from './types.js'; export default class DevToolsService implements Services.ServiceInstance { private _options; private _command; private _browser?; constructor(_options: DevtoolsConfig); before(caps: Capabilities.RequestedStandaloneCapabilities | Capabilities.RequestedMultiremoteCapabilities, specs: string[], browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser): Promise; onReload(): Promise; beforeCommand(commandName: string, params: unknown[]): Promise<(void | undefined)[]>; afterCommand(commandName: string): Promise<(void | undefined)[]>; /** * set flag to run performance audits for page transitions */ _enablePerformanceAudits({ networkThrottling, cpuThrottling, cacheEnabled, formFactor }?: EnablePerformanceAuditsOptions): void; /** * custom command to disable performance audits */ _disablePerformanceAudits(): void; _setThrottlingProfile(networkThrottling?: "online" | "offline" | "GPRS" | "Regular 2G" | "Good 2G" | "Regular 3G" | "Good 3G" | "Regular 4G" | "DSL" | "Wifi", cpuThrottling?: number, cacheEnabled?: boolean): Promise; _checkPWA(auditsToBeRun?: PWAAudits[]): Promise; _setupHandler(): Promise; } export * from './types.js'; type CommandHandlerCommands = FunctionProperties; type AuditorCommands = Omit, '_audit' | '_auditPWA' | 'updateCommands'>; /** * ToDo(Christian): use key remapping with TS 4.1 * https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#key-remapping-in-mapped-types */ interface BrowserExtension extends CommandHandlerCommands, AuditorCommands { } export type BrowserExtensionSync = { [K in keyof BrowserExtension]: (...args: Parameters) => ThenArg>; }; declare global { namespace WebdriverIO { interface ServiceOption extends DevtoolsConfig { } } namespace WebdriverIO { interface Browser extends BrowserExtension { } interface MultiRemoteBrowser extends BrowserExtension { } } } //# sourceMappingURL=index.d.ts.map