export interface CDPSessionOnMessageObject { id?: number; method: string; params: Record; error: { message: string; data: unknown; }; result?: unknown; } export default class DevtoolsGatherer { private _logs: CDPSessionOnMessageObject[] = [] onMessage (msgObj: CDPSessionOnMessageObject) { this._logs.push(msgObj) } /** * retrieve logs and clean cache */ getLogs () { return this._logs.splice(0, this._logs.length) } }