From 96246752157a59d07d786f8163fc277e4f8e27ac Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Sun, 19 Jan 2025 22:16:53 +0500 Subject: [PATCH] fix: circular imports JSC fails to run a basic NativeScript add due to these imports, probably a circular. --- packages/core/ui/gestures/index.android.ts | 2 +- packages/core/ui/gestures/index.ios.ts | 2 +- packages/core/ui/gestures/touch-manager.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/ui/gestures/index.android.ts b/packages/core/ui/gestures/index.android.ts index aef28d4218..31ddf9d331 100644 --- a/packages/core/ui/gestures/index.android.ts +++ b/packages/core/ui/gestures/index.android.ts @@ -1,6 +1,6 @@ // Definitions. import { GestureEventData, TapGestureEventData, SwipeGestureEventData, PanGestureEventData, RotationGestureEventData, GestureEventDataWithState } from '.'; -import { View } from '../core/view'; +import type { View } from '../core/view'; import { EventData } from '../../data/observable'; // Types. diff --git a/packages/core/ui/gestures/index.ios.ts b/packages/core/ui/gestures/index.ios.ts index 5a401cd0b6..93696c026d 100644 --- a/packages/core/ui/gestures/index.ios.ts +++ b/packages/core/ui/gestures/index.ios.ts @@ -1,7 +1,7 @@ // Definitions. import { GestureEventData, TapGestureEventData, GestureEventDataWithState, SwipeGestureEventData, PanGestureEventData, RotationGestureEventData, PinchGestureEventData } from '.'; -import { View } from '../core/view'; +import type { View } from '../core/view'; import { EventData } from '../../data/observable'; // Types. diff --git a/packages/core/ui/gestures/touch-manager.ts b/packages/core/ui/gestures/touch-manager.ts index dd89b3ffa0..726be7e28b 100644 --- a/packages/core/ui/gestures/touch-manager.ts +++ b/packages/core/ui/gestures/touch-manager.ts @@ -5,7 +5,7 @@ import { GestureEventData, GestureEventDataWithState, TouchGestureEventData } from '.'; import { Animation } from '../animation'; import { AnimationDefinition } from '../animation/animation-interfaces'; -import { View } from '../core/view'; +import type { View } from '../core/view'; import { isObject, isFunction } from '../../utils/types'; import { GestureEvents, GestureStateTypes, GestureTypes } from './gestures-common'; @@ -169,7 +169,7 @@ export class TouchManager { } } - view.on(View.disposeNativeViewEvent, (args) => { + view.on('disposeNativeView', (args) => { const index = TouchManager.touchHandlers?.findIndex((handler) => handler.view === args.object); if (index > -1) { TouchManager.touchHandlers.splice(index, 1);