From aac2367b88d099a401551e87a873c17fda315baa Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Tue, 21 Jan 2025 11:39:57 +0100 Subject: [PATCH] chore: fix --- src/bidiMapper/BidiServer.ts | 2 +- src/bidiMapper/CommandProcessor.ts | 2 +- src/bidiMapper/modules/browser/BrowserProcessor.ts | 2 +- src/bidiMapper/modules/cdp/TargetEvents.ts | 2 +- src/bidiMapper/modules/context/BrowsingContextImpl.ts | 2 +- src/bidiMapper/modules/context/BrowsingContextProcessor.ts | 2 +- src/bidiMapper/modules/context/BrowsingContextStorage.ts | 2 +- src/bidiMapper/modules/context/NavigationTracker.ts | 2 +- src/bidiMapper/modules/input/ActionDispatcher.ts | 2 +- src/bidiMapper/modules/network/NetworkUtils.ts | 2 +- src/bidiMapper/modules/script/Realm.ts | 2 +- src/bidiMapper/modules/script/WindowRealm.ts | 2 +- src/bidiMapper/modules/session/EventManager.ts | 2 +- src/utils/EventEmitter.spec.ts | 2 +- src/utils/{Base64.spec.ts => base64.spec.ts} | 2 +- src/utils/{Base64.ts => base64.ts} | 0 src/utils/{CdpErrorConstants.ts => cdpErrorConstants.ts} | 0 src/utils/{GraphemeTools.spec.ts => graphemeTools.spec.ts} | 2 +- src/utils/{GraphemeTools.ts => graphemeTools.ts} | 0 src/utils/{UrlHelpers.spec.ts => urlHelpers.spec.ts} | 2 +- src/utils/{UrlHelpers.ts => urlHelpers.ts} | 0 21 files changed, 17 insertions(+), 17 deletions(-) rename src/utils/{Base64.spec.ts => base64.spec.ts} (95%) rename src/utils/{Base64.ts => base64.ts} (100%) rename src/utils/{CdpErrorConstants.ts => cdpErrorConstants.ts} (100%) rename src/utils/{GraphemeTools.spec.ts => graphemeTools.spec.ts} (98%) rename src/utils/{GraphemeTools.ts => graphemeTools.ts} (100%) rename src/utils/{UrlHelpers.spec.ts => urlHelpers.spec.ts} (97%) rename src/utils/{UrlHelpers.ts => urlHelpers.ts} (100%) diff --git a/src/bidiMapper/BidiServer.ts b/src/bidiMapper/BidiServer.ts index 1d7a82da24..161074393a 100644 --- a/src/bidiMapper/BidiServer.ts +++ b/src/bidiMapper/BidiServer.ts @@ -38,7 +38,7 @@ import { } from './modules/session/EventManager.js'; import type {OutgoingMessage} from './OutgoingMessage.js'; -interface BidiServerEvent { +interface BidiServerEvent extends Record { message: ChromiumBidi.Command; } diff --git a/src/bidiMapper/CommandProcessor.ts b/src/bidiMapper/CommandProcessor.ts index 358ecd1923..4d9f27f35b 100644 --- a/src/bidiMapper/CommandProcessor.ts +++ b/src/bidiMapper/CommandProcessor.ts @@ -52,7 +52,7 @@ export const enum CommandProcessorEvents { Response = 'response', } -interface CommandProcessorEventsMap { +interface CommandProcessorEventsMap extends Record { [CommandProcessorEvents.Response]: { message: Promise>; event: string; diff --git a/src/bidiMapper/modules/browser/BrowserProcessor.ts b/src/bidiMapper/modules/browser/BrowserProcessor.ts index 52003ba8e2..b9e086e1fd 100644 --- a/src/bidiMapper/modules/browser/BrowserProcessor.ts +++ b/src/bidiMapper/modules/browser/BrowserProcessor.ts @@ -24,7 +24,7 @@ import { NoSuchUserContextException, } from '../../../protocol/protocol.js'; import type {CdpClient} from '../../BidiMapper.js'; -import type {BrowsingContextStorage} from '../context/BrowsingContextStorage'; +import type {BrowsingContextStorage} from '../context/BrowsingContextStorage.js'; export class BrowserProcessor { readonly #browserCdpClient: CdpClient; diff --git a/src/bidiMapper/modules/cdp/TargetEvents.ts b/src/bidiMapper/modules/cdp/TargetEvents.ts index 1087b0436d..f3e3424670 100644 --- a/src/bidiMapper/modules/cdp/TargetEvents.ts +++ b/src/bidiMapper/modules/cdp/TargetEvents.ts @@ -27,7 +27,7 @@ export const enum TargetEvents { FrameStartedNavigating = 'frameStartedNavigating', } -export interface TargetEventMap { +export interface TargetEventMap extends Record { [TargetEvents.FrameStartedNavigating]: { loaderId: string; url: string; diff --git a/src/bidiMapper/modules/context/BrowsingContextImpl.ts b/src/bidiMapper/modules/context/BrowsingContextImpl.ts index 22e228ed11..dab072c7fb 100644 --- a/src/bidiMapper/modules/context/BrowsingContextImpl.ts +++ b/src/bidiMapper/modules/context/BrowsingContextImpl.ts @@ -36,7 +36,7 @@ import {type LoggerFn, LogType} from '../../../utils/log.js'; import {getTimestamp} from '../../../utils/time.js'; import {inchesFromCm} from '../../../utils/unitConversions.js'; import type {CdpTarget} from '../cdp/CdpTarget.js'; -import {TargetEvents} from '../cdp/TargetEvents'; +import {TargetEvents} from '../cdp/TargetEvents.js'; import type {Realm} from '../script/Realm.js'; import type {RealmStorage} from '../script/RealmStorage.js'; import {WindowRealm} from '../script/WindowRealm.js'; diff --git a/src/bidiMapper/modules/context/BrowsingContextProcessor.ts b/src/bidiMapper/modules/context/BrowsingContextProcessor.ts index 0669630c96..714b0de222 100644 --- a/src/bidiMapper/modules/context/BrowsingContextProcessor.ts +++ b/src/bidiMapper/modules/context/BrowsingContextProcessor.ts @@ -25,7 +25,7 @@ import { NoSuchUserContextException, NoSuchAlertException, } from '../../../protocol/protocol.js'; -import {CdpErrorConstants} from '../../../utils/CdpErrorConstants.js'; +import {CdpErrorConstants} from '../../../utils/cdpErrorConstants.js'; import type {EventManager} from '../session/EventManager.js'; import type {BrowsingContextImpl} from './BrowsingContextImpl.js'; diff --git a/src/bidiMapper/modules/context/BrowsingContextStorage.ts b/src/bidiMapper/modules/context/BrowsingContextStorage.ts index 8ce388719e..a9a71344a2 100644 --- a/src/bidiMapper/modules/context/BrowsingContextStorage.ts +++ b/src/bidiMapper/modules/context/BrowsingContextStorage.ts @@ -28,7 +28,7 @@ const enum BrowsingContextStorageEvents { Added = 'added', } -interface BrowsingContextStorageEvent { +interface BrowsingContextStorageEvent extends Record { [BrowsingContextStorageEvents.Added]: {browsingContext: BrowsingContextImpl}; } diff --git a/src/bidiMapper/modules/context/NavigationTracker.ts b/src/bidiMapper/modules/context/NavigationTracker.ts index 061dd58ef6..957ac916d7 100644 --- a/src/bidiMapper/modules/context/NavigationTracker.ts +++ b/src/bidiMapper/modules/context/NavigationTracker.ts @@ -25,7 +25,7 @@ import { import {Deferred} from '../../../utils/Deferred.js'; import {type LoggerFn, LogType} from '../../../utils/log.js'; import {getTimestamp} from '../../../utils/time.js'; -import {urlMatchesAboutBlank} from '../../../utils/UrlHelpers.js'; +import {urlMatchesAboutBlank} from '../../../utils/urlHelpers.js'; import {uuidv4} from '../../../utils/uuid.js'; import type {EventManager} from '../session/EventManager.js'; diff --git a/src/bidiMapper/modules/input/ActionDispatcher.ts b/src/bidiMapper/modules/input/ActionDispatcher.ts index d0ca739d22..34d326f272 100644 --- a/src/bidiMapper/modules/input/ActionDispatcher.ts +++ b/src/bidiMapper/modules/input/ActionDispatcher.ts @@ -26,7 +26,7 @@ import {assert} from '../../../utils/assert.js'; import { isSingleComplexGrapheme, isSingleGrapheme, -} from '../../../utils/GraphemeTools.js'; +} from '../../../utils/graphemeTools.js'; import type {BrowsingContextImpl} from '../context/BrowsingContextImpl.js'; import type {BrowsingContextStorage} from '../context/BrowsingContextStorage.js'; diff --git a/src/bidiMapper/modules/network/NetworkUtils.ts b/src/bidiMapper/modules/network/NetworkUtils.ts index 8e51f68855..895c7c6ee7 100644 --- a/src/bidiMapper/modules/network/NetworkUtils.ts +++ b/src/bidiMapper/modules/network/NetworkUtils.ts @@ -23,7 +23,7 @@ import type {Protocol} from 'devtools-protocol'; import {InvalidArgumentException} from '../../../protocol/ErrorResponse.js'; import {Network, type Storage} from '../../../protocol/protocol.js'; -import {base64ToString} from '../../../utils/Base64.js'; +import {base64ToString} from '../../../utils/base64.js'; export function computeHeadersSize(headers: Network.Header[]): number { const requestHeaders = headers.reduce((acc, header) => { diff --git a/src/bidiMapper/modules/script/Realm.ts b/src/bidiMapper/modules/script/Realm.ts index 35f9c6aab6..9040805e00 100644 --- a/src/bidiMapper/modules/script/Realm.ts +++ b/src/bidiMapper/modules/script/Realm.ts @@ -22,7 +22,7 @@ import { NoSuchHandleException, Script, } from '../../../protocol/protocol.js'; -import {CdpErrorConstants} from '../../../utils/CdpErrorConstants.js'; +import {CdpErrorConstants} from '../../../utils/cdpErrorConstants.js'; import {LogType, type LoggerFn} from '../../../utils/log.js'; import {uuidv4} from '../../../utils/uuid.js'; import type {BrowsingContextImpl} from '../context/BrowsingContextImpl.js'; diff --git a/src/bidiMapper/modules/script/WindowRealm.ts b/src/bidiMapper/modules/script/WindowRealm.ts index 7738d09af1..832134ab19 100644 --- a/src/bidiMapper/modules/script/WindowRealm.ts +++ b/src/bidiMapper/modules/script/WindowRealm.ts @@ -24,7 +24,7 @@ import { type BrowsingContext, type Script, } from '../../../protocol/protocol.js'; -import {CdpErrorConstants} from '../../../utils/CdpErrorConstants.js'; +import {CdpErrorConstants} from '../../../utils/cdpErrorConstants.js'; import type {LoggerFn} from '../../../utils/log.js'; import type {BrowsingContextImpl} from '../context/BrowsingContextImpl.js'; import type {BrowsingContextStorage} from '../context/BrowsingContextStorage.js'; diff --git a/src/bidiMapper/modules/session/EventManager.ts b/src/bidiMapper/modules/session/EventManager.ts index d3fbdd097f..587d2d27d9 100644 --- a/src/bidiMapper/modules/session/EventManager.ts +++ b/src/bidiMapper/modules/session/EventManager.ts @@ -66,7 +66,7 @@ export const enum EventManagerEvents { Event = 'event', } -interface EventManagerEventsMap { +interface EventManagerEventsMap extends Record { [EventManagerEvents.Event]: { message: Promise>; event: string; diff --git a/src/utils/EventEmitter.spec.ts b/src/utils/EventEmitter.spec.ts index 4791fe9e95..0567b2a1fe 100644 --- a/src/utils/EventEmitter.spec.ts +++ b/src/utils/EventEmitter.spec.ts @@ -21,7 +21,7 @@ import sinon from 'sinon'; import {EventEmitter} from './EventEmitter.js'; describe('EventEmitter', () => { - interface Events { + interface Events extends Record { foo: undefined; bar: string; } diff --git a/src/utils/Base64.spec.ts b/src/utils/base64.spec.ts similarity index 95% rename from src/utils/Base64.spec.ts rename to src/utils/base64.spec.ts index 3999f28370..341dba6e91 100644 --- a/src/utils/Base64.spec.ts +++ b/src/utils/base64.spec.ts @@ -17,7 +17,7 @@ import {expect} from 'chai'; -import {base64ToString} from './Base64.js'; +import {base64ToString} from './base64.js'; describe('base64ToString', () => { it('should decode', () => { diff --git a/src/utils/Base64.ts b/src/utils/base64.ts similarity index 100% rename from src/utils/Base64.ts rename to src/utils/base64.ts diff --git a/src/utils/CdpErrorConstants.ts b/src/utils/cdpErrorConstants.ts similarity index 100% rename from src/utils/CdpErrorConstants.ts rename to src/utils/cdpErrorConstants.ts diff --git a/src/utils/GraphemeTools.spec.ts b/src/utils/graphemeTools.spec.ts similarity index 98% rename from src/utils/GraphemeTools.spec.ts rename to src/utils/graphemeTools.spec.ts index 3c20f3a47a..0a81fdeff1 100644 --- a/src/utils/GraphemeTools.spec.ts +++ b/src/utils/graphemeTools.spec.ts @@ -17,7 +17,7 @@ import {expect} from 'chai'; -import {isSingleComplexGrapheme, isSingleGrapheme} from './GraphemeTools.js'; +import {isSingleComplexGrapheme, isSingleGrapheme} from './graphemeTools.js'; describe('GraphemeTools', () => { describe('isSingleGrapheme', () => { diff --git a/src/utils/GraphemeTools.ts b/src/utils/graphemeTools.ts similarity index 100% rename from src/utils/GraphemeTools.ts rename to src/utils/graphemeTools.ts diff --git a/src/utils/UrlHelpers.spec.ts b/src/utils/urlHelpers.spec.ts similarity index 97% rename from src/utils/UrlHelpers.spec.ts rename to src/utils/urlHelpers.spec.ts index d57d6ad7c6..450fa95c4f 100644 --- a/src/utils/UrlHelpers.spec.ts +++ b/src/utils/urlHelpers.spec.ts @@ -17,7 +17,7 @@ import {expect} from 'chai'; -import {urlMatchesAboutBlank} from './UrlHelpers.js'; +import {urlMatchesAboutBlank} from './urlHelpers.js'; describe('BrowsingContextStorage', () => { describe('urlMatchesAboutBlank', () => { diff --git a/src/utils/UrlHelpers.ts b/src/utils/urlHelpers.ts similarity index 100% rename from src/utils/UrlHelpers.ts rename to src/utils/urlHelpers.ts