From 29b6eaf6308fa3af16317108981a5ee1df1542e0 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 15 May 2025 16:18:28 +0200 Subject: [PATCH] refactor(web): rename generic type variables This change renames the generic type variables in `KeymanEngineBase` to make it clearer that they are generic types rather than the actual types. --- web/src/engine/main/src/keymanEngineBase.ts | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/web/src/engine/main/src/keymanEngineBase.ts b/web/src/engine/main/src/keymanEngineBase.ts index 22a0d55631..5e8804fb8b 100644 --- a/web/src/engine/main/src/keymanEngineBase.ts +++ b/web/src/engine/main/src/keymanEngineBase.ts @@ -36,19 +36,19 @@ export type KeyEventFullResultCallback = (result: RuleBehavior, error?: Error) = export type KeyEventFullHandler = (event: KeyEvent, callback?: KeyEventFullResultCallback) => void; export class KeymanEngineBase< - Configuration extends EngineConfiguration, - ContextManager extends ContextManagerBase, - HardKeyboard extends HardKeyboardBase + ConfigurationT extends EngineConfiguration, + ContextManagerT extends ContextManagerBase, + HardKeyboardT extends HardKeyboardBase > implements KeyboardKeymanGlobal { - readonly config: Configuration; - contextManager: ContextManager; - interface: KeyboardInterface; + readonly config: ConfigurationT; + contextManager: ContextManagerT; + interface: KeyboardInterface; readonly core: InputProcessor; keyboardRequisitioner: KeyboardRequisitioner; modelCache: ModelCache; protected legacyAPIEvents = new LegacyEventEmitter(); - private _hardKeyboard: HardKeyboard; + private _hardKeyboard: HardKeyboardT; private _osk: OSKView; protected keyEventRefocus?: () => void; @@ -115,16 +115,16 @@ export class KeymanEngineBase< */ constructor( workerFactory: WorkerFactory, - config: Configuration, - contextManager: ContextManager, - processorConfigInitializer: (engine: KeymanEngineBase) => ProcessorConfiguration + config: ConfigurationT, + contextManager: ContextManagerT, + processorConfigInitializer: (engine: KeymanEngineBase) => ProcessorConfiguration ) { this.config = config; this.contextManager = contextManager; const processorConfiguration = processorConfigInitializer(this); processorConfiguration.baseLayout = determineBaseLayout(); - this.interface = processorConfiguration.keyboardInterface as KeyboardInterface; + this.interface = processorConfiguration.keyboardInterface as KeyboardInterface; this.core = new InputProcessor(config.hostDevice, workerFactory, processorConfiguration); this.core.languageProcessor.on('statechange', (state) => { @@ -354,11 +354,11 @@ export class KeymanEngineBase< return KEYMAN_VERSION.VERSION_RELEASE; } - public get hardKeyboard(): HardKeyboard { + public get hardKeyboard(): HardKeyboardT { return this._hardKeyboard; } - protected set hardKeyboard(keyboard: HardKeyboard) { + protected set hardKeyboard(keyboard: HardKeyboardT) { if(this._hardKeyboard) { this._hardKeyboard.off('keyevent', this.keyEventListener); }