diff --git a/.eslintrc.js b/.eslintrc.js index 76c19cdd..7524d4fb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -220,6 +220,14 @@ module.exports = { '@typescript-eslint/prefer-ts-expect-error': 'error', // This is more performant; see https://v8.dev/blog/fast-async. '@typescript-eslint/return-await': ['error', 'always'], + // This optimizes the dependency tracking for type-only files. + '@typescript-eslint/consistent-type-imports': [ + 'error', + { + disallowTypeAnnotations: false, + fixStyle: 'inline-type-imports', + }, + ], }, overrides: [ { diff --git a/packages/browsers/src/CLI.ts b/packages/browsers/src/CLI.ts index ab72615b..a809adda 100644 --- a/packages/browsers/src/CLI.ts +++ b/packages/browsers/src/CLI.ts @@ -24,9 +24,9 @@ import yargs from 'yargs/yargs'; import { resolveBuildId, - Browser, + type Browser, BrowserPlatform, - ChromeReleaseChannel, + type ChromeReleaseChannel, } from './browser-data/browser-data.js'; import {Cache} from './Cache.js'; import {detectBrowserPlatform} from './detectPlatform.js'; diff --git a/packages/browsers/src/Cache.ts b/packages/browsers/src/Cache.ts index 8312283b..ac77d6ad 100644 --- a/packages/browsers/src/Cache.ts +++ b/packages/browsers/src/Cache.ts @@ -17,7 +17,7 @@ import fs from 'fs'; import path from 'path'; -import {Browser, BrowserPlatform} from './browser-data/browser-data.js'; +import {Browser, type BrowserPlatform} from './browser-data/browser-data.js'; import {computeExecutablePath} from './launch.js'; /** diff --git a/packages/browsers/src/browser-data/firefox.ts b/packages/browsers/src/browser-data/firefox.ts index 91ea887c..0dd55acc 100644 --- a/packages/browsers/src/browser-data/firefox.ts +++ b/packages/browsers/src/browser-data/firefox.ts @@ -19,7 +19,7 @@ import path from 'path'; import {getJSON} from '../httpUtil.js'; -import {BrowserPlatform, ProfileOptions} from './types.js'; +import {BrowserPlatform, type ProfileOptions} from './types.js'; function archive(platform: BrowserPlatform, buildId: string): string { switch (platform) { diff --git a/packages/browsers/src/install.ts b/packages/browsers/src/install.ts index 2a050d4b..bf71ec28 100644 --- a/packages/browsers/src/install.ts +++ b/packages/browsers/src/install.ts @@ -21,8 +21,8 @@ import os from 'os'; import path from 'path'; import { - Browser, - BrowserPlatform, + type Browser, + type BrowserPlatform, downloadUrls, } from './browser-data/browser-data.js'; import {Cache, InstalledBrowser} from './Cache.js'; diff --git a/packages/browsers/src/launch.ts b/packages/browsers/src/launch.ts index f00cd0b1..696af288 100644 --- a/packages/browsers/src/launch.ts +++ b/packages/browsers/src/launch.ts @@ -21,11 +21,11 @@ import path from 'path'; import readline from 'readline'; import { - Browser, - BrowserPlatform, + type Browser, + type BrowserPlatform, executablePathByBrowser, resolveSystemExecutablePath, - ChromeReleaseChannel, + type ChromeReleaseChannel, } from './browser-data/browser-data.js'; import {Cache} from './Cache.js'; import {debug} from './debug.js'; diff --git a/packages/ng-schematics/src/builders/puppeteer/index.ts b/packages/ng-schematics/src/builders/puppeteer/index.ts index c34d8de5..5069ea56 100644 --- a/packages/ng-schematics/src/builders/puppeteer/index.ts +++ b/packages/ng-schematics/src/builders/puppeteer/index.ts @@ -2,16 +2,16 @@ import {spawn} from 'child_process'; import { createBuilder, - BuilderContext, - BuilderOutput, + type BuilderContext, + type BuilderOutput, targetFromTargetString, - BuilderRun, + type BuilderRun, } from '@angular-devkit/architect'; -import {JsonObject} from '@angular-devkit/core'; +import {type JsonObject} from '@angular-devkit/core'; import {TestRunner} from '../../schematics/utils/types.js'; -import {PuppeteerBuilderOptions} from './types.js'; +import {type PuppeteerBuilderOptions} from './types.js'; const terminalStyles = { cyan: '\u001b[36;1m', diff --git a/packages/ng-schematics/src/builders/puppeteer/types.ts b/packages/ng-schematics/src/builders/puppeteer/types.ts index 26feaf27..39ce46f0 100644 --- a/packages/ng-schematics/src/builders/puppeteer/types.ts +++ b/packages/ng-schematics/src/builders/puppeteer/types.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {JsonObject} from '@angular-devkit/core'; +import {type JsonObject} from '@angular-devkit/core'; -import {TestRunner} from '../../schematics/utils/types.js'; +import {type TestRunner} from '../../schematics/utils/types.js'; export interface PuppeteerBuilderOptions extends JsonObject { testRunner: TestRunner; diff --git a/packages/ng-schematics/src/schematics/config/index.ts b/packages/ng-schematics/src/schematics/config/index.ts index 6026212a..d64986d5 100644 --- a/packages/ng-schematics/src/schematics/config/index.ts +++ b/packages/ng-schematics/src/schematics/config/index.ts @@ -14,10 +14,15 @@ * limitations under the License. */ -import {chain, Rule, SchematicContext, Tree} from '@angular-devkit/schematics'; +import { + chain, + type Rule, + type SchematicContext, + type Tree, +} from '@angular-devkit/schematics'; import {addFilesSingle} from '../utils/files.js'; -import {TestRunner, AngularProject} from '../utils/types.js'; +import {TestRunner, type AngularProject} from '../utils/types.js'; // You don't have to export the function as default. You can also have more than one rule // factory per file. diff --git a/packages/ng-schematics/src/schematics/e2e/index.ts b/packages/ng-schematics/src/schematics/e2e/index.ts index 1610fcef..1481e0f4 100644 --- a/packages/ng-schematics/src/schematics/e2e/index.ts +++ b/packages/ng-schematics/src/schematics/e2e/index.ts @@ -16,19 +16,19 @@ import { chain, - Rule, - SchematicContext, + type Rule, + type SchematicContext, SchematicsException, - Tree, + type Tree, } from '@angular-devkit/schematics'; import {addCommonFiles} from '../utils/files.js'; import {getApplicationProjects} from '../utils/json.js'; import { TestRunner, - SchematicsSpec, - AngularProject, - PuppeteerSchematicsConfig, + type SchematicsSpec, + type AngularProject, + type PuppeteerSchematicsConfig, } from '../utils/types.js'; // You don't have to export the function as default. You can also have more than one rule diff --git a/packages/ng-schematics/src/schematics/ng-add/index.ts b/packages/ng-schematics/src/schematics/ng-add/index.ts index b0705125..43b01704 100644 --- a/packages/ng-schematics/src/schematics/ng-add/index.ts +++ b/packages/ng-schematics/src/schematics/ng-add/index.ts @@ -14,7 +14,12 @@ * limitations under the License. */ -import {chain, Rule, SchematicContext, Tree} from '@angular-devkit/schematics'; +import { + chain, + type Rule, + type SchematicContext, + type Tree, +} from '@angular-devkit/schematics'; import {NodePackageInstallTask} from '@angular-devkit/schematics/tasks'; import {of} from 'rxjs'; import {concatMap, map, scan} from 'rxjs/operators'; diff --git a/packages/ng-schematics/src/schematics/utils/files.ts b/packages/ng-schematics/src/schematics/utils/files.ts index 7c751010..8f0aa2e2 100644 --- a/packages/ng-schematics/src/schematics/utils/files.ts +++ b/packages/ng-schematics/src/schematics/utils/files.ts @@ -18,8 +18,8 @@ import {relative, resolve} from 'path'; import {getSystemPath, normalize, strings} from '@angular-devkit/core'; import { - SchematicContext, - Tree, + type SchematicContext, + type Tree, apply, applyTemplates, chain, @@ -28,7 +28,7 @@ import { url, } from '@angular-devkit/schematics'; -import {AngularProject, TestRunner} from './types.js'; +import {type AngularProject, type TestRunner} from './types.js'; export interface FilesOptions { options: { diff --git a/packages/ng-schematics/src/schematics/utils/json.ts b/packages/ng-schematics/src/schematics/utils/json.ts index 962b20db..50b5fd11 100644 --- a/packages/ng-schematics/src/schematics/utils/json.ts +++ b/packages/ng-schematics/src/schematics/utils/json.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {SchematicsException, Tree} from '@angular-devkit/schematics'; +import {SchematicsException, type Tree} from '@angular-devkit/schematics'; import type {AngularJson, AngularProject} from './types.js'; diff --git a/packages/ng-schematics/src/schematics/utils/packages.ts b/packages/ng-schematics/src/schematics/utils/packages.ts index 0df1318a..1aa16cfa 100644 --- a/packages/ng-schematics/src/schematics/utils/packages.ts +++ b/packages/ng-schematics/src/schematics/utils/packages.ts @@ -16,7 +16,7 @@ import {get} from 'https'; -import {Tree} from '@angular-devkit/schematics'; +import {type Tree} from '@angular-devkit/schematics'; import {getNgCommandName} from './files.js'; import { @@ -25,7 +25,7 @@ import { getJsonFileAsObject, getObjectAsJson, } from './json.js'; -import {SchematicsOptions, TestRunner} from './types.js'; +import {type SchematicsOptions, TestRunner} from './types.js'; export interface NodePackage { name: string; version: string; diff --git a/packages/ng-schematics/test/src/utils.ts b/packages/ng-schematics/test/src/utils.ts index 22076148..ba767222 100644 --- a/packages/ng-schematics/test/src/utils.ts +++ b/packages/ng-schematics/test/src/utils.ts @@ -1,10 +1,10 @@ import https from 'https'; import {join} from 'path'; -import {JsonObject} from '@angular-devkit/core'; +import {type JsonObject} from '@angular-devkit/core'; import { SchematicTestRunner, - UnitTestTree, + type UnitTestTree, } from '@angular-devkit/schematics/testing'; import sinon from 'sinon'; diff --git a/packages/puppeteer-core/src/api/Browser.ts b/packages/puppeteer-core/src/api/Browser.ts index e8fd1dc6..93c61176 100644 --- a/packages/puppeteer-core/src/api/Browser.ts +++ b/packages/puppeteer-core/src/api/Browser.ts @@ -16,12 +16,12 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import {ChildProcess} from 'child_process'; +import {type ChildProcess} from 'child_process'; -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; import {Symbol} from '../../third_party/disposablestack/disposablestack.js'; -import {EventEmitter, EventType} from '../common/EventEmitter.js'; +import {EventEmitter, type EventType} from '../common/EventEmitter.js'; import {debugError, waitWithTimeout} from '../common/util.js'; import {Deferred} from '../util/Deferred.js'; diff --git a/packages/puppeteer-core/src/api/BrowserContext.ts b/packages/puppeteer-core/src/api/BrowserContext.ts index e5fdba4c..bf22e598 100644 --- a/packages/puppeteer-core/src/api/BrowserContext.ts +++ b/packages/puppeteer-core/src/api/BrowserContext.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {EventEmitter, EventType} from '../common/EventEmitter.js'; +import {EventEmitter, type EventType} from '../common/EventEmitter.js'; import type {Browser, Permission} from './Browser.js'; -import {Page} from './Page.js'; +import {type Page} from './Page.js'; import type {Target} from './Target.js'; /** diff --git a/packages/puppeteer-core/src/api/CDPSession.ts b/packages/puppeteer-core/src/api/CDPSession.ts index 33a854ca..2d14d8ec 100644 --- a/packages/puppeteer-core/src/api/CDPSession.ts +++ b/packages/puppeteer-core/src/api/CDPSession.ts @@ -1,7 +1,7 @@ import type {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js'; import type {Connection} from '../common/Connection.js'; -import {EventEmitter, EventType} from '../common/EventEmitter.js'; +import {EventEmitter, type EventType} from '../common/EventEmitter.js'; /** * @public diff --git a/packages/puppeteer-core/src/api/Dialog.ts b/packages/puppeteer-core/src/api/Dialog.ts index 99425c3f..c01a90f2 100644 --- a/packages/puppeteer-core/src/api/Dialog.ts +++ b/packages/puppeteer-core/src/api/Dialog.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; import {assert} from '../util/assert.js'; diff --git a/packages/puppeteer-core/src/api/ElementHandle.ts b/packages/puppeteer-core/src/api/ElementHandle.ts index bb586faf..358dd849 100644 --- a/packages/puppeteer-core/src/api/ElementHandle.ts +++ b/packages/puppeteer-core/src/api/ElementHandle.ts @@ -14,32 +14,32 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {Frame} from '../api/Frame.js'; +import {type Frame} from '../api/Frame.js'; import {getQueryHandlerAndSelector} from '../common/GetQueryHandler.js'; -import {WaitForSelectorOptions} from '../common/IsolatedWorld.js'; +import {type WaitForSelectorOptions} from '../common/IsolatedWorld.js'; import {LazyArg} from '../common/LazyArg.js'; import { - ElementFor, - EvaluateFuncWith, - HandleFor, - HandleOr, - NodeFor, + type ElementFor, + type EvaluateFuncWith, + type HandleFor, + type HandleOr, + type NodeFor, } from '../common/types.js'; -import {KeyInput} from '../common/USKeyboardLayout.js'; +import {type KeyInput} from '../common/USKeyboardLayout.js'; import {isString, withSourcePuppeteerURLIfNone} from '../common/util.js'; import {assert} from '../util/assert.js'; import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js'; import {throwIfDisposed} from '../util/decorators.js'; import { - KeyboardTypeOptions, - KeyPressOptions, - MouseClickOptions, + type KeyboardTypeOptions, + type KeyPressOptions, + type MouseClickOptions, } from './Input.js'; import {JSHandle} from './JSHandle.js'; -import {ScreenshotOptions} from './Page.js'; +import {type ScreenshotOptions} from './Page.js'; /** * @public diff --git a/packages/puppeteer-core/src/api/Environment.ts b/packages/puppeteer-core/src/api/Environment.ts index 2b276383..84b4c526 100644 --- a/packages/puppeteer-core/src/api/Environment.ts +++ b/packages/puppeteer-core/src/api/Environment.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import {CDPSession} from './CDPSession.js'; -import {Realm} from './Realm.js'; +import {type CDPSession} from './CDPSession.js'; +import {type Realm} from './Realm.js'; /** * @internal diff --git a/packages/puppeteer-core/src/api/Frame.ts b/packages/puppeteer-core/src/api/Frame.ts index 09434982..3b651523 100644 --- a/packages/puppeteer-core/src/api/Frame.ts +++ b/packages/puppeteer-core/src/api/Frame.ts @@ -14,27 +14,27 @@ * limitations under the License. */ -import Protocol from 'devtools-protocol'; +import type Protocol from 'devtools-protocol'; -import {ClickOptions, ElementHandle} from '../api/ElementHandle.js'; -import {HTTPResponse} from '../api/HTTPResponse.js'; -import {Page, WaitTimeoutOptions} from '../api/Page.js'; -import {DeviceRequestPrompt} from '../common/DeviceRequestPrompt.js'; -import {EventEmitter, EventType} from '../common/EventEmitter.js'; +import {type ClickOptions, type ElementHandle} from '../api/ElementHandle.js'; +import {type HTTPResponse} from '../api/HTTPResponse.js'; +import {type Page, type WaitTimeoutOptions} from '../api/Page.js'; +import {type DeviceRequestPrompt} from '../common/DeviceRequestPrompt.js'; +import {EventEmitter, type EventType} from '../common/EventEmitter.js'; import {getQueryHandlerAndSelector} from '../common/GetQueryHandler.js'; import {transposeIterableHandle} from '../common/HandleIterator.js'; import { - IsolatedWorldChart, - WaitForSelectorOptions, + type IsolatedWorldChart, + type WaitForSelectorOptions, } from '../common/IsolatedWorld.js'; import {LazyArg} from '../common/LazyArg.js'; -import {PuppeteerLifeCycleEvent} from '../common/LifecycleWatcher.js'; +import {type PuppeteerLifeCycleEvent} from '../common/LifecycleWatcher.js'; import { - Awaitable, - EvaluateFunc, - EvaluateFuncWith, - HandleFor, - NodeFor, + type Awaitable, + type EvaluateFunc, + type EvaluateFuncWith, + type HandleFor, + type NodeFor, } from '../common/types.js'; import { getPageContent, @@ -44,10 +44,14 @@ import { import {assert} from '../util/assert.js'; import {throwIfDisposed} from '../util/decorators.js'; -import {CDPSession} from './CDPSession.js'; -import {KeyboardTypeOptions} from './Input.js'; -import {FunctionLocator, Locator, NodeLocator} from './locators/locators.js'; -import {Realm} from './Realm.js'; +import {type CDPSession} from './CDPSession.js'; +import {type KeyboardTypeOptions} from './Input.js'; +import { + FunctionLocator, + type Locator, + NodeLocator, +} from './locators/locators.js'; +import {type Realm} from './Realm.js'; /** * @public diff --git a/packages/puppeteer-core/src/api/HTTPRequest.ts b/packages/puppeteer-core/src/api/HTTPRequest.ts index 597bfd17..be804a17 100644 --- a/packages/puppeteer-core/src/api/HTTPRequest.ts +++ b/packages/puppeteer-core/src/api/HTTPRequest.ts @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from './CDPSession.js'; -import {Frame} from './Frame.js'; -import {HTTPResponse} from './HTTPResponse.js'; +import {type CDPSession} from './CDPSession.js'; +import {type Frame} from './Frame.js'; +import {type HTTPResponse} from './HTTPResponse.js'; /** * @public diff --git a/packages/puppeteer-core/src/api/HTTPResponse.ts b/packages/puppeteer-core/src/api/HTTPResponse.ts index 8853d202..0a1853e0 100644 --- a/packages/puppeteer-core/src/api/HTTPResponse.ts +++ b/packages/puppeteer-core/src/api/HTTPResponse.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import Protocol from 'devtools-protocol'; +import type Protocol from 'devtools-protocol'; -import {SecurityDetails} from '../common/SecurityDetails.js'; +import {type SecurityDetails} from '../common/SecurityDetails.js'; -import {Frame} from './Frame.js'; -import {HTTPRequest} from './HTTPRequest.js'; +import {type Frame} from './Frame.js'; +import {type HTTPRequest} from './HTTPRequest.js'; /** * @public diff --git a/packages/puppeteer-core/src/api/Input.ts b/packages/puppeteer-core/src/api/Input.ts index 37ca936c..35d2f5f5 100644 --- a/packages/puppeteer-core/src/api/Input.ts +++ b/packages/puppeteer-core/src/api/Input.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {KeyInput} from '../common/USKeyboardLayout.js'; +import {type KeyInput} from '../common/USKeyboardLayout.js'; -import {Point} from './ElementHandle.js'; +import {type Point} from './ElementHandle.js'; /** * @public diff --git a/packages/puppeteer-core/src/api/JSHandle.ts b/packages/puppeteer-core/src/api/JSHandle.ts index cd5ba9ee..5ac877ee 100644 --- a/packages/puppeteer-core/src/api/JSHandle.ts +++ b/packages/puppeteer-core/src/api/JSHandle.ts @@ -14,20 +14,20 @@ * limitations under the License. */ -import Protocol from 'devtools-protocol'; +import type Protocol from 'devtools-protocol'; import {Symbol} from '../../third_party/disposablestack/disposablestack.js'; import { - EvaluateFuncWith, - HandleFor, - HandleOr, - Moveable, + type EvaluateFuncWith, + type HandleFor, + type HandleOr, + type Moveable, } from '../common/types.js'; import {debugError, withSourcePuppeteerURLIfNone} from '../common/util.js'; import {moveable, throwIfDisposed} from '../util/decorators.js'; -import {ElementHandle} from './ElementHandle.js'; -import {Realm} from './Realm.js'; +import {type ElementHandle} from './ElementHandle.js'; +import {type Realm} from './Realm.js'; /** * Represents a reference to a JavaScript object. Instances can be created using diff --git a/packages/puppeteer-core/src/api/Page.ts b/packages/puppeteer-core/src/api/Page.ts index 16bf050d..fbb56b41 100644 --- a/packages/puppeteer-core/src/api/Page.ts +++ b/packages/puppeteer-core/src/api/Page.ts @@ -16,7 +16,7 @@ import type {Readable} from 'stream'; -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; import { delay, @@ -28,7 +28,7 @@ import { fromEvent, map, merge, - Observable, + type Observable, of, raceWith, startWith, @@ -40,29 +40,29 @@ import type {Accessibility} from '../common/Accessibility.js'; import type {BidiNetworkManager} from '../common/bidi/NetworkManager.js'; import type {ConsoleMessage} from '../common/ConsoleMessage.js'; import type {Coverage} from '../common/Coverage.js'; -import {Device} from '../common/Device.js'; -import {DeviceRequestPrompt} from '../common/DeviceRequestPrompt.js'; +import {type Device} from '../common/Device.js'; +import {type DeviceRequestPrompt} from '../common/DeviceRequestPrompt.js'; import {TargetCloseError} from '../common/Errors.js'; import { EventEmitter, - EventsWithWildcard, - EventType, - Handler, + type EventsWithWildcard, + type EventType, + type Handler, } from '../common/EventEmitter.js'; import type {FileChooser} from '../common/FileChooser.js'; import type {WaitForSelectorOptions} from '../common/IsolatedWorld.js'; import type {PuppeteerLifeCycleEvent} from '../common/LifecycleWatcher.js'; import { - NetworkManager as CdpNetworkManager, - Credentials, - NetworkConditions, + type NetworkManager as CdpNetworkManager, + type Credentials, + type NetworkConditions, NetworkManagerEvent, } from '../common/NetworkManager.js'; import { - LowerCasePaperFormat, + type LowerCasePaperFormat, paperFormats, - ParsedPDFOptions, - PDFOptions, + type ParsedPDFOptions, + type PDFOptions, } from '../common/PDFOptions.js'; import type {Viewport} from '../common/PuppeteerViewport.js'; import type {Tracing} from '../common/Tracing.js'; @@ -83,7 +83,7 @@ import { } from '../common/util.js'; import type {WebWorker} from '../common/WebWorker.js'; import {assert} from '../util/assert.js'; -import {Deferred} from '../util/Deferred.js'; +import {type Deferred} from '../util/Deferred.js'; import type {Browser} from './Browser.js'; import type {BrowserContext} from './BrowserContext.js'; @@ -96,10 +96,15 @@ import type { FrameAddStyleTagOptions, FrameWaitForFunctionOptions, } from './Frame.js'; -import {Keyboard, KeyboardTypeOptions, Mouse, Touchscreen} from './Input.js'; +import { + type Keyboard, + type KeyboardTypeOptions, + type Mouse, + type Touchscreen, +} from './Input.js'; import type {JSHandle} from './JSHandle.js'; import { - AwaitedLocator, + type AwaitedLocator, FunctionLocator, Locator, NodeLocator, diff --git a/packages/puppeteer-core/src/api/Realm.ts b/packages/puppeteer-core/src/api/Realm.ts index fb79443d..b13e7e09 100644 --- a/packages/puppeteer-core/src/api/Realm.ts +++ b/packages/puppeteer-core/src/api/Realm.ts @@ -14,13 +14,17 @@ * limitations under the License. */ -import {TimeoutSettings} from '../common/TimeoutSettings.js'; -import {EvaluateFunc, HandleFor, InnerLazyParams} from '../common/types.js'; +import {type TimeoutSettings} from '../common/TimeoutSettings.js'; +import { + type EvaluateFunc, + type HandleFor, + type InnerLazyParams, +} from '../common/types.js'; import {TaskManager, WaitTask} from '../common/WaitTask.js'; -import {ElementHandle} from './ElementHandle.js'; -import {Environment} from './Environment.js'; -import {JSHandle} from './JSHandle.js'; +import {type ElementHandle} from './ElementHandle.js'; +import {type Environment} from './Environment.js'; +import {type JSHandle} from './JSHandle.js'; /** * @internal diff --git a/packages/puppeteer-core/src/api/Target.ts b/packages/puppeteer-core/src/api/Target.ts index b5fcc659..90ff6e8d 100644 --- a/packages/puppeteer-core/src/api/Target.ts +++ b/packages/puppeteer-core/src/api/Target.ts @@ -16,10 +16,10 @@ import type {Browser} from '../api/Browser.js'; import type {BrowserContext} from '../api/BrowserContext.js'; -import {Page} from '../api/Page.js'; -import {WebWorker} from '../common/WebWorker.js'; +import {type Page} from '../api/Page.js'; +import {type WebWorker} from '../common/WebWorker.js'; -import {CDPSession} from './CDPSession.js'; +import {type CDPSession} from './CDPSession.js'; /** * @public diff --git a/packages/puppeteer-core/src/api/locators/DelegatedLocator.ts b/packages/puppeteer-core/src/api/locators/DelegatedLocator.ts index 53d95264..62fd05b1 100644 --- a/packages/puppeteer-core/src/api/locators/DelegatedLocator.ts +++ b/packages/puppeteer-core/src/api/locators/DelegatedLocator.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {Observable} from '../../../third_party/rxjs/rxjs.js'; -import {HandleFor} from '../../common/common.js'; +import {type Observable} from '../../../third_party/rxjs/rxjs.js'; +import {type HandleFor} from '../../common/common.js'; -import {Locator, VisibilityOption} from './locators.js'; +import {Locator, type VisibilityOption} from './locators.js'; /** * @internal diff --git a/packages/puppeteer-core/src/api/locators/FilteredLocator.ts b/packages/puppeteer-core/src/api/locators/FilteredLocator.ts index 9f999fa8..2eedfe50 100644 --- a/packages/puppeteer-core/src/api/locators/FilteredLocator.ts +++ b/packages/puppeteer-core/src/api/locators/FilteredLocator.ts @@ -15,17 +15,17 @@ */ import { - Observable, + type Observable, filter, from, map, mergeMap, throwIfEmpty, } from '../../../third_party/rxjs/rxjs.js'; -import {Awaitable, HandleFor} from '../../common/common.js'; +import {type Awaitable, type HandleFor} from '../../common/common.js'; import {DelegatedLocator} from './DelegatedLocator.js'; -import {ActionOptions, Locator} from './locators.js'; +import {type ActionOptions, type Locator} from './locators.js'; /** * @public diff --git a/packages/puppeteer-core/src/api/locators/FunctionLocator.ts b/packages/puppeteer-core/src/api/locators/FunctionLocator.ts index eed04109..aa7bcec5 100644 --- a/packages/puppeteer-core/src/api/locators/FunctionLocator.ts +++ b/packages/puppeteer-core/src/api/locators/FunctionLocator.ts @@ -15,16 +15,16 @@ */ import { - Observable, + type Observable, defer, from, throwIfEmpty, } from '../../../third_party/rxjs/rxjs.js'; -import {Awaitable, HandleFor} from '../../common/types.js'; -import {Frame} from '../Frame.js'; -import {Page} from '../Page.js'; +import {type Awaitable, type HandleFor} from '../../common/types.js'; +import {type Frame} from '../Frame.js'; +import {type Page} from '../Page.js'; -import {ActionOptions, Locator} from './locators.js'; +import {type ActionOptions, Locator} from './locators.js'; /** * @internal diff --git a/packages/puppeteer-core/src/api/locators/Locator.ts b/packages/puppeteer-core/src/api/locators/Locator.ts index c7310238..f0e02fbb 100644 --- a/packages/puppeteer-core/src/api/locators/Locator.ts +++ b/packages/puppeteer-core/src/api/locators/Locator.ts @@ -16,8 +16,8 @@ import { EMPTY, - Observable, - OperatorFunction, + type Observable, + type OperatorFunction, catchError, defaultIfEmpty, defer, @@ -37,19 +37,23 @@ import { retry, tap, } from '../../../third_party/rxjs/rxjs.js'; -import {EventEmitter, EventType} from '../../common/EventEmitter.js'; -import {HandleFor} from '../../common/types.js'; +import {EventEmitter, type EventType} from '../../common/EventEmitter.js'; +import {type HandleFor} from '../../common/types.js'; import {debugError, timeout} from '../../common/util.js'; -import {BoundingBox, ClickOptions, ElementHandle} from '../ElementHandle.js'; +import { + type BoundingBox, + type ClickOptions, + type ElementHandle, +} from '../ElementHandle.js'; import { - Action, - AwaitedLocator, + type Action, + type AwaitedLocator, FilteredLocator, - HandleMapper, + type HandleMapper, MappedLocator, - Mapper, - Predicate, + type Mapper, + type Predicate, RaceLocator, } from './locators.js'; diff --git a/packages/puppeteer-core/src/api/locators/MappedLocator.ts b/packages/puppeteer-core/src/api/locators/MappedLocator.ts index 96c515b5..3dbf7e53 100644 --- a/packages/puppeteer-core/src/api/locators/MappedLocator.ts +++ b/packages/puppeteer-core/src/api/locators/MappedLocator.ts @@ -14,10 +14,18 @@ * limitations under the License. */ -import {Observable, from, mergeMap} from '../../../third_party/rxjs/rxjs.js'; -import {Awaitable, HandleFor} from '../../common/common.js'; +import { + type Observable, + from, + mergeMap, +} from '../../../third_party/rxjs/rxjs.js'; +import {type Awaitable, type HandleFor} from '../../common/common.js'; -import {ActionOptions, DelegatedLocator, Locator} from './locators.js'; +import { + type ActionOptions, + DelegatedLocator, + type Locator, +} from './locators.js'; /** * @public diff --git a/packages/puppeteer-core/src/api/locators/NodeLocator.ts b/packages/puppeteer-core/src/api/locators/NodeLocator.ts index ca98569f..a53a05e8 100644 --- a/packages/puppeteer-core/src/api/locators/NodeLocator.ts +++ b/packages/puppeteer-core/src/api/locators/NodeLocator.ts @@ -16,7 +16,7 @@ import { EMPTY, - Observable, + type Observable, defer, filter, first, @@ -26,11 +26,11 @@ import { retry, throwIfEmpty, } from '../../../third_party/rxjs/rxjs.js'; -import {HandleFor, NodeFor} from '../../common/types.js'; -import {Frame} from '../Frame.js'; -import {Page} from '../Page.js'; +import {type HandleFor, type NodeFor} from '../../common/types.js'; +import {type Frame} from '../Frame.js'; +import {type Page} from '../Page.js'; -import {ActionOptions, Locator, RETRY_DELAY} from './locators.js'; +import {type ActionOptions, Locator, RETRY_DELAY} from './locators.js'; /** * @internal diff --git a/packages/puppeteer-core/src/api/locators/RaceLocator.ts b/packages/puppeteer-core/src/api/locators/RaceLocator.ts index e0d5c223..a17991ea 100644 --- a/packages/puppeteer-core/src/api/locators/RaceLocator.ts +++ b/packages/puppeteer-core/src/api/locators/RaceLocator.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {Observable, race} from '../../../third_party/rxjs/rxjs.js'; -import {HandleFor} from '../../puppeteer-core.js'; +import {type Observable, race} from '../../../third_party/rxjs/rxjs.js'; +import {type HandleFor} from '../../puppeteer-core.js'; -import {ActionOptions, Locator} from './locators.js'; +import {type ActionOptions, Locator} from './locators.js'; /** * @public diff --git a/packages/puppeteer-core/src/common/Accessibility.ts b/packages/puppeteer-core/src/common/Accessibility.ts index 82f0e255..a52b5d48 100644 --- a/packages/puppeteer-core/src/common/Accessibility.ts +++ b/packages/puppeteer-core/src/common/Accessibility.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; -import {ElementHandle} from '../api/ElementHandle.js'; +import {type CDPSession} from '../api/CDPSession.js'; +import {type ElementHandle} from '../api/ElementHandle.js'; /** * Represents a Node and the properties of it that are relevant to Accessibility. diff --git a/packages/puppeteer-core/src/common/AriaQueryHandler.ts b/packages/puppeteer-core/src/common/AriaQueryHandler.ts index e0f8bdd8..d6219c1a 100644 --- a/packages/puppeteer-core/src/common/AriaQueryHandler.ts +++ b/packages/puppeteer-core/src/common/AriaQueryHandler.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; -import {ElementHandle} from '../api/ElementHandle.js'; +import {type CDPSession} from '../api/CDPSession.js'; +import {type ElementHandle} from '../api/ElementHandle.js'; import {assert} from '../util/assert.js'; import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js'; -import {IsolatedWorld} from './IsolatedWorld.js'; -import {QueryHandler, QuerySelector} from './QueryHandler.js'; -import {AwaitableIterable} from './types.js'; +import {type IsolatedWorld} from './IsolatedWorld.js'; +import {QueryHandler, type QuerySelector} from './QueryHandler.js'; +import {type AwaitableIterable} from './types.js'; const queryAXTree = async ( client: CDPSession, diff --git a/packages/puppeteer-core/src/common/Binding.ts b/packages/puppeteer-core/src/common/Binding.ts index 3cb20638..a256ca50 100644 --- a/packages/puppeteer-core/src/common/Binding.ts +++ b/packages/puppeteer-core/src/common/Binding.ts @@ -1,7 +1,7 @@ import {JSHandle} from '../api/JSHandle.js'; import {isErrorLike} from '../util/ErrorLike.js'; -import {ExecutionContext} from './ExecutionContext.js'; +import {type ExecutionContext} from './ExecutionContext.js'; import {debugError} from './util.js'; /** diff --git a/packages/puppeteer-core/src/common/Browser.ts b/packages/puppeteer-core/src/common/Browser.ts index 2060f610..2998bf57 100644 --- a/packages/puppeteer-core/src/common/Browser.ts +++ b/packages/puppeteer-core/src/common/Browser.ts @@ -14,40 +14,40 @@ * limitations under the License. */ -import {ChildProcess} from 'child_process'; +import {type ChildProcess} from 'child_process'; -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; import { Browser as BrowserBase, - BrowserCloseCallback, - BrowserContextOptions, + type BrowserCloseCallback, + type BrowserContextOptions, BrowserEvent, - IsPageTargetCallback, - Permission, - TargetFilterCallback, + type IsPageTargetCallback, + type Permission, + type TargetFilterCallback, WEB_PERMISSION_TO_PROTOCOL_PERMISSION, } from '../api/Browser.js'; import {BrowserContext, BrowserContextEvent} from '../api/BrowserContext.js'; -import {CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; -import {Page} from '../api/Page.js'; -import {Target} from '../api/Target.js'; +import {type CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; +import {type Page} from '../api/Page.js'; +import {type Target} from '../api/Target.js'; import {USE_TAB_TARGET} from '../environment.js'; import {assert} from '../util/assert.js'; import {ChromeTargetManager} from './ChromeTargetManager.js'; -import {Connection} from './Connection.js'; +import {type Connection} from './Connection.js'; import {FirefoxTargetManager} from './FirefoxTargetManager.js'; -import {Viewport} from './PuppeteerViewport.js'; +import {type Viewport} from './PuppeteerViewport.js'; import { - CdpTarget, + type CdpTarget, DevToolsTarget, InitializationStatus, OtherTarget, PageTarget, WorkerTarget, } from './Target.js'; -import {TargetManager, TargetManagerEvent} from './TargetManager.js'; +import {type TargetManager, TargetManagerEvent} from './TargetManager.js'; import {TaskQueue} from './TaskQueue.js'; /** diff --git a/packages/puppeteer-core/src/common/BrowserConnector.ts b/packages/puppeteer-core/src/common/BrowserConnector.ts index d3d51d59..6217b8cf 100644 --- a/packages/puppeteer-core/src/common/BrowserConnector.ts +++ b/packages/puppeteer-core/src/common/BrowserConnector.ts @@ -14,17 +14,20 @@ * limitations under the License. */ -import {IsPageTargetCallback, TargetFilterCallback} from '../api/Browser.js'; +import { + type IsPageTargetCallback, + type TargetFilterCallback, +} from '../api/Browser.js'; import {isNode} from '../environment.js'; import {assert} from '../util/assert.js'; import {isErrorLike} from '../util/ErrorLike.js'; import {CdpBrowser} from './Browser.js'; import {Connection} from './Connection.js'; -import {ConnectionTransport} from './ConnectionTransport.js'; +import {type ConnectionTransport} from './ConnectionTransport.js'; import {getFetch} from './fetch.js'; import type {ConnectOptions} from './Puppeteer.js'; -import {Viewport} from './PuppeteerViewport.js'; +import {type Viewport} from './PuppeteerViewport.js'; import {debugError} from './util.js'; /** * Generic browser options that can be passed when launching any browser or when diff --git a/packages/puppeteer-core/src/common/BrowserWebSocketTransport.ts b/packages/puppeteer-core/src/common/BrowserWebSocketTransport.ts index 5fe32e65..44a9d53d 100644 --- a/packages/puppeteer-core/src/common/BrowserWebSocketTransport.ts +++ b/packages/puppeteer-core/src/common/BrowserWebSocketTransport.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {ConnectionTransport} from './ConnectionTransport.js'; +import {type ConnectionTransport} from './ConnectionTransport.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/CDPSession.ts b/packages/puppeteer-core/src/common/CDPSession.ts index efae8f10..d6d6e952 100644 --- a/packages/puppeteer-core/src/common/CDPSession.ts +++ b/packages/puppeteer-core/src/common/CDPSession.ts @@ -1,15 +1,19 @@ -import {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js'; +import {type ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js'; -import {CDPEvents, CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; +import { + type CDPEvents, + CDPSession, + CDPSessionEvent, +} from '../api/CDPSession.js'; import {assert} from '../util/assert.js'; import { CallbackRegistry, - Connection, + type Connection, createProtocolErrorMessage, } from './Connection.js'; import {TargetCloseError} from './Errors.js'; -import {CdpTarget} from './Target.js'; +import {type CdpTarget} from './Target.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/ChromeTargetManager.ts b/packages/puppeteer-core/src/common/ChromeTargetManager.ts index 07ed3ed2..0388db78 100644 --- a/packages/puppeteer-core/src/common/ChromeTargetManager.ts +++ b/packages/puppeteer-core/src/common/ChromeTargetManager.ts @@ -14,22 +14,22 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {TargetFilterCallback} from '../api/Browser.js'; +import {type TargetFilterCallback} from '../api/Browser.js'; import {CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; import {TargetType} from '../api/Target.js'; import {assert} from '../util/assert.js'; import {Deferred} from '../util/Deferred.js'; -import {Connection} from './Connection.js'; +import {type Connection} from './Connection.js'; import {EventEmitter} from './EventEmitter.js'; import {CdpTarget, InitializationStatus} from './Target.js'; import { - TargetFactory, - TargetManager, + type TargetFactory, + type TargetManager, TargetManagerEvent, - TargetManagerEvents, + type TargetManagerEvents, } from './TargetManager.js'; import {debugError} from './util.js'; diff --git a/packages/puppeteer-core/src/common/Configuration.ts b/packages/puppeteer-core/src/common/Configuration.ts index efe23c2c..8ca0c4f6 100644 --- a/packages/puppeteer-core/src/common/Configuration.ts +++ b/packages/puppeteer-core/src/common/Configuration.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {Product} from './Product.js'; +import {type Product} from './Product.js'; /** * Defines experiment options for Puppeteer. diff --git a/packages/puppeteer-core/src/common/Connection.ts b/packages/puppeteer-core/src/common/Connection.ts index 6798fa5a..9466e27f 100644 --- a/packages/puppeteer-core/src/common/Connection.ts +++ b/packages/puppeteer-core/src/common/Connection.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; import {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js'; import { - CDPSession, + type CDPSession, CDPSessionEvent, - CDPSessionEvents, + type CDPSessionEvents, } from '../api/CDPSession.js'; import {Deferred} from '../util/Deferred.js'; diff --git a/packages/puppeteer-core/src/common/ConsoleMessage.ts b/packages/puppeteer-core/src/common/ConsoleMessage.ts index 9e911c81..86bf2a41 100644 --- a/packages/puppeteer-core/src/common/ConsoleMessage.ts +++ b/packages/puppeteer-core/src/common/ConsoleMessage.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {JSHandle} from '../api/JSHandle.js'; +import {type JSHandle} from '../api/JSHandle.js'; /** * @public diff --git a/packages/puppeteer-core/src/common/Coverage.ts b/packages/puppeteer-core/src/common/Coverage.ts index bfa901d6..b64a308f 100644 --- a/packages/puppeteer-core/src/common/Coverage.ts +++ b/packages/puppeteer-core/src/common/Coverage.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; +import {type CDPSession} from '../api/CDPSession.js'; import {assert} from '../util/assert.js'; import {EventSubscription} from './EventEmitter.js'; diff --git a/packages/puppeteer-core/src/common/CustomQueryHandler.ts b/packages/puppeteer-core/src/common/CustomQueryHandler.ts index db39621d..527c6585 100644 --- a/packages/puppeteer-core/src/common/CustomQueryHandler.ts +++ b/packages/puppeteer-core/src/common/CustomQueryHandler.ts @@ -18,7 +18,11 @@ import type PuppeteerUtil from '../injected/injected.js'; import {assert} from '../util/assert.js'; import {interpolateFunction, stringifyFunction} from '../util/Function.js'; -import {QueryHandler, QuerySelector, QuerySelectorAll} from './QueryHandler.js'; +import { + QueryHandler, + type QuerySelector, + type QuerySelectorAll, +} from './QueryHandler.js'; import {scriptInjector} from './ScriptInjector.js'; /** diff --git a/packages/puppeteer-core/src/common/Device.ts b/packages/puppeteer-core/src/common/Device.ts index 984418a1..b99154b2 100644 --- a/packages/puppeteer-core/src/common/Device.ts +++ b/packages/puppeteer-core/src/common/Device.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {Viewport} from './PuppeteerViewport.js'; +import {type Viewport} from './PuppeteerViewport.js'; /** * @public diff --git a/packages/puppeteer-core/src/common/DeviceRequestPrompt.test.ts b/packages/puppeteer-core/src/common/DeviceRequestPrompt.test.ts index 1047ff14..f2522524 100644 --- a/packages/puppeteer-core/src/common/DeviceRequestPrompt.test.ts +++ b/packages/puppeteer-core/src/common/DeviceRequestPrompt.test.ts @@ -18,7 +18,7 @@ import {describe, it} from 'node:test'; import expect from 'expect'; -import {CDPSessionEvents} from '../api/CDPSession.js'; +import {type CDPSessionEvents} from '../api/CDPSession.js'; import { DeviceRequestPrompt, diff --git a/packages/puppeteer-core/src/common/DeviceRequestPrompt.ts b/packages/puppeteer-core/src/common/DeviceRequestPrompt.ts index 526117ba..a88015cd 100644 --- a/packages/puppeteer-core/src/common/DeviceRequestPrompt.ts +++ b/packages/puppeteer-core/src/common/DeviceRequestPrompt.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import Protocol from 'devtools-protocol'; +import type Protocol from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; -import {WaitTimeoutOptions} from '../api/Page.js'; +import {type CDPSession} from '../api/CDPSession.js'; +import {type WaitTimeoutOptions} from '../api/Page.js'; import {assert} from '../util/assert.js'; import {Deferred} from '../util/Deferred.js'; -import {TimeoutSettings} from './TimeoutSettings.js'; +import {type TimeoutSettings} from './TimeoutSettings.js'; /** * Device in a request prompt. diff --git a/packages/puppeteer-core/src/common/Dialog.ts b/packages/puppeteer-core/src/common/Dialog.ts index 5404ace4..5bdb63ab 100644 --- a/packages/puppeteer-core/src/common/Dialog.ts +++ b/packages/puppeteer-core/src/common/Dialog.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; +import {type CDPSession} from '../api/CDPSession.js'; import {Dialog} from '../api/Dialog.js'; /** diff --git a/packages/puppeteer-core/src/common/ElementHandle.ts b/packages/puppeteer-core/src/common/ElementHandle.ts index d5f5389a..1c7346b6 100644 --- a/packages/puppeteer-core/src/common/ElementHandle.ts +++ b/packages/puppeteer-core/src/common/ElementHandle.ts @@ -14,17 +14,17 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; -import {AutofillData, ElementHandle} from '../api/ElementHandle.js'; -import {Page, ScreenshotOptions} from '../api/Page.js'; +import {type CDPSession} from '../api/CDPSession.js'; +import {type AutofillData, ElementHandle} from '../api/ElementHandle.js'; +import {type Page, type ScreenshotOptions} from '../api/Page.js'; import {assert} from '../util/assert.js'; import {throwIfDisposed} from '../util/decorators.js'; -import {CdpFrame} from './Frame.js'; -import {FrameManager} from './FrameManager.js'; -import {IsolatedWorld} from './IsolatedWorld.js'; +import {type CdpFrame} from './Frame.js'; +import {type FrameManager} from './FrameManager.js'; +import {type IsolatedWorld} from './IsolatedWorld.js'; import {CdpJSHandle} from './JSHandle.js'; import {debugError} from './util.js'; diff --git a/packages/puppeteer-core/src/common/EmulationManager.ts b/packages/puppeteer-core/src/common/EmulationManager.ts index 1e762678..0552a61d 100644 --- a/packages/puppeteer-core/src/common/EmulationManager.ts +++ b/packages/puppeteer-core/src/common/EmulationManager.ts @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; -import {GeolocationOptions, MediaFeature} from '../api/Page.js'; +import {type CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; +import {type GeolocationOptions, type MediaFeature} from '../api/Page.js'; import {assert} from '../util/assert.js'; import {invokeAtMostOnceForArguments} from '../util/decorators.js'; import {isErrorLike} from '../util/ErrorLike.js'; -import {Viewport} from './PuppeteerViewport.js'; +import {type Viewport} from './PuppeteerViewport.js'; import {debugError} from './util.js'; interface ViewportState { diff --git a/packages/puppeteer-core/src/common/EventEmitter.ts b/packages/puppeteer-core/src/common/EventEmitter.ts index 6808a80b..3e3e1141 100644 --- a/packages/puppeteer-core/src/common/EventEmitter.ts +++ b/packages/puppeteer-core/src/common/EventEmitter.ts @@ -16,9 +16,9 @@ import {Symbol} from '../../third_party/disposablestack/disposablestack.js'; import mitt, { - Emitter, - EventHandlerMap, - EventType, + type Emitter, + type EventHandlerMap, + type EventType, } from '../../third_party/mitt/index.js'; export { diff --git a/packages/puppeteer-core/src/common/ExecutionContext.ts b/packages/puppeteer-core/src/common/ExecutionContext.ts index feb64620..bb28c697 100644 --- a/packages/puppeteer-core/src/common/ExecutionContext.ts +++ b/packages/puppeteer-core/src/common/ExecutionContext.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; +import {type CDPSession} from '../api/CDPSession.js'; import type {ElementHandle} from '../api/ElementHandle.js'; -import {JSHandle} from '../api/JSHandle.js'; +import {type JSHandle} from '../api/JSHandle.js'; import type PuppeteerUtil from '../injected/injected.js'; import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js'; import {stringifyFunction} from '../util/Function.js'; @@ -26,11 +26,11 @@ import {stringifyFunction} from '../util/Function.js'; import {ARIAQueryHandler} from './AriaQueryHandler.js'; import {Binding} from './Binding.js'; import {CdpElementHandle} from './ElementHandle.js'; -import {IsolatedWorld} from './IsolatedWorld.js'; +import {type IsolatedWorld} from './IsolatedWorld.js'; import {CdpJSHandle} from './JSHandle.js'; import {LazyArg} from './LazyArg.js'; import {scriptInjector} from './ScriptInjector.js'; -import {EvaluateFunc, HandleFor} from './types.js'; +import {type EvaluateFunc, type HandleFor} from './types.js'; import { PuppeteerURL, createEvaluationError, diff --git a/packages/puppeteer-core/src/common/FileChooser.ts b/packages/puppeteer-core/src/common/FileChooser.ts index 96d6e6eb..138007e2 100644 --- a/packages/puppeteer-core/src/common/FileChooser.ts +++ b/packages/puppeteer-core/src/common/FileChooser.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {ElementHandle} from '../api/ElementHandle.js'; +import {type ElementHandle} from '../api/ElementHandle.js'; import {assert} from '../util/assert.js'; /** diff --git a/packages/puppeteer-core/src/common/FirefoxTargetManager.ts b/packages/puppeteer-core/src/common/FirefoxTargetManager.ts index fb3cc5af..5d86a07f 100644 --- a/packages/puppeteer-core/src/common/FirefoxTargetManager.ts +++ b/packages/puppeteer-core/src/common/FirefoxTargetManager.ts @@ -14,21 +14,21 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {TargetFilterCallback} from '../api/Browser.js'; -import {CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; +import {type TargetFilterCallback} from '../api/Browser.js'; +import {type CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; import {assert} from '../util/assert.js'; import {Deferred} from '../util/Deferred.js'; -import {Connection} from './Connection.js'; +import {type Connection} from './Connection.js'; import {EventEmitter} from './EventEmitter.js'; -import {CdpTarget} from './Target.js'; +import {type CdpTarget} from './Target.js'; import { - TargetFactory, + type TargetFactory, TargetManagerEvent, - TargetManager, - TargetManagerEvents, + type TargetManager, + type TargetManagerEvents, } from './TargetManager.js'; /** diff --git a/packages/puppeteer-core/src/common/Frame.ts b/packages/puppeteer-core/src/common/Frame.ts index 3a9c5a05..15031adf 100644 --- a/packages/puppeteer-core/src/common/Frame.ts +++ b/packages/puppeteer-core/src/common/Frame.ts @@ -14,24 +14,27 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; +import {type CDPSession} from '../api/CDPSession.js'; import {Frame, FrameEvent, throwIfDetached} from '../api/Frame.js'; -import {HTTPResponse} from '../api/HTTPResponse.js'; -import {Page, WaitTimeoutOptions} from '../api/Page.js'; +import {type HTTPResponse} from '../api/HTTPResponse.js'; +import {type Page, type WaitTimeoutOptions} from '../api/Page.js'; import {assert} from '../util/assert.js'; import {Deferred} from '../util/Deferred.js'; import {isErrorLike} from '../util/ErrorLike.js'; import { - DeviceRequestPrompt, - DeviceRequestPromptManager, + type DeviceRequestPrompt, + type DeviceRequestPromptManager, } from './DeviceRequestPrompt.js'; -import {FrameManager} from './FrameManager.js'; +import {type FrameManager} from './FrameManager.js'; import {IsolatedWorld} from './IsolatedWorld.js'; import {MAIN_WORLD, PUPPETEER_WORLD} from './IsolatedWorlds.js'; -import {LifecycleWatcher, PuppeteerLifeCycleEvent} from './LifecycleWatcher.js'; +import { + LifecycleWatcher, + type PuppeteerLifeCycleEvent, +} from './LifecycleWatcher.js'; import {setPageContent} from './util.js'; /** diff --git a/packages/puppeteer-core/src/common/FrameManager.ts b/packages/puppeteer-core/src/common/FrameManager.ts index fbb3fcd7..bceb3e54 100644 --- a/packages/puppeteer-core/src/common/FrameManager.ts +++ b/packages/puppeteer-core/src/common/FrameManager.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; +import {type CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; import {FrameEvent} from '../api/Frame.js'; -import {Page} from '../api/Page.js'; +import {type Page} from '../api/Page.js'; import {assert} from '../util/assert.js'; import {Deferred} from '../util/Deferred.js'; import {isErrorLike} from '../util/ErrorLike.js'; @@ -26,15 +26,15 @@ import {isErrorLike} from '../util/ErrorLike.js'; import {CdpCDPSession} from './CDPSession.js'; import {isTargetClosedError} from './Connection.js'; import {DeviceRequestPromptManager} from './DeviceRequestPrompt.js'; -import {EventEmitter, EventType} from './EventEmitter.js'; +import {EventEmitter, type EventType} from './EventEmitter.js'; import {ExecutionContext} from './ExecutionContext.js'; import {CdpFrame} from './Frame.js'; import {FrameTree} from './FrameTree.js'; -import {IsolatedWorld} from './IsolatedWorld.js'; +import {type IsolatedWorld} from './IsolatedWorld.js'; import {MAIN_WORLD, PUPPETEER_WORLD} from './IsolatedWorlds.js'; import {NetworkManager} from './NetworkManager.js'; -import {CdpTarget} from './Target.js'; -import {TimeoutSettings} from './TimeoutSettings.js'; +import {type CdpTarget} from './Target.js'; +import {type TimeoutSettings} from './TimeoutSettings.js'; import {debugError, PuppeteerURL} from './util.js'; /** diff --git a/packages/puppeteer-core/src/common/FrameTree.ts b/packages/puppeteer-core/src/common/FrameTree.ts index 3f921730..3c69660e 100644 --- a/packages/puppeteer-core/src/common/FrameTree.ts +++ b/packages/puppeteer-core/src/common/FrameTree.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {Frame} from '../api/Frame.js'; +import {type Frame} from '../api/Frame.js'; import {Deferred} from '../util/Deferred.js'; /** diff --git a/packages/puppeteer-core/src/common/HTTPRequest.ts b/packages/puppeteer-core/src/common/HTTPRequest.ts index 58dae7f4..26d15b30 100644 --- a/packages/puppeteer-core/src/common/HTTPRequest.ts +++ b/packages/puppeteer-core/src/common/HTTPRequest.ts @@ -13,25 +13,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; -import {Frame} from '../api/Frame.js'; +import {type CDPSession} from '../api/CDPSession.js'; +import {type Frame} from '../api/Frame.js'; import { - ContinueRequestOverrides, - ErrorCode, + type ContinueRequestOverrides, + type ErrorCode, headersArray, HTTPRequest, InterceptResolutionAction, - InterceptResolutionState, - ResourceType, - ResponseForRequest, + type InterceptResolutionState, + type ResourceType, + type ResponseForRequest, STATUS_TEXTS, } from '../api/HTTPRequest.js'; -import {HTTPResponse} from '../api/HTTPResponse.js'; +import {type HTTPResponse} from '../api/HTTPResponse.js'; import {assert} from '../util/assert.js'; -import {ProtocolError} from './Errors.js'; +import {type ProtocolError} from './Errors.js'; import {debugError, isString} from './util.js'; /** diff --git a/packages/puppeteer-core/src/common/HTTPResponse.ts b/packages/puppeteer-core/src/common/HTTPResponse.ts index fff7c21d..e62bc229 100644 --- a/packages/puppeteer-core/src/common/HTTPResponse.ts +++ b/packages/puppeteer-core/src/common/HTTPResponse.ts @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; -import {Frame} from '../api/Frame.js'; -import {HTTPResponse, RemoteAddress} from '../api/HTTPResponse.js'; +import {type CDPSession} from '../api/CDPSession.js'; +import {type Frame} from '../api/Frame.js'; +import {HTTPResponse, type RemoteAddress} from '../api/HTTPResponse.js'; import {Deferred} from '../util/Deferred.js'; import {ProtocolError} from './Errors.js'; -import {CdpHTTPRequest} from './HTTPRequest.js'; +import {type CdpHTTPRequest} from './HTTPRequest.js'; import {SecurityDetails} from './SecurityDetails.js'; /** diff --git a/packages/puppeteer-core/src/common/HandleIterator.ts b/packages/puppeteer-core/src/common/HandleIterator.ts index 25a2e988..05423f18 100644 --- a/packages/puppeteer-core/src/common/HandleIterator.ts +++ b/packages/puppeteer-core/src/common/HandleIterator.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {JSHandle} from '../api/JSHandle.js'; +import {type JSHandle} from '../api/JSHandle.js'; -import {AwaitableIterable, HandleFor} from './types.js'; +import {type AwaitableIterable, type HandleFor} from './types.js'; const DEFAULT_BATCH_SIZE = 20; diff --git a/packages/puppeteer-core/src/common/Input.ts b/packages/puppeteer-core/src/common/Input.ts index 9f37927a..d6097b87 100644 --- a/packages/puppeteer-core/src/common/Input.ts +++ b/packages/puppeteer-core/src/common/Input.ts @@ -14,26 +14,30 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; -import {Point} from '../api/ElementHandle.js'; +import {type CDPSession} from '../api/CDPSession.js'; +import {type Point} from '../api/ElementHandle.js'; import { Keyboard, - KeyDownOptions, - KeyPressOptions, + type KeyDownOptions, + type KeyPressOptions, Mouse, MouseButton, - MouseClickOptions, - MouseMoveOptions, - MouseOptions, - MouseWheelOptions, + type MouseClickOptions, + type MouseMoveOptions, + type MouseOptions, + type MouseWheelOptions, Touchscreen, - KeyboardTypeOptions, + type KeyboardTypeOptions, } from '../api/Input.js'; import {assert} from '../util/assert.js'; -import {_keyDefinitions, KeyDefinition, KeyInput} from './USKeyboardLayout.js'; +import { + _keyDefinitions, + type KeyDefinition, + type KeyInput, +} from './USKeyboardLayout.js'; type KeyDescription = Required< Pick diff --git a/packages/puppeteer-core/src/common/IsolatedWorld.ts b/packages/puppeteer-core/src/common/IsolatedWorld.ts index 903fa3d2..74769b8a 100644 --- a/packages/puppeteer-core/src/common/IsolatedWorld.ts +++ b/packages/puppeteer-core/src/common/IsolatedWorld.ts @@ -14,19 +14,23 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; -import {JSHandle} from '../api/JSHandle.js'; +import {type CDPSession} from '../api/CDPSession.js'; +import {type JSHandle} from '../api/JSHandle.js'; import {Realm} from '../api/Realm.js'; import {Deferred} from '../util/Deferred.js'; -import {Binding} from './Binding.js'; -import {ExecutionContext} from './ExecutionContext.js'; +import {type Binding} from './Binding.js'; +import {type ExecutionContext} from './ExecutionContext.js'; import {CdpFrame} from './Frame.js'; -import {MAIN_WORLD, PUPPETEER_WORLD} from './IsolatedWorlds.js'; -import {TimeoutSettings} from './TimeoutSettings.js'; -import {BindingPayload, EvaluateFunc, HandleFor} from './types.js'; +import {type MAIN_WORLD, type PUPPETEER_WORLD} from './IsolatedWorlds.js'; +import {type TimeoutSettings} from './TimeoutSettings.js'; +import { + type BindingPayload, + type EvaluateFunc, + type HandleFor, +} from './types.js'; import { addPageBinding, createCdpHandle, @@ -34,7 +38,7 @@ import { Mutex, withSourcePuppeteerURLIfNone, } from './util.js'; -import {WebWorker} from './WebWorker.js'; +import {type WebWorker} from './WebWorker.js'; /** * @public diff --git a/packages/puppeteer-core/src/common/JSHandle.ts b/packages/puppeteer-core/src/common/JSHandle.ts index 6b92ad0d..32606ec4 100644 --- a/packages/puppeteer-core/src/common/JSHandle.ts +++ b/packages/puppeteer-core/src/common/JSHandle.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; +import {type CDPSession} from '../api/CDPSession.js'; import {JSHandle} from '../api/JSHandle.js'; import type {CdpElementHandle} from './ElementHandle.js'; -import {IsolatedWorld} from './IsolatedWorld.js'; +import {type IsolatedWorld} from './IsolatedWorld.js'; import {releaseObject, valueFromRemoteObject} from './util.js'; /** diff --git a/packages/puppeteer-core/src/common/LazyArg.ts b/packages/puppeteer-core/src/common/LazyArg.ts index ffb491f2..af339e8f 100644 --- a/packages/puppeteer-core/src/common/LazyArg.ts +++ b/packages/puppeteer-core/src/common/LazyArg.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import {JSHandle} from '../api/JSHandle.js'; -import PuppeteerUtil from '../injected/injected.js'; +import {type JSHandle} from '../api/JSHandle.js'; +import type PuppeteerUtil from '../injected/injected.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/LifecycleWatcher.ts b/packages/puppeteer-core/src/common/LifecycleWatcher.ts index af212e8d..4da63d97 100644 --- a/packages/puppeteer-core/src/common/LifecycleWatcher.ts +++ b/packages/puppeteer-core/src/common/LifecycleWatcher.ts @@ -14,19 +14,19 @@ * limitations under the License. */ -import Protocol from 'devtools-protocol'; +import type Protocol from 'devtools-protocol'; -import {Frame, FrameEvent} from '../api/Frame.js'; -import {HTTPResponse} from '../api/HTTPResponse.js'; +import {type Frame, FrameEvent} from '../api/Frame.js'; +import {type HTTPResponse} from '../api/HTTPResponse.js'; import {assert} from '../util/assert.js'; import {Deferred} from '../util/Deferred.js'; -import {TimeoutError} from './Errors.js'; +import {type TimeoutError} from './Errors.js'; import {EventSubscription} from './EventEmitter.js'; -import {CdpFrame} from './Frame.js'; +import {type CdpFrame} from './Frame.js'; import {FrameManagerEvent} from './FrameManager.js'; -import {CdpHTTPRequest} from './HTTPRequest.js'; -import {NetworkManager, NetworkManagerEvent} from './NetworkManager.js'; +import {type CdpHTTPRequest} from './HTTPRequest.js'; +import {type NetworkManager, NetworkManagerEvent} from './NetworkManager.js'; /** * @public */ diff --git a/packages/puppeteer-core/src/common/NetworkEventManager.ts b/packages/puppeteer-core/src/common/NetworkEventManager.ts index 112877e9..b758c031 100644 --- a/packages/puppeteer-core/src/common/NetworkEventManager.ts +++ b/packages/puppeteer-core/src/common/NetworkEventManager.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CdpHTTPRequest} from './HTTPRequest.js'; +import {type CdpHTTPRequest} from './HTTPRequest.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/NetworkManager.test.ts b/packages/puppeteer-core/src/common/NetworkManager.test.ts index 82fae581..873e1721 100644 --- a/packages/puppeteer-core/src/common/NetworkManager.test.ts +++ b/packages/puppeteer-core/src/common/NetworkManager.test.ts @@ -18,12 +18,12 @@ import {describe, it} from 'node:test'; import expect from 'expect'; -import {CDPSessionEvents} from '../api/CDPSession.js'; -import {HTTPRequest} from '../api/HTTPRequest.js'; -import {HTTPResponse} from '../api/HTTPResponse.js'; +import {type CDPSessionEvents} from '../api/CDPSession.js'; +import {type HTTPRequest} from '../api/HTTPRequest.js'; +import {type HTTPResponse} from '../api/HTTPResponse.js'; import {EventEmitter} from './EventEmitter.js'; -import {CdpFrame} from './Frame.js'; +import {type CdpFrame} from './Frame.js'; import {NetworkManager, NetworkManagerEvent} from './NetworkManager.js'; // TODO: develop a helper to generate fake network events for attributes that diff --git a/packages/puppeteer-core/src/common/NetworkManager.ts b/packages/puppeteer-core/src/common/NetworkManager.ts index b7a8d0a4..e08fb0f7 100644 --- a/packages/puppeteer-core/src/common/NetworkManager.ts +++ b/packages/puppeteer-core/src/common/NetworkManager.ts @@ -16,14 +16,21 @@ import type {Protocol} from 'devtools-protocol'; -import {CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; +import {type CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; import type {Frame} from '../api/Frame.js'; import {assert} from '../util/assert.js'; -import {EventEmitter, EventSubscription, EventType} from './EventEmitter.js'; +import { + EventEmitter, + EventSubscription, + type EventType, +} from './EventEmitter.js'; import {CdpHTTPRequest} from './HTTPRequest.js'; import {CdpHTTPResponse} from './HTTPResponse.js'; -import {FetchRequestId, NetworkEventManager} from './NetworkEventManager.js'; +import { + type FetchRequestId, + NetworkEventManager, +} from './NetworkEventManager.js'; import {debugError, isString} from './util.js'; /** diff --git a/packages/puppeteer-core/src/common/NodeWebSocketTransport.ts b/packages/puppeteer-core/src/common/NodeWebSocketTransport.ts index 2a864df6..bd5f2b59 100644 --- a/packages/puppeteer-core/src/common/NodeWebSocketTransport.ts +++ b/packages/puppeteer-core/src/common/NodeWebSocketTransport.ts @@ -15,7 +15,7 @@ */ import NodeWebSocket from 'ws'; -import {ConnectionTransport} from '../common/ConnectionTransport.js'; +import {type ConnectionTransport} from '../common/ConnectionTransport.js'; import {packageVersion} from '../generated/version.js'; /** diff --git a/packages/puppeteer-core/src/common/PQueryHandler.ts b/packages/puppeteer-core/src/common/PQueryHandler.ts index 4044c4ba..0d576b60 100644 --- a/packages/puppeteer-core/src/common/PQueryHandler.ts +++ b/packages/puppeteer-core/src/common/PQueryHandler.ts @@ -14,7 +14,11 @@ * limitations under the License. */ -import {QueryHandler, QuerySelector, QuerySelectorAll} from './QueryHandler.js'; +import { + QueryHandler, + type QuerySelector, + type QuerySelectorAll, +} from './QueryHandler.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/Page.ts b/packages/puppeteer-core/src/common/Page.ts index 11067523..15643922 100644 --- a/packages/puppeteer-core/src/common/Page.ts +++ b/packages/puppeteer-core/src/common/Page.ts @@ -20,23 +20,23 @@ import {Protocol} from 'devtools-protocol'; import type {Browser} from '../api/Browser.js'; import type {BrowserContext} from '../api/BrowserContext.js'; -import {CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; -import {ElementHandle} from '../api/ElementHandle.js'; -import {Frame} from '../api/Frame.js'; -import {HTTPRequest} from '../api/HTTPRequest.js'; -import {HTTPResponse} from '../api/HTTPResponse.js'; -import {JSHandle} from '../api/JSHandle.js'; +import {type CDPSession, CDPSessionEvent} from '../api/CDPSession.js'; +import {type ElementHandle} from '../api/ElementHandle.js'; +import {type Frame} from '../api/Frame.js'; +import {type HTTPRequest} from '../api/HTTPRequest.js'; +import {type HTTPResponse} from '../api/HTTPResponse.js'; +import {type JSHandle} from '../api/JSHandle.js'; import { - GeolocationOptions, - MediaFeature, - Metrics, - NewDocumentScriptEvaluation, + type GeolocationOptions, + type MediaFeature, + type Metrics, + type NewDocumentScriptEvaluation, Page, PageEvent, - ScreenshotClip, - ScreenshotOptions, - WaitForOptions, - WaitTimeoutOptions, + type ScreenshotClip, + type ScreenshotOptions, + type WaitForOptions, + type WaitTimeoutOptions, } from '../api/Page.js'; import {assert} from '../util/assert.js'; import {Deferred} from '../util/Deferred.js'; @@ -46,30 +46,30 @@ import {Accessibility} from './Accessibility.js'; import {Binding} from './Binding.js'; import {CdpCDPSession} from './CDPSession.js'; import {isTargetClosedError} from './Connection.js'; -import {ConsoleMessage, ConsoleMessageType} from './ConsoleMessage.js'; +import {ConsoleMessage, type ConsoleMessageType} from './ConsoleMessage.js'; import {Coverage} from './Coverage.js'; -import {DeviceRequestPrompt} from './DeviceRequestPrompt.js'; +import {type DeviceRequestPrompt} from './DeviceRequestPrompt.js'; import {CdpDialog} from './Dialog.js'; import {EmulationManager} from './EmulationManager.js'; import {TargetCloseError} from './Errors.js'; import {FileChooser} from './FileChooser.js'; -import {CdpFrame} from './Frame.js'; +import {type CdpFrame} from './Frame.js'; import {FrameManager, FrameManagerEvent} from './FrameManager.js'; import {CdpKeyboard, CdpMouse, CdpTouchscreen} from './Input.js'; import {MAIN_WORLD} from './IsolatedWorlds.js'; import { - Credentials, - NetworkConditions, + type Credentials, + type NetworkConditions, NetworkManagerEvent, } from './NetworkManager.js'; -import {PDFOptions} from './PDFOptions.js'; -import {Viewport} from './PuppeteerViewport.js'; -import {CdpTarget} from './Target.js'; +import {type PDFOptions} from './PDFOptions.js'; +import {type Viewport} from './PuppeteerViewport.js'; +import {type CdpTarget} from './Target.js'; import {TargetManagerEvent} from './TargetManager.js'; -import {TaskQueue} from './TaskQueue.js'; +import {type TaskQueue} from './TaskQueue.js'; import {TimeoutSettings} from './TimeoutSettings.js'; import {Tracing} from './Tracing.js'; -import {BindingPayload, HandleFor} from './types.js'; +import {type BindingPayload, type HandleFor} from './types.js'; import { createCdpHandle, createClientError, diff --git a/packages/puppeteer-core/src/common/PredefinedNetworkConditions.ts b/packages/puppeteer-core/src/common/PredefinedNetworkConditions.ts index 69ee56ed..ed4469ad 100644 --- a/packages/puppeteer-core/src/common/PredefinedNetworkConditions.ts +++ b/packages/puppeteer-core/src/common/PredefinedNetworkConditions.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {NetworkConditions} from './NetworkManager.js'; +import {type NetworkConditions} from './NetworkManager.js'; /** * A list of network conditions to be used with diff --git a/packages/puppeteer-core/src/common/Puppeteer.ts b/packages/puppeteer-core/src/common/Puppeteer.ts index eb0ead6f..52df6738 100644 --- a/packages/puppeteer-core/src/common/Puppeteer.ts +++ b/packages/puppeteer-core/src/common/Puppeteer.ts @@ -14,14 +14,17 @@ * limitations under the License. */ -import {Browser} from '../api/Browser.js'; +import {type Browser} from '../api/Browser.js'; import { - BrowserConnectOptions, + type BrowserConnectOptions, _connectToCdpBrowser, } from './BrowserConnector.js'; -import {ConnectionTransport} from './ConnectionTransport.js'; -import {CustomQueryHandler, customQueryHandlers} from './CustomQueryHandler.js'; +import {type ConnectionTransport} from './ConnectionTransport.js'; +import { + type CustomQueryHandler, + customQueryHandlers, +} from './CustomQueryHandler.js'; /** * Settings that are common to the Puppeteer class, regardless of environment. diff --git a/packages/puppeteer-core/src/common/SecurityDetails.ts b/packages/puppeteer-core/src/common/SecurityDetails.ts index 4dbb7104..bd314dbf 100644 --- a/packages/puppeteer-core/src/common/SecurityDetails.ts +++ b/packages/puppeteer-core/src/common/SecurityDetails.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; /** * The SecurityDetails class represents the security details of a diff --git a/packages/puppeteer-core/src/common/Target.ts b/packages/puppeteer-core/src/common/Target.ts index 50480de9..ba3dd30d 100644 --- a/packages/puppeteer-core/src/common/Target.ts +++ b/packages/puppeteer-core/src/common/Target.ts @@ -14,20 +14,20 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; import type {Browser} from '../api/Browser.js'; import type {BrowserContext} from '../api/BrowserContext.js'; -import {CDPSession} from '../api/CDPSession.js'; -import {Page, PageEvent} from '../api/Page.js'; +import {type CDPSession} from '../api/CDPSession.js'; +import {type Page, PageEvent} from '../api/Page.js'; import {Target, TargetType} from '../api/Target.js'; import {Deferred} from '../util/Deferred.js'; import {CdpCDPSession} from './CDPSession.js'; import {CdpPage} from './Page.js'; -import {Viewport} from './PuppeteerViewport.js'; -import {TargetManager} from './TargetManager.js'; -import {TaskQueue} from './TaskQueue.js'; +import {type Viewport} from './PuppeteerViewport.js'; +import {type TargetManager} from './TargetManager.js'; +import {type TaskQueue} from './TaskQueue.js'; import {debugError} from './util.js'; import {WebWorker} from './WebWorker.js'; diff --git a/packages/puppeteer-core/src/common/TargetManager.ts b/packages/puppeteer-core/src/common/TargetManager.ts index 64d40517..22caefd7 100644 --- a/packages/puppeteer-core/src/common/TargetManager.ts +++ b/packages/puppeteer-core/src/common/TargetManager.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; +import {type CDPSession} from '../api/CDPSession.js'; -import {EventEmitter, EventType} from './EventEmitter.js'; -import {CdpTarget} from './Target.js'; +import {type EventEmitter, type EventType} from './EventEmitter.js'; +import {type CdpTarget} from './Target.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/TextQueryHandler.ts b/packages/puppeteer-core/src/common/TextQueryHandler.ts index 02ecdddc..39f70352 100644 --- a/packages/puppeteer-core/src/common/TextQueryHandler.ts +++ b/packages/puppeteer-core/src/common/TextQueryHandler.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {QueryHandler, QuerySelectorAll} from './QueryHandler.js'; +import {QueryHandler, type QuerySelectorAll} from './QueryHandler.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/Tracing.ts b/packages/puppeteer-core/src/common/Tracing.ts index c7c665a7..ac9ffff0 100644 --- a/packages/puppeteer-core/src/common/Tracing.ts +++ b/packages/puppeteer-core/src/common/Tracing.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {CDPSession} from '../api/CDPSession.js'; +import {type CDPSession} from '../api/CDPSession.js'; import {assert} from '../util/assert.js'; import {Deferred} from '../util/Deferred.js'; import {isErrorLike} from '../util/ErrorLike.js'; diff --git a/packages/puppeteer-core/src/common/WaitTask.ts b/packages/puppeteer-core/src/common/WaitTask.ts index 52619ff3..2230c0e6 100644 --- a/packages/puppeteer-core/src/common/WaitTask.ts +++ b/packages/puppeteer-core/src/common/WaitTask.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {ElementHandle} from '../api/ElementHandle.js'; -import {JSHandle} from '../api/JSHandle.js'; -import {Realm} from '../api/Realm.js'; +import {type ElementHandle} from '../api/ElementHandle.js'; +import {type JSHandle} from '../api/JSHandle.js'; +import {type Realm} from '../api/Realm.js'; import type {Poller} from '../injected/Poller.js'; import {Deferred} from '../util/Deferred.js'; import {isErrorLike} from '../util/ErrorLike.js'; @@ -24,7 +24,7 @@ import {stringifyFunction} from '../util/Function.js'; import {TimeoutError} from './Errors.js'; import {LazyArg} from './LazyArg.js'; -import {HandleFor} from './types.js'; +import {type HandleFor} from './types.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/WebWorker.ts b/packages/puppeteer-core/src/common/WebWorker.ts index 8ac97d34..6631a316 100644 --- a/packages/puppeteer-core/src/common/WebWorker.ts +++ b/packages/puppeteer-core/src/common/WebWorker.ts @@ -13,18 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; -import {CDPSession} from '../api/CDPSession.js'; -import {Realm} from '../api/Realm.js'; +import {type CDPSession} from '../api/CDPSession.js'; +import {type Realm} from '../api/Realm.js'; -import {ConsoleMessageType} from './ConsoleMessage.js'; -import {EventEmitter, EventType} from './EventEmitter.js'; +import {type ConsoleMessageType} from './ConsoleMessage.js'; +import {EventEmitter, type EventType} from './EventEmitter.js'; import {ExecutionContext} from './ExecutionContext.js'; import {IsolatedWorld} from './IsolatedWorld.js'; import {CdpJSHandle} from './JSHandle.js'; import {TimeoutSettings} from './TimeoutSettings.js'; -import {EvaluateFunc, HandleFor} from './types.js'; +import {type EvaluateFunc, type HandleFor} from './types.js'; import {debugError, withSourcePuppeteerURLIfNone} from './util.js'; /** diff --git a/packages/puppeteer-core/src/common/XPathQueryHandler.ts b/packages/puppeteer-core/src/common/XPathQueryHandler.ts index 34f824d5..24881f0a 100644 --- a/packages/puppeteer-core/src/common/XPathQueryHandler.ts +++ b/packages/puppeteer-core/src/common/XPathQueryHandler.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {QueryHandler, QuerySelectorAll} from './QueryHandler.js'; +import {QueryHandler, type QuerySelectorAll} from './QueryHandler.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/bidi/BidiOverCdp.ts b/packages/puppeteer-core/src/common/bidi/BidiOverCdp.ts index d56cdc44..5d7e4d7b 100644 --- a/packages/puppeteer-core/src/common/bidi/BidiOverCdp.ts +++ b/packages/puppeteer-core/src/common/bidi/BidiOverCdp.ts @@ -15,13 +15,13 @@ */ import * as BidiMapper from 'chromium-bidi/lib/cjs/bidiMapper/bidiMapper.js'; -import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; +import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import type {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js'; -import {CDPEvents, CDPSession} from '../../api/CDPSession.js'; -import {Connection as CdpConnection} from '../Connection.js'; +import {type CDPEvents, type CDPSession} from '../../api/CDPSession.js'; +import {type Connection as CdpConnection} from '../Connection.js'; import {TargetCloseError} from '../Errors.js'; -import {Handler} from '../EventEmitter.js'; +import {type Handler} from '../EventEmitter.js'; import {BidiConnection} from './Connection.js'; diff --git a/packages/puppeteer-core/src/common/bidi/Browser.ts b/packages/puppeteer-core/src/common/bidi/Browser.ts index 07df5b56..b6785ef4 100644 --- a/packages/puppeteer-core/src/common/bidi/Browser.ts +++ b/packages/puppeteer-core/src/common/bidi/Browser.ts @@ -14,30 +14,30 @@ * limitations under the License. */ -import {ChildProcess} from 'child_process'; +import {type ChildProcess} from 'child_process'; -import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; +import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import { Browser, - BrowserCloseCallback, - BrowserContextOptions, + type BrowserCloseCallback, + type BrowserContextOptions, BrowserEvent, } from '../../api/Browser.js'; import {BrowserContextEvent} from '../../api/BrowserContext.js'; -import {Page} from '../../api/Page.js'; -import {Target} from '../../api/Target.js'; -import {Handler} from '../EventEmitter.js'; -import {Viewport} from '../PuppeteerViewport.js'; +import {type Page} from '../../api/Page.js'; +import {type Target} from '../../api/Target.js'; +import {type Handler} from '../EventEmitter.js'; +import {type Viewport} from '../PuppeteerViewport.js'; import {BidiBrowserContext} from './BrowserContext.js'; import {BrowsingContext, BrowsingContextEvent} from './BrowsingContext.js'; -import {BidiConnection} from './Connection.js'; +import {type BidiConnection} from './Connection.js'; import { BiDiBrowserTarget, BiDiBrowsingContextTarget, BiDiPageTarget, - BidiTarget, + type BidiTarget, } from './Target.js'; import {debugError} from './utils.js'; diff --git a/packages/puppeteer-core/src/common/bidi/BrowserContext.ts b/packages/puppeteer-core/src/common/bidi/BrowserContext.ts index d202673a..59e94e4b 100644 --- a/packages/puppeteer-core/src/common/bidi/BrowserContext.ts +++ b/packages/puppeteer-core/src/common/bidi/BrowserContext.ts @@ -17,13 +17,13 @@ import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import {BrowserContext} from '../../api/BrowserContext.js'; -import {Page} from '../../api/Page.js'; -import {Target} from '../../api/Target.js'; -import {Viewport} from '../PuppeteerViewport.js'; +import {type Page} from '../../api/Page.js'; +import {type Target} from '../../api/Target.js'; +import {type Viewport} from '../PuppeteerViewport.js'; -import {BidiBrowser} from './Browser.js'; -import {BidiConnection} from './Connection.js'; -import {BidiPage} from './Page.js'; +import {type BidiBrowser} from './Browser.js'; +import {type BidiConnection} from './Connection.js'; +import {type BidiPage} from './Page.js'; interface BrowserContextOptions { defaultViewport: Viewport | null; diff --git a/packages/puppeteer-core/src/common/bidi/BrowsingContext.ts b/packages/puppeteer-core/src/common/bidi/BrowsingContext.ts index 4b7eadd2..ea532a08 100644 --- a/packages/puppeteer-core/src/common/bidi/BrowsingContext.ts +++ b/packages/puppeteer-core/src/common/bidi/BrowsingContext.ts @@ -1,17 +1,17 @@ import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; -import ProtocolMapping from 'devtools-protocol/types/protocol-mapping.js'; +import type ProtocolMapping from 'devtools-protocol/types/protocol-mapping.js'; import {CDPSession} from '../../api/CDPSession.js'; -import {WaitForOptions} from '../../api/Page.js'; +import {type WaitForOptions} from '../../api/Page.js'; import {assert} from '../../util/assert.js'; import {Deferred} from '../../util/Deferred.js'; -import {Connection as CdpConnection} from '../Connection.js'; +import {type Connection as CdpConnection} from '../Connection.js'; import {ProtocolError, TargetCloseError, TimeoutError} from '../Errors.js'; -import {EventType} from '../EventEmitter.js'; -import {PuppeteerLifeCycleEvent} from '../LifecycleWatcher.js'; +import {type EventType} from '../EventEmitter.js'; +import {type PuppeteerLifeCycleEvent} from '../LifecycleWatcher.js'; import {setPageContent, waitWithTimeout} from '../util.js'; -import {BidiConnection} from './Connection.js'; +import {type BidiConnection} from './Connection.js'; import {Realm} from './Realm.js'; import {debugError} from './utils.js'; diff --git a/packages/puppeteer-core/src/common/bidi/Connection.test.ts b/packages/puppeteer-core/src/common/bidi/Connection.test.ts index 9cf5d21d..84843e4e 100644 --- a/packages/puppeteer-core/src/common/bidi/Connection.test.ts +++ b/packages/puppeteer-core/src/common/bidi/Connection.test.ts @@ -18,7 +18,7 @@ import {describe, it} from 'node:test'; import expect from 'expect'; -import {ConnectionTransport} from '../ConnectionTransport.js'; +import {type ConnectionTransport} from '../ConnectionTransport.js'; import {BidiConnection} from './Connection.js'; diff --git a/packages/puppeteer-core/src/common/bidi/Connection.ts b/packages/puppeteer-core/src/common/bidi/Connection.ts index 4dbfbd85..ceba194a 100644 --- a/packages/puppeteer-core/src/common/bidi/Connection.ts +++ b/packages/puppeteer-core/src/common/bidi/Connection.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; +import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import {CallbackRegistry} from '../Connection.js'; -import {ConnectionTransport} from '../ConnectionTransport.js'; +import {type ConnectionTransport} from '../ConnectionTransport.js'; import {debug} from '../Debug.js'; import {EventEmitter} from '../EventEmitter.js'; -import {BrowsingContext, cdpSessions} from './BrowsingContext.js'; +import {type BrowsingContext, cdpSessions} from './BrowsingContext.js'; import {debugError} from './utils.js'; const debugProtocolSend = debug('puppeteer:webDriverBiDi:SEND ►'); diff --git a/packages/puppeteer-core/src/common/bidi/Dialog.ts b/packages/puppeteer-core/src/common/bidi/Dialog.ts index 4e9be951..768e2785 100644 --- a/packages/puppeteer-core/src/common/bidi/Dialog.ts +++ b/packages/puppeteer-core/src/common/bidi/Dialog.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; +import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import {Dialog} from '../../api/Dialog.js'; -import {BrowsingContext} from './BrowsingContext.js'; +import {type BrowsingContext} from './BrowsingContext.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/bidi/ElementHandle.ts b/packages/puppeteer-core/src/common/bidi/ElementHandle.ts index af2ed44c..fa4f1ab7 100644 --- a/packages/puppeteer-core/src/common/bidi/ElementHandle.ts +++ b/packages/puppeteer-core/src/common/bidi/ElementHandle.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; +import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; -import {AutofillData, ElementHandle} from '../../api/ElementHandle.js'; +import {type AutofillData, ElementHandle} from '../../api/ElementHandle.js'; import {throwIfDisposed} from '../../util/decorators.js'; -import {BidiFrame} from './Frame.js'; +import {type BidiFrame} from './Frame.js'; import {BidiJSHandle} from './JSHandle.js'; -import {Realm} from './Realm.js'; -import {Sandbox} from './Sandbox.js'; +import {type Realm} from './Realm.js'; +import {type Sandbox} from './Sandbox.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/bidi/EmulationManager.ts b/packages/puppeteer-core/src/common/bidi/EmulationManager.ts index b8321d34..227efe3c 100644 --- a/packages/puppeteer-core/src/common/bidi/EmulationManager.ts +++ b/packages/puppeteer-core/src/common/bidi/EmulationManager.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {BrowsingContext} from './BrowsingContext.js'; +import {type BrowsingContext} from './BrowsingContext.js'; interface Viewport { width: number; diff --git a/packages/puppeteer-core/src/common/bidi/ExposedFunction.ts b/packages/puppeteer-core/src/common/bidi/ExposedFunction.ts index a5727a90..aa52b687 100644 --- a/packages/puppeteer-core/src/common/bidi/ExposedFunction.ts +++ b/packages/puppeteer-core/src/common/bidi/ExposedFunction.ts @@ -19,10 +19,10 @@ import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import {assert} from '../../util/assert.js'; import {Deferred} from '../../util/Deferred.js'; import {interpolateFunction, stringifyFunction} from '../../util/Function.js'; -import {Awaitable, FlattenHandle} from '../types.js'; +import {type Awaitable, type FlattenHandle} from '../types.js'; -import {BidiConnection} from './Connection.js'; -import {BidiFrame} from './Frame.js'; +import {type BidiConnection} from './Connection.js'; +import {type BidiFrame} from './Frame.js'; import {BidiSerializer} from './Serializer.js'; import {debugError} from './utils.js'; diff --git a/packages/puppeteer-core/src/common/bidi/Frame.ts b/packages/puppeteer-core/src/common/bidi/Frame.ts index 8c7d8284..b3f674f7 100644 --- a/packages/puppeteer-core/src/common/bidi/Frame.ts +++ b/packages/puppeteer-core/src/common/bidi/Frame.ts @@ -16,28 +16,28 @@ import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; -import {CDPSession} from '../../api/CDPSession.js'; +import {type CDPSession} from '../../api/CDPSession.js'; import {Frame, throwIfDetached} from '../../api/Frame.js'; import {Deferred} from '../../util/Deferred.js'; import {UTILITY_WORLD_NAME} from '../FrameManager.js'; -import {PuppeteerLifeCycleEvent} from '../LifecycleWatcher.js'; -import {TimeoutSettings} from '../TimeoutSettings.js'; -import {Awaitable} from '../types.js'; +import {type PuppeteerLifeCycleEvent} from '../LifecycleWatcher.js'; +import {type TimeoutSettings} from '../TimeoutSettings.js'; +import {type Awaitable} from '../types.js'; import {waitForEvent} from '../util.js'; import { - BrowsingContext, + type BrowsingContext, getWaitUntilSingle, lifeCycleToSubscribedEvent, } from './BrowsingContext.js'; import {ExposeableFunction} from './ExposedFunction.js'; -import {BidiHTTPResponse} from './HTTPResponse.js'; -import {BidiPage} from './Page.js'; +import {type BidiHTTPResponse} from './HTTPResponse.js'; +import {type BidiPage} from './Page.js'; import { MAIN_SANDBOX, PUPPETEER_SANDBOX, Sandbox, - SandboxChart, + type SandboxChart, } from './Sandbox.js'; /** diff --git a/packages/puppeteer-core/src/common/bidi/HTTPRequest.ts b/packages/puppeteer-core/src/common/bidi/HTTPRequest.ts index 9d085a1e..78f281cb 100644 --- a/packages/puppeteer-core/src/common/bidi/HTTPRequest.ts +++ b/packages/puppeteer-core/src/common/bidi/HTTPRequest.ts @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; +import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; -import {Frame} from '../../api/Frame.js'; -import {HTTPRequest, ResourceType} from '../../api/HTTPRequest.js'; +import {type Frame} from '../../api/Frame.js'; +import {HTTPRequest, type ResourceType} from '../../api/HTTPRequest.js'; -import {BidiHTTPResponse} from './HTTPResponse.js'; +import {type BidiHTTPResponse} from './HTTPResponse.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/bidi/HTTPResponse.ts b/packages/puppeteer-core/src/common/bidi/HTTPResponse.ts index 12dce3fc..9e06cdcf 100644 --- a/packages/puppeteer-core/src/common/bidi/HTTPResponse.ts +++ b/packages/puppeteer-core/src/common/bidi/HTTPResponse.ts @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; -import Protocol from 'devtools-protocol'; +import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; +import type Protocol from 'devtools-protocol'; -import {Frame} from '../../api/Frame.js'; +import {type Frame} from '../../api/Frame.js'; import { HTTPResponse as HTTPResponse, - RemoteAddress, + type RemoteAddress, } from '../../api/HTTPResponse.js'; -import {BidiHTTPRequest} from './HTTPRequest.js'; +import {type BidiHTTPRequest} from './HTTPRequest.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/bidi/Input.ts b/packages/puppeteer-core/src/common/bidi/Input.ts index 89ed43aa..b60fbb0a 100644 --- a/packages/puppeteer-core/src/common/bidi/Input.ts +++ b/packages/puppeteer-core/src/common/bidi/Input.ts @@ -16,23 +16,23 @@ import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; -import {Point} from '../../api/ElementHandle.js'; +import {type Point} from '../../api/ElementHandle.js'; import { Keyboard as BaseKeyboard, Mouse as BaseMouse, Touchscreen as BaseTouchscreen, - KeyDownOptions, - KeyPressOptions, - KeyboardTypeOptions, + type KeyDownOptions, + type KeyPressOptions, + type KeyboardTypeOptions, MouseButton, - MouseClickOptions, - MouseMoveOptions, - MouseOptions, - MouseWheelOptions, + type MouseClickOptions, + type MouseMoveOptions, + type MouseOptions, + type MouseWheelOptions, } from '../../api/Input.js'; -import {KeyInput} from '../USKeyboardLayout.js'; +import {type KeyInput} from '../USKeyboardLayout.js'; -import {BrowsingContext} from './BrowsingContext.js'; +import {type BrowsingContext} from './BrowsingContext.js'; const enum InputId { Mouse = '__puppeteer_mouse', diff --git a/packages/puppeteer-core/src/common/bidi/JSHandle.ts b/packages/puppeteer-core/src/common/bidi/JSHandle.ts index ff96ec29..2d74000b 100644 --- a/packages/puppeteer-core/src/common/bidi/JSHandle.ts +++ b/packages/puppeteer-core/src/common/bidi/JSHandle.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; -import Protocol from 'devtools-protocol'; +import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; +import type Protocol from 'devtools-protocol'; -import {ElementHandle} from '../../api/ElementHandle.js'; +import {type ElementHandle} from '../../api/ElementHandle.js'; import {JSHandle} from '../../api/JSHandle.js'; -import {Realm} from './Realm.js'; -import {Sandbox} from './Sandbox.js'; +import {type Realm} from './Realm.js'; +import {type Sandbox} from './Sandbox.js'; import {BidiSerializer} from './Serializer.js'; import {releaseReference} from './utils.js'; diff --git a/packages/puppeteer-core/src/common/bidi/NetworkManager.ts b/packages/puppeteer-core/src/common/bidi/NetworkManager.ts index 0639b4d4..6f0d93b5 100644 --- a/packages/puppeteer-core/src/common/bidi/NetworkManager.ts +++ b/packages/puppeteer-core/src/common/bidi/NetworkManager.ts @@ -14,16 +14,20 @@ * limitations under the License. */ -import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; +import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; -import {EventEmitter, EventSubscription, EventType} from '../EventEmitter.js'; +import { + EventEmitter, + EventSubscription, + type EventType, +} from '../EventEmitter.js'; import {NetworkManagerEvent} from '../NetworkManager.js'; -import {BidiConnection} from './Connection.js'; -import {BidiFrame} from './Frame.js'; +import {type BidiConnection} from './Connection.js'; +import {type BidiFrame} from './Frame.js'; import {BidiHTTPRequest} from './HTTPRequest.js'; import {BidiHTTPResponse} from './HTTPResponse.js'; -import {BidiPage} from './Page.js'; +import {type BidiPage} from './Page.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/bidi/Page.ts b/packages/puppeteer-core/src/common/bidi/Page.ts index af656878..df3acfb8 100644 --- a/packages/puppeteer-core/src/common/bidi/Page.ts +++ b/packages/puppeteer-core/src/common/bidi/Page.ts @@ -16,34 +16,37 @@ import type {Readable} from 'stream'; -import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; -import Protocol from 'devtools-protocol'; +import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; +import type Protocol from 'devtools-protocol'; -import {CDPSession} from '../../api/CDPSession.js'; +import {type CDPSession} from '../../api/CDPSession.js'; import { - GeolocationOptions, - MediaFeature, - NewDocumentScriptEvaluation, + type GeolocationOptions, + type MediaFeature, + type NewDocumentScriptEvaluation, Page, PageEvent, - ScreenshotOptions, - WaitForOptions, + type ScreenshotOptions, + type WaitForOptions, } from '../../api/Page.js'; import {assert} from '../../util/assert.js'; import {Deferred} from '../../util/Deferred.js'; import {Accessibility} from '../Accessibility.js'; -import {ConsoleMessage, ConsoleMessageLocation} from '../ConsoleMessage.js'; +import { + ConsoleMessage, + type ConsoleMessageLocation, +} from '../ConsoleMessage.js'; import {Coverage} from '../Coverage.js'; import {EmulationManager as CdpEmulationManager} from '../EmulationManager.js'; import {TargetCloseError} from '../Errors.js'; -import {Handler} from '../EventEmitter.js'; +import {type Handler} from '../EventEmitter.js'; import {FrameTree} from '../FrameTree.js'; import {NetworkManagerEvent} from '../NetworkManager.js'; -import {PDFOptions} from '../PDFOptions.js'; -import {Viewport} from '../PuppeteerViewport.js'; +import {type PDFOptions} from '../PDFOptions.js'; +import {type Viewport} from '../PuppeteerViewport.js'; import {TimeoutSettings} from '../TimeoutSettings.js'; import {Tracing} from '../Tracing.js'; -import {Awaitable} from '../types.js'; +import {type Awaitable} from '../types.js'; import { debugError, evaluationString, @@ -53,19 +56,19 @@ import { waitWithTimeout, } from '../util.js'; -import {BidiBrowser} from './Browser.js'; -import {BidiBrowserContext} from './BrowserContext.js'; +import {type BidiBrowser} from './Browser.js'; +import {type BidiBrowserContext} from './BrowserContext.js'; import { - BrowsingContext, + type BrowsingContext, BrowsingContextEvent, CdpSessionWrapper, } from './BrowsingContext.js'; -import {BidiConnection} from './Connection.js'; +import {type BidiConnection} from './Connection.js'; import {BidiDialog} from './Dialog.js'; import {EmulationManager} from './EmulationManager.js'; import {BidiFrame} from './Frame.js'; -import {BidiHTTPRequest} from './HTTPRequest.js'; -import {BidiHTTPResponse} from './HTTPResponse.js'; +import {type BidiHTTPRequest} from './HTTPRequest.js'; +import {type BidiHTTPResponse} from './HTTPResponse.js'; import {Keyboard, Mouse, Touchscreen} from './Input.js'; import {BidiNetworkManager} from './NetworkManager.js'; import {createBidiHandle} from './Realm.js'; diff --git a/packages/puppeteer-core/src/common/bidi/Realm.ts b/packages/puppeteer-core/src/common/bidi/Realm.ts index 4c3550df..304e3f9a 100644 --- a/packages/puppeteer-core/src/common/bidi/Realm.ts +++ b/packages/puppeteer-core/src/common/bidi/Realm.ts @@ -1,20 +1,20 @@ import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; -import PuppeteerUtil from '../../injected/injected.js'; +import type PuppeteerUtil from '../../injected/injected.js'; import {stringifyFunction} from '../../util/Function.js'; -import {EventEmitter, EventType} from '../EventEmitter.js'; +import {EventEmitter, type EventType} from '../EventEmitter.js'; import {scriptInjector} from '../ScriptInjector.js'; -import {EvaluateFunc, HandleFor} from '../types.js'; +import {type EvaluateFunc, type HandleFor} from '../types.js'; import { PuppeteerURL, getSourcePuppeteerURLIfAvailable, isString, } from '../util.js'; -import {BidiConnection} from './Connection.js'; +import {type BidiConnection} from './Connection.js'; import {BidiElementHandle} from './ElementHandle.js'; import {BidiJSHandle} from './JSHandle.js'; -import {Sandbox} from './Sandbox.js'; +import {type Sandbox} from './Sandbox.js'; import {BidiSerializer} from './Serializer.js'; import {createEvaluationError} from './utils.js'; diff --git a/packages/puppeteer-core/src/common/bidi/Sandbox.ts b/packages/puppeteer-core/src/common/bidi/Sandbox.ts index efa0ace1..aaad4ef0 100644 --- a/packages/puppeteer-core/src/common/bidi/Sandbox.ts +++ b/packages/puppeteer-core/src/common/bidi/Sandbox.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -import {JSHandle} from '../../api/JSHandle.js'; +import {type JSHandle} from '../../api/JSHandle.js'; import {Realm} from '../../api/Realm.js'; -import {TimeoutSettings} from '../TimeoutSettings.js'; -import {EvaluateFunc, HandleFor} from '../types.js'; +import {type TimeoutSettings} from '../TimeoutSettings.js'; +import {type EvaluateFunc, type HandleFor} from '../types.js'; import {withSourcePuppeteerURLIfNone} from '../util.js'; -import {BrowsingContext} from './BrowsingContext.js'; -import {BidiFrame} from './Frame.js'; -import {Realm as BidiRealm} from './Realm.js'; +import {type BrowsingContext} from './BrowsingContext.js'; +import {type BidiFrame} from './Frame.js'; +import {type Realm as BidiRealm} from './Realm.js'; /** * A unique key for {@link SandboxChart} to denote the default world. * Realms are automatically created in the default sandbox. diff --git a/packages/puppeteer-core/src/common/bidi/Serializer.ts b/packages/puppeteer-core/src/common/bidi/Serializer.ts index ee10d5fc..3fcced34 100644 --- a/packages/puppeteer-core/src/common/bidi/Serializer.ts +++ b/packages/puppeteer-core/src/common/bidi/Serializer.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; +import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import {LazyArg} from '../LazyArg.js'; import {debugError, isDate, isPlainObject, isRegExp} from '../util.js'; import {BidiElementHandle} from './ElementHandle.js'; import {BidiJSHandle} from './JSHandle.js'; -import {Sandbox} from './Sandbox.js'; +import {type Sandbox} from './Sandbox.js'; /** * @internal diff --git a/packages/puppeteer-core/src/common/bidi/Target.ts b/packages/puppeteer-core/src/common/bidi/Target.ts index 03d1b472..f62d8a42 100644 --- a/packages/puppeteer-core/src/common/bidi/Target.ts +++ b/packages/puppeteer-core/src/common/bidi/Target.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {CDPSession} from '../../api/CDPSession.js'; +import {type CDPSession} from '../../api/CDPSession.js'; import {Target, TargetType} from '../../api/Target.js'; import type {WebWorker} from '../WebWorker.js'; -import {BidiBrowser} from './Browser.js'; -import {BidiBrowserContext} from './BrowserContext.js'; -import {BrowsingContext, CdpSessionWrapper} from './BrowsingContext.js'; +import {type BidiBrowser} from './Browser.js'; +import {type BidiBrowserContext} from './BrowserContext.js'; +import {type BrowsingContext, CdpSessionWrapper} from './BrowsingContext.js'; import {BidiPage} from './Page.js'; /** diff --git a/packages/puppeteer-core/src/common/bidi/utils.ts b/packages/puppeteer-core/src/common/bidi/utils.ts index f86c40bd..a24f4923 100644 --- a/packages/puppeteer-core/src/common/bidi/utils.ts +++ b/packages/puppeteer-core/src/common/bidi/utils.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; +import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import {debug} from '../Debug.js'; import {PuppeteerURL} from '../util.js'; -import {Realm} from './Realm.js'; +import {type Realm} from './Realm.js'; import {BidiSerializer} from './Serializer.js'; /** diff --git a/packages/puppeteer-core/src/common/util.ts b/packages/puppeteer-core/src/common/util.ts index 8757931d..9eda53ea 100644 --- a/packages/puppeteer-core/src/common/util.ts +++ b/packages/puppeteer-core/src/common/util.ts @@ -18,11 +18,16 @@ import type {Readable} from 'stream'; import type {Protocol} from 'devtools-protocol'; -import {map, NEVER, Observable, timer} from '../../third_party/rxjs/rxjs.js'; +import { + map, + NEVER, + timer, + type Observable, +} from '../../third_party/rxjs/rxjs.js'; import type {CDPSession} from '../api/CDPSession.js'; import type {ElementHandle} from '../api/ElementHandle.js'; import type {JSHandle} from '../api/JSHandle.js'; -import {Page} from '../api/Page.js'; +import {type Page} from '../api/Page.js'; import {isNode} from '../environment.js'; import {assert} from '../util/assert.js'; import {Deferred} from '../util/Deferred.js'; @@ -32,9 +37,9 @@ import {debug} from './Debug.js'; import {CdpElementHandle} from './ElementHandle.js'; import {TimeoutError} from './Errors.js'; import {EventSubscription} from './EventEmitter.js'; -import {IsolatedWorld} from './IsolatedWorld.js'; +import {type IsolatedWorld} from './IsolatedWorld.js'; import {CdpJSHandle} from './JSHandle.js'; -import {Awaitable} from './types.js'; +import {type Awaitable} from './types.js'; /** * @internal diff --git a/packages/puppeteer-core/src/injected/PQuerySelector.ts b/packages/puppeteer-core/src/injected/PQuerySelector.ts index f345442f..597cbe8b 100644 --- a/packages/puppeteer-core/src/injected/PQuerySelector.ts +++ b/packages/puppeteer-core/src/injected/PQuerySelector.ts @@ -20,13 +20,13 @@ import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js'; import {ariaQuerySelectorAll} from './ARIAQuerySelector.js'; import {customQuerySelectors} from './CustomQuerySelector.js'; import { - ComplexPSelector, - ComplexPSelectorList, - CompoundPSelector, - CSSSelector, + type ComplexPSelector, + type ComplexPSelectorList, + type CompoundPSelector, + type CSSSelector, parsePSelectors, PCombinator, - PPseudoSelector, + type PPseudoSelector, } from './PSelectorParser.js'; import {textQuerySelectorAll} from './TextQuerySelector.js'; import {pierce, pierceAll} from './util.js'; diff --git a/packages/puppeteer-core/src/injected/PSelectorParser.ts b/packages/puppeteer-core/src/injected/PSelectorParser.ts index f1bcee33..cea09924 100644 --- a/packages/puppeteer-core/src/injected/PSelectorParser.ts +++ b/packages/puppeteer-core/src/injected/PSelectorParser.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {Token, tokenize, TOKENS, stringify} from 'parsel-js'; +import {type Token, tokenize, TOKENS, stringify} from 'parsel-js'; export type CSSSelector = string; export interface PPseudoSelector { diff --git a/packages/puppeteer-core/src/node/ChromeLauncher.ts b/packages/puppeteer-core/src/node/ChromeLauncher.ts index f50846b7..88ab32ac 100644 --- a/packages/puppeteer-core/src/node/ChromeLauncher.ts +++ b/packages/puppeteer-core/src/node/ChromeLauncher.ts @@ -23,18 +23,18 @@ import { ChromeReleaseChannel as BrowsersChromeReleaseChannel, } from '@puppeteer/browsers'; -import {Browser} from '../api/Browser.js'; +import {type Browser} from '../api/Browser.js'; import {debugError} from '../common/util.js'; import {USE_TAB_TARGET} from '../environment.js'; import {assert} from '../util/assert.js'; import { - BrowserLaunchArgumentOptions, - ChromeReleaseChannel, - PuppeteerNodeLaunchOptions, + type BrowserLaunchArgumentOptions, + type ChromeReleaseChannel, + type PuppeteerNodeLaunchOptions, } from './LaunchOptions.js'; -import {ProductLauncher, ResolvedLaunchArgs} from './ProductLauncher.js'; -import {PuppeteerNode} from './PuppeteerNode.js'; +import {ProductLauncher, type ResolvedLaunchArgs} from './ProductLauncher.js'; +import {type PuppeteerNode} from './PuppeteerNode.js'; import {rm} from './util/fs.js'; /** diff --git a/packages/puppeteer-core/src/node/FirefoxLauncher.ts b/packages/puppeteer-core/src/node/FirefoxLauncher.ts index 004d78bd..0ef30867 100644 --- a/packages/puppeteer-core/src/node/FirefoxLauncher.ts +++ b/packages/puppeteer-core/src/node/FirefoxLauncher.ts @@ -31,11 +31,11 @@ import {debugError} from '../common/util.js'; import {assert} from '../util/assert.js'; import { - BrowserLaunchArgumentOptions, - PuppeteerNodeLaunchOptions, + type BrowserLaunchArgumentOptions, + type PuppeteerNodeLaunchOptions, } from './LaunchOptions.js'; -import {ProductLauncher, ResolvedLaunchArgs} from './ProductLauncher.js'; -import {PuppeteerNode} from './PuppeteerNode.js'; +import {ProductLauncher, type ResolvedLaunchArgs} from './ProductLauncher.js'; +import {type PuppeteerNode} from './PuppeteerNode.js'; import {rm} from './util/fs.js'; /** diff --git a/packages/puppeteer-core/src/node/LaunchOptions.ts b/packages/puppeteer-core/src/node/LaunchOptions.ts index b7f97ad9..0b0f8f26 100644 --- a/packages/puppeteer-core/src/node/LaunchOptions.ts +++ b/packages/puppeteer-core/src/node/LaunchOptions.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import {BrowserConnectOptions} from '../common/BrowserConnector.js'; -import {Product} from '../common/Product.js'; +import {type BrowserConnectOptions} from '../common/BrowserConnector.js'; +import {type Product} from '../common/Product.js'; /** * Launcher options that only apply to Chrome. diff --git a/packages/puppeteer-core/src/node/PipeTransport.ts b/packages/puppeteer-core/src/node/PipeTransport.ts index 1d6c8126..3b709609 100644 --- a/packages/puppeteer-core/src/node/PipeTransport.ts +++ b/packages/puppeteer-core/src/node/PipeTransport.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {ConnectionTransport} from '../common/ConnectionTransport.js'; +import {type ConnectionTransport} from '../common/ConnectionTransport.js'; import {EventSubscription} from '../common/EventEmitter.js'; import {debugError} from '../common/util.js'; import {assert} from '../util/assert.js'; diff --git a/packages/puppeteer-core/src/node/ProductLauncher.ts b/packages/puppeteer-core/src/node/ProductLauncher.ts index 66b11c3a..eef368c3 100644 --- a/packages/puppeteer-core/src/node/ProductLauncher.ts +++ b/packages/puppeteer-core/src/node/ProductLauncher.ts @@ -26,22 +26,22 @@ import { computeExecutablePath, } from '@puppeteer/browsers'; -import {Browser, BrowserCloseCallback} from '../api/Browser.js'; +import {type Browser, type BrowserCloseCallback} from '../api/Browser.js'; import {CdpBrowser} from '../common/Browser.js'; import {Connection} from '../common/Connection.js'; import {TimeoutError} from '../common/Errors.js'; import {NodeWebSocketTransport as WebSocketTransport} from '../common/NodeWebSocketTransport.js'; -import {Product} from '../common/Product.js'; -import {Viewport} from '../common/PuppeteerViewport.js'; +import {type Product} from '../common/Product.js'; +import {type Viewport} from '../common/PuppeteerViewport.js'; import {debugError} from '../common/util.js'; import { - BrowserLaunchArgumentOptions, - ChromeReleaseChannel, - PuppeteerNodeLaunchOptions, + type BrowserLaunchArgumentOptions, + type ChromeReleaseChannel, + type PuppeteerNodeLaunchOptions, } from './LaunchOptions.js'; import {PipeTransport} from './PipeTransport.js'; -import {PuppeteerNode} from './PuppeteerNode.js'; +import {type PuppeteerNode} from './PuppeteerNode.js'; /** * @internal diff --git a/packages/puppeteer-core/src/node/PuppeteerNode.ts b/packages/puppeteer-core/src/node/PuppeteerNode.ts index 6660a9f0..94d50333 100644 --- a/packages/puppeteer-core/src/node/PuppeteerNode.ts +++ b/packages/puppeteer-core/src/node/PuppeteerNode.ts @@ -22,13 +22,13 @@ import { uninstall, } from '@puppeteer/browsers'; -import {Browser} from '../api/Browser.js'; -import {BrowserConnectOptions} from '../common/BrowserConnector.js'; -import {Configuration} from '../common/Configuration.js'; -import {Product} from '../common/Product.js'; +import {type Browser} from '../api/Browser.js'; +import {type BrowserConnectOptions} from '../common/BrowserConnector.js'; +import {type Configuration} from '../common/Configuration.js'; +import {type Product} from '../common/Product.js'; import { - CommonPuppeteerSettings, - ConnectOptions, + type CommonPuppeteerSettings, + type ConnectOptions, Puppeteer, } from '../common/Puppeteer.js'; import {PUPPETEER_REVISIONS} from '../revisions.js'; @@ -36,11 +36,11 @@ import {PUPPETEER_REVISIONS} from '../revisions.js'; import {ChromeLauncher} from './ChromeLauncher.js'; import {FirefoxLauncher} from './FirefoxLauncher.js'; import { - BrowserLaunchArgumentOptions, - ChromeReleaseChannel, - LaunchOptions, + type BrowserLaunchArgumentOptions, + type ChromeReleaseChannel, + type LaunchOptions, } from './LaunchOptions.js'; -import {ProductLauncher} from './ProductLauncher.js'; +import {type ProductLauncher} from './ProductLauncher.js'; /** * @public diff --git a/packages/puppeteer-core/src/util/AsyncIterableUtil.ts b/packages/puppeteer-core/src/util/AsyncIterableUtil.ts index 5b06b3ab..4d2b9a2a 100644 --- a/packages/puppeteer-core/src/util/AsyncIterableUtil.ts +++ b/packages/puppeteer-core/src/util/AsyncIterableUtil.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {AwaitableIterable} from '../common/types.js'; +import {type AwaitableIterable} from '../common/types.js'; /** * @internal diff --git a/packages/puppeteer-core/src/util/decorators.ts b/packages/puppeteer-core/src/util/decorators.ts index bdf28436..84041742 100644 --- a/packages/puppeteer-core/src/util/decorators.ts +++ b/packages/puppeteer-core/src/util/decorators.ts @@ -15,7 +15,7 @@ */ import {Symbol} from '../../third_party/disposablestack/disposablestack.js'; -import {Disposed, Moveable} from '../common/types.js'; +import {type Disposed, type Moveable} from '../common/types.js'; const instances = new WeakSet(); diff --git a/packages/puppeteer/src/getConfiguration.ts b/packages/puppeteer/src/getConfiguration.ts index edcba3fb..23d06628 100644 --- a/packages/puppeteer/src/getConfiguration.ts +++ b/packages/puppeteer/src/getConfiguration.ts @@ -18,7 +18,7 @@ import {homedir} from 'os'; import {join} from 'path'; import {cosmiconfigSync} from 'cosmiconfig'; -import {Configuration, Product} from 'puppeteer-core'; +import {type Configuration, type Product} from 'puppeteer-core'; /** * @internal diff --git a/packages/puppeteer/src/node/install.ts b/packages/puppeteer/src/node/install.ts index 63458543..c722c555 100644 --- a/packages/puppeteer/src/node/install.ts +++ b/packages/puppeteer/src/node/install.ts @@ -21,7 +21,7 @@ import { makeProgressCallback, detectBrowserPlatform, } from '@puppeteer/browsers'; -import {Product} from 'puppeteer-core'; +import {type Product} from 'puppeteer-core'; import {PUPPETEER_REVISIONS} from 'puppeteer-core/internal/revisions.js'; import {getConfiguration} from '../getConfiguration.js'; diff --git a/packages/testserver/src/index.ts b/packages/testserver/src/index.ts index 5304e91e..cc4c2445 100644 --- a/packages/testserver/src/index.ts +++ b/packages/testserver/src/index.ts @@ -18,23 +18,23 @@ import assert from 'assert'; import {readFile, readFileSync} from 'fs'; import { createServer as createHttpServer, - IncomingMessage, - RequestListener, - Server as HttpServer, - ServerResponse, + type IncomingMessage, + type RequestListener, + type Server as HttpServer, + type ServerResponse, } from 'http'; import { createServer as createHttpsServer, - Server as HttpsServer, - ServerOptions as HttpsServerOptions, + type Server as HttpsServer, + type ServerOptions as HttpsServerOptions, } from 'https'; -import {AddressInfo} from 'net'; +import {type AddressInfo} from 'net'; import {join} from 'path'; -import {Duplex} from 'stream'; +import {type Duplex} from 'stream'; import {gzip} from 'zlib'; import {getType as getMimeType} from 'mime'; -import {Server as WebSocketServer, WebSocket} from 'ws'; +import {Server as WebSocketServer, type WebSocket} from 'ws'; interface Subscriber { resolve: (msg: IncomingMessage) => void; diff --git a/test-d/CommonEventEmitter.test-d.ts b/test-d/CommonEventEmitter.test-d.ts index 060a4d24..3d5f5895 100644 --- a/test-d/CommonEventEmitter.test-d.ts +++ b/test-d/CommonEventEmitter.test-d.ts @@ -1,7 +1,11 @@ // eslint-disable-next-line no-restricted-imports import {EventEmitter as NodeEventEmitter} from 'node:events'; -import {CommonEventEmitter, EventEmitter, EventType} from 'puppeteer'; +import { + type CommonEventEmitter, + type EventEmitter, + type EventType, +} from 'puppeteer'; import {expectAssignable} from 'tsd'; declare const emitter: EventEmitter>; diff --git a/test-d/ElementHandle.test-d.ts b/test-d/ElementHandle.test-d.ts index e23e6667..bf063e41 100644 --- a/test-d/ElementHandle.test-d.ts +++ b/test-d/ElementHandle.test-d.ts @@ -1,4 +1,4 @@ -import {ElementHandle} from 'puppeteer'; +import {type ElementHandle} from 'puppeteer'; import {expectNotType, expectType} from 'tsd'; declare const handle: ElementHandle; diff --git a/test-d/JSHandle.test-d.ts b/test-d/JSHandle.test-d.ts index 0e1b6385..825e5233 100644 --- a/test-d/JSHandle.test-d.ts +++ b/test-d/JSHandle.test-d.ts @@ -1,4 +1,4 @@ -import {ElementHandle, JSHandle} from 'puppeteer'; +import {type ElementHandle, type JSHandle} from 'puppeteer'; import {expectNotAssignable, expectNotType, expectType} from 'tsd'; declare const handle: JSHandle; diff --git a/test-d/puppeteer.test-d.ts b/test-d/puppeteer.test-d.ts index 11128f15..334b2899 100644 --- a/test-d/puppeteer.test-d.ts +++ b/test-d/puppeteer.test-d.ts @@ -1,8 +1,8 @@ import puppeteer, { - connect, - defaultArgs, - executablePath, - launch, + type connect, + type defaultArgs, + type executablePath, + type launch, } from 'puppeteer'; import {expectType} from 'tsd'; diff --git a/test/src/TargetManager.spec.ts b/test/src/TargetManager.spec.ts index 48996c1e..0d3403d2 100644 --- a/test/src/TargetManager.spec.ts +++ b/test/src/TargetManager.spec.ts @@ -15,7 +15,7 @@ */ import expect from 'expect'; -import {CdpBrowser} from 'puppeteer-core/internal/common/Browser.js'; +import {type CdpBrowser} from 'puppeteer-core/internal/common/Browser.js'; import {getTestState, launch} from './mocha-utils.js'; import {attachFrame} from './utils.js'; diff --git a/test/src/accessibility.spec.ts b/test/src/accessibility.spec.ts index ce5f17f0..bfdb709e 100644 --- a/test/src/accessibility.spec.ts +++ b/test/src/accessibility.spec.ts @@ -17,7 +17,7 @@ import assert from 'assert'; import expect from 'expect'; -import {SerializedAXNode} from 'puppeteer-core/internal/common/Accessibility.js'; +import {type SerializedAXNode} from 'puppeteer-core/internal/common/Accessibility.js'; import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; diff --git a/test/src/chromiumonly.spec.ts b/test/src/chromiumonly.spec.ts index eaa9853f..86e88471 100644 --- a/test/src/chromiumonly.spec.ts +++ b/test/src/chromiumonly.spec.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {IncomingMessage} from 'http'; +import {type IncomingMessage} from 'http'; import expect from 'expect'; import {Deferred} from 'puppeteer-core/internal/util/Deferred.js'; diff --git a/test/src/frame.spec.ts b/test/src/frame.spec.ts index 19b5474a..e7e77eba 100644 --- a/test/src/frame.spec.ts +++ b/test/src/frame.spec.ts @@ -16,7 +16,7 @@ import expect from 'expect'; import {CDPSession} from 'puppeteer-core/internal/api/CDPSession.js'; -import {Frame} from 'puppeteer-core/internal/api/Frame.js'; +import {type Frame} from 'puppeteer-core/internal/api/Frame.js'; import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; import { diff --git a/test/src/headful.spec.ts b/test/src/headful.spec.ts index 5a00849c..92d55739 100644 --- a/test/src/headful.spec.ts +++ b/test/src/headful.spec.ts @@ -20,7 +20,7 @@ import path from 'path'; import expect from 'expect'; import {CDPSessionEvent} from 'puppeteer-core/internal/api/CDPSession.js'; -import {PuppeteerLaunchOptions} from 'puppeteer-core/internal/node/PuppeteerNode.js'; +import {type PuppeteerLaunchOptions} from 'puppeteer-core/internal/node/PuppeteerNode.js'; import {rmSync} from 'puppeteer-core/internal/node/util/fs.js'; import {getTestState, isHeadless, launch} from './mocha-utils.js'; diff --git a/test/src/idle_override.spec.ts b/test/src/idle_override.spec.ts index bd941307..b56aa9f8 100644 --- a/test/src/idle_override.spec.ts +++ b/test/src/idle_override.spec.ts @@ -15,8 +15,8 @@ */ import expect from 'expect'; -import {ElementHandle} from 'puppeteer-core/internal/api/ElementHandle.js'; -import {Page} from 'puppeteer-core/internal/api/Page.js'; +import {type ElementHandle} from 'puppeteer-core/internal/api/ElementHandle.js'; +import {type Page} from 'puppeteer-core/internal/api/Page.js'; import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; diff --git a/test/src/ignorehttpserrors.spec.ts b/test/src/ignorehttpserrors.spec.ts index 0604a149..a970b259 100644 --- a/test/src/ignorehttpserrors.spec.ts +++ b/test/src/ignorehttpserrors.spec.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {TLSSocket} from 'tls'; +import {type TLSSocket} from 'tls'; import expect from 'expect'; -import {HTTPResponse} from 'puppeteer-core/internal/api/HTTPResponse.js'; +import {type HTTPResponse} from 'puppeteer-core/internal/api/HTTPResponse.js'; import {launch} from './mocha-utils.js'; diff --git a/test/src/keyboard.spec.ts b/test/src/keyboard.spec.ts index ae0aaa63..fa6f5102 100644 --- a/test/src/keyboard.spec.ts +++ b/test/src/keyboard.spec.ts @@ -17,7 +17,7 @@ import os from 'os'; import expect from 'expect'; -import {KeyInput} from 'puppeteer-core/internal/common/USKeyboardLayout.js'; +import {type KeyInput} from 'puppeteer-core/internal/common/USKeyboardLayout.js'; import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; import {attachFrame} from './utils.js'; diff --git a/test/src/launcher.spec.ts b/test/src/launcher.spec.ts index 79e33e28..d38f6338 100644 --- a/test/src/launcher.spec.ts +++ b/test/src/launcher.spec.ts @@ -18,11 +18,11 @@ import fs from 'fs'; import {mkdtemp, readFile, writeFile} from 'fs/promises'; import os from 'os'; import path from 'path'; -import {TLSSocket} from 'tls'; +import {type TLSSocket} from 'tls'; import expect from 'expect'; import {TimeoutError} from 'puppeteer'; -import {Page} from 'puppeteer-core/internal/api/Page.js'; +import {type Page} from 'puppeteer-core/internal/api/Page.js'; import {rmSync} from 'puppeteer-core/internal/node/util/fs.js'; import sinon from 'sinon'; diff --git a/test/src/mocha-utils.ts b/test/src/mocha-utils.ts index b948fd0f..856a2da2 100644 --- a/test/src/mocha-utils.ts +++ b/test/src/mocha-utils.ts @@ -18,20 +18,20 @@ import fs from 'fs'; import path from 'path'; import {TestServer} from '@pptr/testserver'; -import {Protocol} from 'devtools-protocol'; +import {type Protocol} from 'devtools-protocol'; import expect from 'expect'; -import * as Mocha from 'mocha'; +import type * as Mocha from 'mocha'; import puppeteer from 'puppeteer/lib/cjs/puppeteer/puppeteer.js'; -import {Browser} from 'puppeteer-core/internal/api/Browser.js'; -import {BrowserContext} from 'puppeteer-core/internal/api/BrowserContext.js'; -import {Page} from 'puppeteer-core/internal/api/Page.js'; +import {type Browser} from 'puppeteer-core/internal/api/Browser.js'; +import {type BrowserContext} from 'puppeteer-core/internal/api/BrowserContext.js'; +import {type Page} from 'puppeteer-core/internal/api/Page.js'; import { setLogCapture, getCapturedLogs, } from 'puppeteer-core/internal/common/Debug.js'; import { - PuppeteerLaunchOptions, - PuppeteerNode, + type PuppeteerLaunchOptions, + type PuppeteerNode, } from 'puppeteer-core/internal/node/PuppeteerNode.js'; import {rmSync} from 'puppeteer-core/internal/node/util/fs.js'; import {Deferred} from 'puppeteer-core/internal/util/Deferred.js'; diff --git a/test/src/mouse.spec.ts b/test/src/mouse.spec.ts index 7a598fbd..738f5d78 100644 --- a/test/src/mouse.spec.ts +++ b/test/src/mouse.spec.ts @@ -17,8 +17,8 @@ import os from 'os'; import expect from 'expect'; import {MouseButton} from 'puppeteer-core/internal/api/Input.js'; -import {Page} from 'puppeteer-core/internal/api/Page.js'; -import {KeyInput} from 'puppeteer-core/internal/common/USKeyboardLayout.js'; +import {type Page} from 'puppeteer-core/internal/api/Page.js'; +import {type KeyInput} from 'puppeteer-core/internal/common/USKeyboardLayout.js'; import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; diff --git a/test/src/navigation.spec.ts b/test/src/navigation.spec.ts index 076530ae..cac068f1 100644 --- a/test/src/navigation.spec.ts +++ b/test/src/navigation.spec.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {ServerResponse} from 'http'; +import {type ServerResponse} from 'http'; import expect from 'expect'; -import {Frame, TimeoutError} from 'puppeteer'; -import {HTTPRequest} from 'puppeteer-core/internal/api/HTTPRequest.js'; +import {type Frame, TimeoutError} from 'puppeteer'; +import {type HTTPRequest} from 'puppeteer-core/internal/api/HTTPRequest.js'; import {Deferred} from 'puppeteer-core/internal/util/Deferred.js'; import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; diff --git a/test/src/network.spec.ts b/test/src/network.spec.ts index 753d05a9..170885bc 100644 --- a/test/src/network.spec.ts +++ b/test/src/network.spec.ts @@ -15,12 +15,12 @@ */ import fs from 'fs'; -import {ServerResponse} from 'http'; +import {type ServerResponse} from 'http'; import path from 'path'; import expect from 'expect'; -import {HTTPRequest} from 'puppeteer-core/internal/api/HTTPRequest.js'; -import {HTTPResponse} from 'puppeteer-core/internal/api/HTTPResponse.js'; +import {type HTTPRequest} from 'puppeteer-core/internal/api/HTTPRequest.js'; +import {type HTTPResponse} from 'puppeteer-core/internal/api/HTTPResponse.js'; import {getTestState, launch, setupTestBrowserHooks} from './mocha-utils.js'; import {attachFrame, isFavicon, waitEvent} from './utils.js'; diff --git a/test/src/oopif.spec.ts b/test/src/oopif.spec.ts index dc2674c2..d3219879 100644 --- a/test/src/oopif.spec.ts +++ b/test/src/oopif.spec.ts @@ -15,8 +15,8 @@ */ import expect from 'expect'; -import {BrowserContext} from 'puppeteer-core/internal/api/BrowserContext.js'; -import {CdpTarget} from 'puppeteer-core/internal/common/Target.js'; +import {type BrowserContext} from 'puppeteer-core/internal/api/BrowserContext.js'; +import {type CdpTarget} from 'puppeteer-core/internal/common/Target.js'; import {describeWithDebugLogs, getTestState, launch} from './mocha-utils.js'; import {attachFrame, detachFrame, navigateFrame} from './utils.js'; diff --git a/test/src/page.spec.ts b/test/src/page.spec.ts index dca2e0f1..ac9885c9 100644 --- a/test/src/page.spec.ts +++ b/test/src/page.spec.ts @@ -15,15 +15,15 @@ */ import assert from 'assert'; import fs from 'fs'; -import {ServerResponse} from 'http'; +import {type ServerResponse} from 'http'; import path from 'path'; import expect from 'expect'; import {KnownDevices, TimeoutError} from 'puppeteer'; import {CDPSession} from 'puppeteer-core/internal/api/CDPSession.js'; -import {Metrics, Page} from 'puppeteer-core/internal/api/Page.js'; -import {ConsoleMessage} from 'puppeteer-core/internal/common/ConsoleMessage.js'; -import {CdpPage} from 'puppeteer-core/internal/common/Page.js'; +import {type Metrics, type Page} from 'puppeteer-core/internal/api/Page.js'; +import {type ConsoleMessage} from 'puppeteer-core/internal/common/ConsoleMessage.js'; +import {type CdpPage} from 'puppeteer-core/internal/common/Page.js'; import sinon from 'sinon'; import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; diff --git a/test/src/proxy.spec.ts b/test/src/proxy.spec.ts index 5c117be2..b70e4256 100644 --- a/test/src/proxy.spec.ts +++ b/test/src/proxy.spec.ts @@ -19,7 +19,7 @@ import type {Server, IncomingMessage, ServerResponse} from 'http'; import type {AddressInfo} from 'net'; import os from 'os'; -import {TestServer} from '@pptr/testserver'; +import {type TestServer} from '@pptr/testserver'; import expect from 'expect'; import {getTestState, launch} from './mocha-utils.js'; diff --git a/test/src/queryhandler.spec.ts b/test/src/queryhandler.spec.ts index b78004af..f91f6402 100644 --- a/test/src/queryhandler.spec.ts +++ b/test/src/queryhandler.spec.ts @@ -17,7 +17,7 @@ import assert from 'assert'; import expect from 'expect'; import {Puppeteer} from 'puppeteer-core'; -import {ElementHandle} from 'puppeteer-core/internal/api/ElementHandle.js'; +import {type ElementHandle} from 'puppeteer-core/internal/api/ElementHandle.js'; import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; diff --git a/test/src/requestinterception-experimental.spec.ts b/test/src/requestinterception-experimental.spec.ts index 2c3c5afa..43d41659 100644 --- a/test/src/requestinterception-experimental.spec.ts +++ b/test/src/requestinterception-experimental.spec.ts @@ -19,11 +19,11 @@ import path from 'path'; import expect from 'expect'; import { - ActionResult, - HTTPRequest, + type ActionResult, + type HTTPRequest, InterceptResolutionAction, } from 'puppeteer-core/internal/api/HTTPRequest.js'; -import {ConsoleMessage} from 'puppeteer-core/internal/common/ConsoleMessage.js'; +import {type ConsoleMessage} from 'puppeteer-core/internal/common/ConsoleMessage.js'; import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; import {isFavicon, waitEvent} from './utils.js'; diff --git a/test/src/requestinterception.spec.ts b/test/src/requestinterception.spec.ts index 04ede17d..ebe8b9cd 100644 --- a/test/src/requestinterception.spec.ts +++ b/test/src/requestinterception.spec.ts @@ -18,8 +18,8 @@ import fs from 'fs'; import path from 'path'; import expect from 'expect'; -import {HTTPRequest} from 'puppeteer-core/internal/api/HTTPRequest.js'; -import {ConsoleMessage} from 'puppeteer-core/internal/common/ConsoleMessage.js'; +import {type HTTPRequest} from 'puppeteer-core/internal/api/HTTPRequest.js'; +import {type ConsoleMessage} from 'puppeteer-core/internal/common/ConsoleMessage.js'; import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; import {isFavicon, waitEvent} from './utils.js'; diff --git a/test/src/target.spec.ts b/test/src/target.spec.ts index 8694e9a9..09581f2c 100644 --- a/test/src/target.spec.ts +++ b/test/src/target.spec.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {ServerResponse} from 'http'; +import {type ServerResponse} from 'http'; import expect from 'expect'; -import {Target, TimeoutError} from 'puppeteer'; -import {Page} from 'puppeteer-core/internal/api/Page.js'; +import {type Target, TimeoutError} from 'puppeteer'; +import {type Page} from 'puppeteer-core/internal/api/Page.js'; import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; import {waitEvent} from './utils.js'; diff --git a/test/src/touchscreen.spec.ts b/test/src/touchscreen.spec.ts index 749edecf..05a62b32 100644 --- a/test/src/touchscreen.spec.ts +++ b/test/src/touchscreen.spec.ts @@ -15,7 +15,7 @@ */ import expect from 'expect'; -import {KnownDevices, BoundingBox} from 'puppeteer'; +import {KnownDevices, type BoundingBox} from 'puppeteer'; import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; diff --git a/test/src/utils.ts b/test/src/utils.ts index bc36604b..4322833b 100644 --- a/test/src/utils.ts +++ b/test/src/utils.ts @@ -17,9 +17,9 @@ import path from 'path'; import expect from 'expect'; -import {Frame} from 'puppeteer-core/internal/api/Frame.js'; -import {Page} from 'puppeteer-core/internal/api/Page.js'; -import {EventEmitter} from 'puppeteer-core/internal/common/EventEmitter.js'; +import {type Frame} from 'puppeteer-core/internal/api/Frame.js'; +import {type Page} from 'puppeteer-core/internal/api/Page.js'; +import {type EventEmitter} from 'puppeteer-core/internal/common/EventEmitter.js'; import {Deferred} from 'puppeteer-core/internal/util/Deferred.js'; import {compare} from './golden-utils.js'; diff --git a/test/src/worker.spec.ts b/test/src/worker.spec.ts index 16e38ef6..39504934 100644 --- a/test/src/worker.spec.ts +++ b/test/src/worker.spec.ts @@ -15,8 +15,8 @@ */ import expect from 'expect'; -import {ConsoleMessage} from 'puppeteer-core/internal/common/ConsoleMessage.js'; -import {WebWorker} from 'puppeteer-core/internal/common/WebWorker.js'; +import {type ConsoleMessage} from 'puppeteer-core/internal/common/ConsoleMessage.js'; +import {type WebWorker} from 'puppeteer-core/internal/common/WebWorker.js'; import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; import {waitEvent} from './utils.js'; diff --git a/tools/internal/custom_markdown_documenter.ts b/tools/internal/custom_markdown_documenter.ts index 2b6edd1f..bfdfd219 100644 --- a/tools/internal/custom_markdown_documenter.ts +++ b/tools/internal/custom_markdown_documenter.ts @@ -23,7 +23,7 @@ import * as path from 'path'; -import {DocumenterConfig} from '@microsoft/api-documenter/lib/documenters/DocumenterConfig'; +import {type DocumenterConfig} from '@microsoft/api-documenter/lib/documenters/DocumenterConfig'; import {CustomMarkdownEmitter} from '@microsoft/api-documenter/lib/markdown/CustomMarkdownEmitter'; import {CustomDocNodes} from '@microsoft/api-documenter/lib/nodes/CustomDocNodeKind'; import {DocEmphasisSpan} from '@microsoft/api-documenter/lib/nodes/DocEmphasisSpan'; @@ -34,7 +34,7 @@ import {DocTableCell} from '@microsoft/api-documenter/lib/nodes/DocTableCell'; import {DocTableRow} from '@microsoft/api-documenter/lib/nodes/DocTableRow'; import {MarkdownDocumenterAccessor} from '@microsoft/api-documenter/lib/plugin/MarkdownDocumenterAccessor'; import { - IMarkdownDocumenterFeatureOnBeforeWritePageArgs, + type IMarkdownDocumenterFeatureOnBeforeWritePageArgs, MarkdownDocumenterFeatureContext, } from '@microsoft/api-documenter/lib/plugin/MarkdownDocumenterFeature'; import {PluginLoader} from '@microsoft/api-documenter/lib/plugin/PluginLoader'; @@ -43,15 +43,15 @@ import { ApiClass, ApiDeclaredItem, ApiDocumentedItem, - ApiEnum, + type ApiEnum, ApiInitializerMixin, ApiInterface, - ApiItem, + type ApiItem, ApiItemKind, - ApiModel, - ApiNamespace, + type ApiModel, + type ApiNamespace, ApiOptionalMixin, - ApiPackage, + type ApiPackage, ApiParameterListMixin, ApiPropertyItem, ApiProtectedMixin, @@ -60,26 +60,26 @@ import { ApiReturnTypeMixin, ApiStaticMixin, ApiTypeAlias, - Excerpt, - ExcerptToken, + type Excerpt, + type ExcerptToken, ExcerptTokenKind, - IResolveDeclarationReferenceResult, + type IResolveDeclarationReferenceResult, ReleaseTag, } from '@microsoft/api-extractor-model'; import { - DocBlock, + type DocBlock, DocCodeSpan, - DocComment, + type DocComment, DocFencedCode, DocLinkTag, - DocNodeContainer, + type DocNodeContainer, DocNodeKind, DocParagraph, DocPlainText, DocSection, StandardTags, StringBuilder, - TSDocConfiguration, + type TSDocConfiguration, } from '@microsoft/tsdoc'; import { FileSystem, diff --git a/tools/internal/job.ts b/tools/internal/job.ts index 2a589b45..c4026a15 100644 --- a/tools/internal/job.ts +++ b/tools/internal/job.ts @@ -1,5 +1,5 @@ import {createHash} from 'crypto'; -import {existsSync, Stats} from 'fs'; +import {existsSync, type Stats} from 'fs'; import {mkdir, readFile, stat, writeFile} from 'fs/promises'; import {tmpdir} from 'os'; import {dirname, join} from 'path'; diff --git a/tools/mochaRunner/src/main.ts b/tools/mochaRunner/src/main.ts index 1487ea3a..e7027209 100644 --- a/tools/mochaRunner/src/main.ts +++ b/tools/mochaRunner/src/main.ts @@ -16,18 +16,18 @@ import {randomUUID} from 'crypto'; import fs from 'fs'; -import {spawn, SpawnOptions} from 'node:child_process'; +import {spawn, type SpawnOptions} from 'node:child_process'; import os from 'os'; import path from 'path'; import { - TestExpectation, - MochaResults, + type TestExpectation, + type MochaResults, zTestSuiteFile, zPlatform, - TestSuite, - TestSuiteFile, - Platform, + type TestSuite, + type TestSuiteFile, + type Platform, } from './types.js'; import { extendProcessEnv, @@ -36,7 +36,7 @@ import { filterByParameters, getExpectationUpdates, printSuggestions, - RecommendedExpectation, + type RecommendedExpectation, writeJSON, } from './utils.js'; diff --git a/tools/mochaRunner/src/test.ts b/tools/mochaRunner/src/test.ts index e0cc55b8..33020bb4 100644 --- a/tools/mochaRunner/src/test.ts +++ b/tools/mochaRunner/src/test.ts @@ -16,7 +16,7 @@ import assert from 'node:assert/strict'; import {describe, it} from 'node:test'; -import {Platform, TestExpectation} from './types.js'; +import {type Platform, type TestExpectation} from './types.js'; import { filterByParameters, getTestResultForFailure, diff --git a/tools/mochaRunner/src/types.ts b/tools/mochaRunner/src/types.ts index a368155c..e270ce3a 100644 --- a/tools/mochaRunner/src/types.ts +++ b/tools/mochaRunner/src/types.ts @@ -16,7 +16,7 @@ import {z} from 'zod'; -import {RecommendedExpectation} from './utils.js'; +import {type RecommendedExpectation} from './utils.js'; export const zPlatform = z.enum(['win32', 'linux', 'darwin']); diff --git a/tools/mochaRunner/src/utils.ts b/tools/mochaRunner/src/utils.ts index 61addeb9..3d9773eb 100644 --- a/tools/mochaRunner/src/utils.ts +++ b/tools/mochaRunner/src/utils.ts @@ -18,10 +18,10 @@ import fs from 'fs'; import path from 'path'; import { - MochaTestResult, - TestExpectation, - MochaResults, - TestResult, + type MochaTestResult, + type TestExpectation, + type MochaResults, + type TestResult, } from './types.js'; export function extendProcessEnv(envs: object[]): NodeJS.ProcessEnv {