chore: use a type for protocol (#11394)

This commit is contained in:
Nikolay Vitkov 2023-11-16 08:23:08 +01:00 committed by GitHub
parent 7c499cb0b5
commit 8644744dce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -27,6 +27,7 @@ import {
fromEvent,
type Observable,
} from '../../third_party/rxjs/rxjs.js';
import type {ProtocolType} from '../common/ConnectOptions.js';
import {EventEmitter, type EventType} from '../common/EventEmitter.js';
import {debugError} from '../common/util.js';
import {timeout} from '../common/util.js';
@ -444,5 +445,5 @@ export abstract class Browser extends EventEmitter<BrowserEvents> {
/**
* @internal
*/
abstract get protocol(): 'cdp' | 'webDriverBiDi';
abstract get protocol(): ProtocolType;
}

View File

@ -22,6 +22,11 @@ import type {
import type {ConnectionTransport} from './ConnectionTransport.js';
import type {Viewport} from './Viewport.js';
/**
* @internal
*/
export type ProtocolType = 'cdp' | 'webDriverBiDi';
/**
* Generic browser options that can be passed when launching any browser or when
* connecting to an existing browser instance.
@ -54,7 +59,7 @@ export interface BrowserConnectOptions {
* @defaultValue 'cdp'
* @internal
*/
protocol?: 'cdp' | 'webDriverBiDi';
protocol?: ProtocolType;
/**
* Timeout setting for individual protocol (CDP) calls.
*