Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhulce committed Nov 17, 2020
1 parent ef9b18c commit 3702ce4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions lighthouse-core/gather/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ const DEFAULT_PROTOCOL_TIMEOUT = 30000;
* @typedef {LH.Protocol.StrictEventEmitter<LH.CrdpEvents>} CrdpEventEmitter
*/

/**
* @implements {LH.Gatherer.FRTransitionalDriver}
*/
class Driver {
/**
* @param {Connection} connection
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
16 changes: 8 additions & 8 deletions types/gatherer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TEvent extends keyof LH.CrdpEvents>(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void
off<TEvent extends keyof LH.CrdpEvents>(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void
sendCommand<TMethod extends keyof LH.CrdpCommands>(method: TMethod, ...params: LH.CrdpCommands[TMethod]['paramsType']): Promise<LH.CrdpCommands[TMethod]['returnType']>
hasNextProtocolTimeout(): boolean;
getNextProtocolTimeout(): number;
setNextProtocolTimeout(ms: number): void;
on<TEvent extends keyof LH.CrdpEvents>(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void;
off<TEvent extends keyof LH.CrdpEvents>(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void;
sendCommand<TMethod extends keyof LH.CrdpCommands>(method: TMethod, ...params: LH.CrdpCommands[TMethod]['paramsType']): Promise<LH.CrdpCommands[TMethod]['returnType']>;
}

/** The limited driver interface shared between pre and post Fraggle Rock Lighthouse. */
export interface FRTransitionalDriver extends FRProtocolSession {
evaluateAsync(expression: string, options?: {useIsolation?: boolean}): Promise<any>
evaluateAsync(expression: string, options?: {useIsolation?: boolean}): Promise<any>;
}

/** The limited context interface shared between pre and post Fraggle Rock Lighthouse. */
export interface FRTransitionalContext {
driver: FRTransitionalDriver
driver: FRTransitionalDriver;
}

export interface PassContext {
Expand Down

0 comments on commit 3702ce4

Please sign in to comment.