diff --git a/lighthouse-core/gather/driver.js b/lighthouse-core/gather/driver.js index 20b01c4ce120..7a838f517a3a 100644 --- a/lighthouse-core/gather/driver.js +++ b/lighthouse-core/gather/driver.js @@ -59,6 +59,9 @@ const DEFAULT_PROTOCOL_TIMEOUT = 30000; * @typedef {LH.Protocol.StrictEventEmitter} CrdpEventEmitter */ +/** + * @implements {LH.Gatherer.FRTransitionalDriver} + */ class Driver { /** * @param {Connection} connection @@ -115,9 +118,6 @@ class Driver { this.fetcher = new Fetcher(this); this._runtimeController = new RuntimeController(this); - - /** @type {LH.Gatherer.FRTransitionalDriver} */ - const typecheck = this; // eslint-disable-line no-unused-vars } static get traceCategories() { diff --git a/tsconfig.json b/tsconfig.json index cf9e992357e1..b9d6cbc114fc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -32,8 +32,6 @@ // Opt-in to typechecking for some core tests. "lighthouse-core/test/scripts/lantern/constants-test.js", "lighthouse-core/test/fraggle-rock/gather/runtime-controller-test.js", - "lighthouse-core/test/fraggle-rock/gather/session-test.js", - "lighthouse-core/test/fraggle-rock/gather/driver-test.js", "lighthouse-core/test/gather/driver-test.js", "lighthouse-core/test/gather/gather-runner-test.js", "lighthouse-core/test/audits/script-treemap-data-test.js" diff --git a/types/gatherer.d.ts b/types/gatherer.d.ts index 394410d80fb8..cca056825c8d 100644 --- a/types/gatherer.d.ts +++ b/types/gatherer.d.ts @@ -13,22 +13,22 @@ declare global { module LH.Gatherer { /** The Lighthouse wrapper around a raw CDP session. */ export interface FRProtocolSession { - hasNextProtocolTimeout(): boolean - getNextProtocolTimeout(): number - setNextProtocolTimeout(ms: number): void - on(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void - off(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void - sendCommand(method: TMethod, ...params: LH.CrdpCommands[TMethod]['paramsType']): Promise + hasNextProtocolTimeout(): boolean; + getNextProtocolTimeout(): number; + setNextProtocolTimeout(ms: number): void; + on(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void; + off(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void; + sendCommand(method: TMethod, ...params: LH.CrdpCommands[TMethod]['paramsType']): Promise; } /** The limited driver interface shared between pre and post Fraggle Rock Lighthouse. */ export interface FRTransitionalDriver extends FRProtocolSession { - evaluateAsync(expression: string, options?: {useIsolation?: boolean}): Promise + evaluateAsync(expression: string, options?: {useIsolation?: boolean}): Promise; } /** The limited context interface shared between pre and post Fraggle Rock Lighthouse. */ export interface FRTransitionalContext { - driver: FRTransitionalDriver + driver: FRTransitionalDriver; } export interface PassContext {