diff --git a/packages/devextreme/js/__internal/events/core/m_emitter.feedback.ts b/packages/devextreme/js/__internal/events/core/m_emitter.feedback.ts index f82c54369798..bf19246fa872 100644 --- a/packages/devextreme/js/__internal/events/core/m_emitter.feedback.ts +++ b/packages/devextreme/js/__internal/events/core/m_emitter.feedback.ts @@ -158,7 +158,8 @@ const FeedbackEmitter = Emitter.inherit({ }, }); -(FeedbackEmitter as any).lock = function (deferred) { +// @ts-expect-error +FeedbackEmitter.lock = function (deferred) { const lockInactive = activeFeedback ? activeFeedback.lockInactive() : noop; deferred.done(lockInactive); @@ -172,7 +173,8 @@ registerEmitter({ ], }); -export const { lock } = (FeedbackEmitter as any); +// @ts-expect-error +export const { lock } = FeedbackEmitter; export { ACTIVE_EVENT_NAME as active, INACTIVE_EVENT_NAME as inactive, diff --git a/packages/devextreme/js/__internal/events/core/m_emitter_registrator.ts b/packages/devextreme/js/__internal/events/core/m_emitter_registrator.ts index 03ea945313be..77540f77ce3c 100644 --- a/packages/devextreme/js/__internal/events/core/m_emitter_registrator.ts +++ b/packages/devextreme/js/__internal/events/core/m_emitter_registrator.ts @@ -27,10 +27,14 @@ const EventManager = Class.inherit({ _attachHandlers() { readyCallbacks.add(() => { const document = domAdapter.getDocument(); - (eventsEngine as any).subscribeGlobal(document, addNamespace(pointerEvents.down, MANAGER_EVENT), this._pointerDownHandler.bind(this)); - (eventsEngine as any).subscribeGlobal(document, addNamespace(pointerEvents.move, MANAGER_EVENT), this._pointerMoveHandler.bind(this)); - (eventsEngine as any).subscribeGlobal(document, addNamespace([pointerEvents.up, pointerEvents.cancel].join(' '), MANAGER_EVENT), this._pointerUpHandler.bind(this)); - (eventsEngine as any).subscribeGlobal(document, addNamespace(wheelEventName, MANAGER_EVENT), this._mouseWheelHandler.bind(this)); + // @ts-expect-error + eventsEngine.subscribeGlobal(document, addNamespace(pointerEvents.down, MANAGER_EVENT), this._pointerDownHandler.bind(this)); + // @ts-expect-error + eventsEngine.subscribeGlobal(document, addNamespace(pointerEvents.move, MANAGER_EVENT), this._pointerMoveHandler.bind(this)); + // @ts-expect-error + eventsEngine.subscribeGlobal(document, addNamespace([pointerEvents.up, pointerEvents.cancel].join(' '), MANAGER_EVENT), this._pointerUpHandler.bind(this)); + // @ts-expect-error + eventsEngine.subscribeGlobal(document, addNamespace(wheelEventName, MANAGER_EVENT), this._mouseWheelHandler.bind(this)); }); }, @@ -280,8 +284,10 @@ const registerEmitter = function (emitterConfig) { }); if (disposeEmitter) { - if ((eventManager as any).isActive(element)) { - (eventManager as any).resetEmitter(emitter); + // @ts-expect-error + if (eventManager.isActive(element)) { + // @ts-expect-error + eventManager.resetEmitter(emitter); } emitter && emitter.dispose(); diff --git a/packages/devextreme/js/__internal/events/core/m_events_engine.ts b/packages/devextreme/js/__internal/events/core/m_events_engine.ts index 66f6a4cd8a59..75b3058cd4db 100644 --- a/packages/devextreme/js/__internal/events/core/m_events_engine.ts +++ b/packages/devextreme/js/__internal/events/core/m_events_engine.ts @@ -61,7 +61,8 @@ const EVENT_PROPERTIES = [ ]; function matchesSafe(target, selector) { - return !isWindow(target) && target.nodeName !== '#document' && (domAdapter as any).elementMatches(target, selector); + // @ts-expect-error + return !isWindow(target) && target.nodeName !== '#document' && domAdapter.elementMatches(target, selector); } const elementDataMap = new WeakMap(); let guid = 0; @@ -187,7 +188,8 @@ function detectPassiveEventHandlersSupport() { }, }); - (window as any).addEventListener('test', null, options); + // @ts-expect-error + window.addEventListener('test', null, options); // eslint-disable-next-line no-empty } catch (e) { } @@ -321,7 +323,8 @@ function getHandlersController(element, eventName) { }; } - eventData.removeListener = (domAdapter as any).listen(element, NATIVE_EVENTS_TO_SUBSCRIBE[eventName] || eventName, eventData.nativeHandler, nativeListenerOptions); + // @ts-expect-error + eventData.removeListener = domAdapter.listen(element, NATIVE_EVENTS_TO_SUBSCRIBE[eventName] || eventName, eventData.nativeHandler, nativeListenerOptions); } special.callMethod(eventName, 'add', element, [handleObject]); @@ -552,7 +555,8 @@ function iterate(callback) { iterateEventNames.apply(this, args); } } else { - iterateEventNames.apply(this, arguments as any); + // @ts-expect-error + iterateEventNames.apply(this, arguments); } }; } @@ -606,7 +610,8 @@ function initEvent(EventClass) { initEvent(normalizeEventArguments(function (src, config) { const srcIsEvent = src instanceof eventsEngine.Event - || (hasWindow() && src instanceof (window as any).Event) + // @ts-expect-error + || (hasWindow() && src instanceof window.Event) || (src.view?.Event && src instanceof src.view.Event); if (srcIsEvent) { diff --git a/packages/devextreme/js/__internal/events/core/m_keyboard_processor.ts b/packages/devextreme/js/__internal/events/core/m_keyboard_processor.ts index 774ed33cf7b3..bc3194beeda1 100644 --- a/packages/devextreme/js/__internal/events/core/m_keyboard_processor.ts +++ b/packages/devextreme/js/__internal/events/core/m_keyboard_processor.ts @@ -74,7 +74,7 @@ const KeyboardProcessor = Class.inherit({ this._isComposingJustFinished = !this._isComposing; }, }); - -(KeyboardProcessor as any).createKeyDownOptions = createKeyDownOptions; +// @ts-expect-error +KeyboardProcessor.createKeyDownOptions = createKeyDownOptions; export default KeyboardProcessor; diff --git a/packages/devextreme/js/__internal/events/core/m_wheel.ts b/packages/devextreme/js/__internal/events/core/m_wheel.ts index 60e28f3995c7..f4f94e27f02a 100644 --- a/packages/devextreme/js/__internal/events/core/m_wheel.ts +++ b/packages/devextreme/js/__internal/events/core/m_wheel.ts @@ -28,13 +28,14 @@ const wheel = { fireEvent({ type: EVENT_NAME, originalEvent: e, + // @ts-expect-error delta: this._normalizeDelta(deltaY, deltaMode), deltaX, deltaY, deltaZ, deltaMode, pointerType: 'mouse', - } as any); + }); e.stopPropagation(); }, diff --git a/packages/devextreme/js/__internal/events/gesture/m_emitter.gesture.scroll.ts b/packages/devextreme/js/__internal/events/gesture/m_emitter.gesture.scroll.ts index 60bdd27b0c76..b8ba6593c113 100644 --- a/packages/devextreme/js/__internal/events/gesture/m_emitter.gesture.scroll.ts +++ b/packages/devextreme/js/__internal/events/gesture/m_emitter.gesture.scroll.ts @@ -266,7 +266,8 @@ const ScrollEmitter = GestureEmitter.inherit((function () { }, _end(e) { - const endEventDelta = eventDelta(this._prevEventData, eventData(e) as any); + // @ts-expect-error + const endEventDelta = eventDelta(this._prevEventData, eventData(e)); let velocity = { x: 0, y: 0 }; if (!isDxMouseWheelEvent(e) && endEventDelta.time < INERTIA_TIMEOUT) { diff --git a/packages/devextreme/js/__internal/events/gesture/m_emitter.gesture.ts b/packages/devextreme/js/__internal/events/gesture/m_emitter.gesture.ts index b49e2ddd6367..b74fd5ff811b 100644 --- a/packages/devextreme/js/__internal/events/gesture/m_emitter.gesture.ts +++ b/packages/devextreme/js/__internal/events/gesture/m_emitter.gesture.ts @@ -40,8 +40,8 @@ const setGestureCover = callOnce(() => { const $cover = $('