diff --git a/web/src/app/browser/src/context/pageIntegrationHandlers.ts b/web/src/app/browser/src/context/pageIntegrationHandlers.ts index 056a0ee91d..3a997d9392 100644 --- a/web/src/app/browser/src/context/pageIntegrationHandlers.ts +++ b/web/src/app/browser/src/context/pageIntegrationHandlers.ts @@ -1,6 +1,6 @@ import { DomEventTracker } from 'keyman/engine/events'; -import KeymanEngine from "../keymanEngine.js"; +import { KeymanEngine } from "../keymanEngine.js"; import { FocusAssistant } from './focusAssistant.js'; import { RotationProcessor } from '../utils/rotationProcessor.js'; diff --git a/web/src/app/browser/src/debug-main.ts b/web/src/app/browser/src/debug-main.ts index efb32cde19..973e0d7efc 100644 --- a/web/src/app/browser/src/debug-main.ts +++ b/web/src/app/browser/src/debug-main.ts @@ -1,4 +1,4 @@ -import KeymanEngine from './keymanEngine.js' +import { KeymanEngine } from './keymanEngine.js' import { SourcemappedWorker } from '@keymanapp/lexical-model-layer/web' /** diff --git a/web/src/app/browser/src/keyboardInterface.ts b/web/src/app/browser/src/keyboardInterface.ts index 9607c7a92d..e9b0bda379 100644 --- a/web/src/app/browser/src/keyboardInterface.ts +++ b/web/src/app/browser/src/keyboardInterface.ts @@ -3,7 +3,7 @@ import { FloatingOSKView } from 'keyman/engine/osk'; import { KeyboardInterface as KeyboardInterfaceBase } from 'keyman/engine/main'; import ContextManager from './contextManager.js'; -import KeymanEngine from './keymanEngine.js'; +import { KeymanEngine } from './keymanEngine.js'; export default class KeyboardInterface extends KeyboardInterfaceBase { constructor( diff --git a/web/src/app/browser/src/keymanEngine.ts b/web/src/app/browser/src/keymanEngine.ts index ca2ac8ba95..59987035cc 100644 --- a/web/src/app/browser/src/keymanEngine.ts +++ b/web/src/app/browser/src/keymanEngine.ts @@ -1,5 +1,5 @@ import { KeymanWebKeyboard } from '@keymanapp/common-types'; -import { KeymanEngine as KeymanEngineBase, DeviceDetector } from 'keyman/engine/main'; +import { KeymanEngineBase, DeviceDetector } from 'keyman/engine/main'; import { getAbsoluteY } from 'keyman/engine/dom-utils'; import { OutputTarget } from 'keyman/engine/element-wrappers'; import { @@ -29,7 +29,7 @@ import { BeepHandler } from './beepHandler.js'; import KeyboardInterface from './keyboardInterface.js'; import { WorkerFactory } from '@keymanapp/lexical-model-layer/web'; -export default class KeymanEngine extends KeymanEngineBase { +export class KeymanEngine extends KeymanEngineBase { touchLanguageMenu?: LanguageMenu; private pageIntegration: PageIntegrationHandlers; diff --git a/web/src/app/browser/src/languageMenu.ts b/web/src/app/browser/src/languageMenu.ts index 1fd4de76ef..0549d9850a 100644 --- a/web/src/app/browser/src/languageMenu.ts +++ b/web/src/app/browser/src/languageMenu.ts @@ -2,7 +2,7 @@ import { getAbsoluteX, landscapeView } from "keyman/engine/dom-utils"; import { KeyboardStub } from "keyman/engine/keyboard-storage"; -import KeymanEngine from "./keymanEngine.js"; +import { KeymanEngine } from "./keymanEngine.js"; import * as util from "./utils/index.js"; interface KeyboardTag { diff --git a/web/src/app/browser/src/oskConfiguration.ts b/web/src/app/browser/src/oskConfiguration.ts index 154b969865..d9f5764671 100644 --- a/web/src/app/browser/src/oskConfiguration.ts +++ b/web/src/app/browser/src/oskConfiguration.ts @@ -1,7 +1,7 @@ import { OSKView } from "keyman/engine/osk"; import { KEYMAN_VERSION } from "@keymanapp/keyman-version"; import ContextManager from "./contextManager.js"; -import KeymanEngine from "./keymanEngine.js"; +import { KeymanEngine } from "./keymanEngine.js"; import { LanguageMenu } from "./languageMenu.js"; export function setupOskListeners(engine: KeymanEngine, osk: OSKView, contextManager: ContextManager) { diff --git a/web/src/app/browser/src/release-main.ts b/web/src/app/browser/src/release-main.ts index 2261d185c4..faf96e9097 100644 --- a/web/src/app/browser/src/release-main.ts +++ b/web/src/app/browser/src/release-main.ts @@ -1,4 +1,4 @@ -import KeymanEngine from './keymanEngine.js' +import { KeymanEngine } from './keymanEngine.js' import { Worker } from '@keymanapp/lexical-model-layer/web' /** diff --git a/web/src/app/browser/src/test-index.ts b/web/src/app/browser/src/test-index.ts index 47d3591311..408b47cba6 100644 --- a/web/src/app/browser/src/test-index.ts +++ b/web/src/app/browser/src/test-index.ts @@ -2,6 +2,6 @@ export { BrowserConfiguration, BrowserInitOptionSpec } from './configuration.js' export { default as ContextManager, KeyboardCookie } from "./contextManager.js"; export { preprocessKeyboardEvent, default as HardwareEventKeyboard } from './hardwareEventKeyboard.js'; -export { default as KeymanEngine } from './keymanEngine.js'; +export { KeymanEngine } from './keymanEngine.js'; export { default as KeyboardInterface } from './keyboardInterface.js'; export { UIModule } from './uiModuleInterface.js'; diff --git a/web/src/app/browser/src/utils/rotationProcessor.ts b/web/src/app/browser/src/utils/rotationProcessor.ts index f9d573b765..07e1c1b202 100644 --- a/web/src/app/browser/src/utils/rotationProcessor.ts +++ b/web/src/app/browser/src/utils/rotationProcessor.ts @@ -1,4 +1,4 @@ -import KeymanEngine from "../keymanEngine.js"; +import { KeymanEngine } from "../keymanEngine.js"; class RotationState { innerWidth: number; diff --git a/web/src/app/browser/src/viewsAnchorpoint.ts b/web/src/app/browser/src/viewsAnchorpoint.ts index 8db8781f2c..0c1015505b 100644 --- a/web/src/app/browser/src/viewsAnchorpoint.ts +++ b/web/src/app/browser/src/viewsAnchorpoint.ts @@ -5,7 +5,7 @@ import { FloatingOSKViewConfiguration, InlinedOSKView } from "keyman/engine/osk"; -import KeymanEngine from "./keymanEngine.js"; +import { KeymanEngine } from "./keymanEngine.js"; function buildBaseOskConfiguration(engine: KeymanEngine) { return { diff --git a/web/src/app/webview/src/debug-main.ts b/web/src/app/webview/src/debug-main.ts index 3e7c7270ec..646c8f1687 100644 --- a/web/src/app/webview/src/debug-main.ts +++ b/web/src/app/webview/src/debug-main.ts @@ -1,4 +1,4 @@ -import KeymanEngine from './keymanEngine.js' +import { KeymanEngine } from './keymanEngine.js' import { SourcemappedWorker } from '@keymanapp/lexical-model-layer/web' /** diff --git a/web/src/app/webview/src/keymanEngine.ts b/web/src/app/webview/src/keymanEngine.ts index 84390d51f2..8db2951c1b 100644 --- a/web/src/app/webview/src/keymanEngine.ts +++ b/web/src/app/webview/src/keymanEngine.ts @@ -1,6 +1,6 @@ import { DeviceSpec, DefaultRules } from 'keyman/engine/keyboard'; import { RuleBehavior } from 'keyman/engine/js-processor'; -import { KeymanEngine as KeymanEngineBase, KeyboardInterface } from 'keyman/engine/main'; +import { KeymanEngineBase, KeyboardInterface } from 'keyman/engine/main'; import { AnchoredOSKView, ViewConfiguration, StaticActivator } from 'keyman/engine/osk'; import { getAbsoluteX, getAbsoluteY } from 'keyman/engine/dom-utils'; import { toPrefixedKeyboardId, toUnprefixedKeyboardId } from 'keyman/engine/keyboard-storage'; @@ -11,7 +11,7 @@ import PassthroughKeyboard from './passthroughKeyboard.js'; import { buildEmbeddedGestureConfig, setupEmbeddedListeners } from './oskConfiguration.js'; import { WorkerFactory } from '@keymanapp/lexical-model-layer'; -export default class KeymanEngine extends KeymanEngineBase { +export class KeymanEngine extends KeymanEngineBase { // Ideally, we would be able to auto-detect `sourceUri`: https://stackoverflow.com/a/60244278. // But it's too new of a feature to utilize... and also expects to be in a module, when this may // be compiled down to an IIFE. diff --git a/web/src/app/webview/src/oskConfiguration.ts b/web/src/app/webview/src/oskConfiguration.ts index 9250b5a2a1..cd0bdd9b4f 100644 --- a/web/src/app/webview/src/oskConfiguration.ts +++ b/web/src/app/webview/src/oskConfiguration.ts @@ -3,7 +3,7 @@ import { DeviceSpec } from "keyman/engine/keyboard"; import { type EmbeddedGestureConfig } from "keyman/engine/osk"; import { GlobeHint } from './osk/globeHint.js'; -import type KeymanEngine from "./keymanEngine.js"; +import { type KeymanEngine } from "./keymanEngine.js"; export function setupEmbeddedListeners(engine: KeymanEngine, osk: OSKView) { osk.on('globekey', (key, on) => { diff --git a/web/src/app/webview/src/release-main.ts b/web/src/app/webview/src/release-main.ts index fd8bcd8dce..ba70bfef9b 100644 --- a/web/src/app/webview/src/release-main.ts +++ b/web/src/app/webview/src/release-main.ts @@ -1,4 +1,4 @@ -import KeymanEngine from './keymanEngine.js' +import { KeymanEngine } from './keymanEngine.js' import { Worker } from '@keymanapp/lexical-model-layer/web' /** diff --git a/web/src/engine/main/src/index.ts b/web/src/engine/main/src/index.ts index 558b800769..bd1f33513c 100644 --- a/web/src/engine/main/src/index.ts +++ b/web/src/engine/main/src/index.ts @@ -2,7 +2,7 @@ export { EngineConfiguration, InitOptionDefaults, InitOptionSpec } from './engin export { ContextManagerBase, ContextManagerConfiguration } from './contextManagerBase.js'; export { HardKeyboardBase, processForMnemonicsAndLegacy } from './hardKeyboardBase.js'; export { default as KeyboardInterface } from './keyboardInterface.js'; -export { default as KeymanEngine } from './keymanEngine.js'; +export { KeymanEngineBase } from './keymanEngineBase.js'; export { LegacyAPIEvents } from './legacyAPIEvents.js'; export { VariableStoreCookieSerializer } from './variableStoreCookieSerializer.js'; export { LanguageProcessor } from './headless/languageProcessor.js'; diff --git a/web/src/engine/main/src/keyboardInterface.ts b/web/src/engine/main/src/keyboardInterface.ts index 4996ecb55a..59d7c22954 100644 --- a/web/src/engine/main/src/keyboardInterface.ts +++ b/web/src/engine/main/src/keyboardInterface.ts @@ -6,16 +6,16 @@ import KeyboardObject = KeymanWebKeyboard.KeyboardObject; import { ContextManagerBase } from './contextManagerBase.js'; import { VariableStoreCookieSerializer } from "./variableStoreCookieSerializer.js"; -import KeymanEngine from "./keymanEngine.js"; +import { KeymanEngineBase } from "./keymanEngineBase.js"; import { EngineConfiguration } from "./engineConfiguration.js"; export default class KeyboardInterface> extends KeyboardInterfaceBase { - protected readonly engine: KeymanEngine; + protected readonly engine: KeymanEngineBase; private stubNamespacer?: (stub: RawKeyboardStub) => void; constructor( _jsGlobal: any, - engine: KeymanEngine, + engine: KeymanEngineBase, stubNamespacer?: (stub: RawKeyboardStub) => void ) { super(_jsGlobal, engine, new VariableStoreCookieSerializer()); diff --git a/web/src/engine/main/src/keymanEngine.ts b/web/src/engine/main/src/keymanEngineBase.ts similarity index 99% rename from web/src/engine/main/src/keymanEngine.ts rename to web/src/engine/main/src/keymanEngineBase.ts index 9c6a1bd8a9..22a0d55631 100644 --- a/web/src/engine/main/src/keymanEngine.ts +++ b/web/src/engine/main/src/keymanEngineBase.ts @@ -35,7 +35,7 @@ function determineBaseLayout(): string { export type KeyEventFullResultCallback = (result: RuleBehavior, error?: Error) => void; export type KeyEventFullHandler = (event: KeyEvent, callback?: KeyEventFullResultCallback) => void; -export default class KeymanEngine< +export class KeymanEngineBase< Configuration extends EngineConfiguration, ContextManager extends ContextManagerBase, HardKeyboard extends HardKeyboardBase @@ -117,7 +117,7 @@ export default class KeymanEngine< workerFactory: WorkerFactory, config: Configuration, contextManager: ContextManager, - processorConfigInitializer: (engine: KeymanEngine) => ProcessorConfiguration + processorConfigInitializer: (engine: KeymanEngineBase) => ProcessorConfiguration ) { this.config = config; this.contextManager = contextManager;