From 971c2d0cbfa7e42396347a1f1c26252a14eebdb9 Mon Sep 17 00:00:00 2001 From: Cliff Njoroge Date: Sat, 5 Oct 2024 13:06:09 +0300 Subject: [PATCH] fix remnant errors --- .../MotionConfigScaleCorrection.ts | 6 ++- .../context/MotionContext/index.ts | 2 +- .../motion-start/events/use-pointer-event.ts | 1 + .../drag/VisualElementDragControls.ts | 2 +- .../motion/features/layout/index.ts | 1 + .../render/dom/create-motion-class.ts | 1 + tsconfig.vitest-temp.json | 49 +++++++++++++++++++ 7 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 tsconfig.vitest-temp.json diff --git a/src/lib/motion-start/components/MotionConfig/MotionConfigScaleCorrection.ts b/src/lib/motion-start/components/MotionConfig/MotionConfigScaleCorrection.ts index dde882b..caa5802 100755 --- a/src/lib/motion-start/components/MotionConfig/MotionConfigScaleCorrection.ts +++ b/src/lib/motion-start/components/MotionConfig/MotionConfigScaleCorrection.ts @@ -1,7 +1,9 @@ import { getContext } from 'svelte'; import { get, type Writable } from 'svelte/store'; +// @ts-ignore import { ScaleCorrectionContext, ScaleCorrectionParentContext } from '../../context/ScaleCorrectionProvider.svelte'; -import type { MotionContextProps } from '$lib/motion-start/context/MotionContext'; +import type { MotionContextProps } from '../../context/MotionContext/index.js' +// '$lib/motion-start/context/MotionContext'; export const scaleCorrection = () => { const scaleCorrectionContext = getContext>(ScaleCorrectionContext); @@ -9,7 +11,7 @@ export const scaleCorrection = () => { const afterU = (nc = false) => { /* Second part of the updater calling in child layouts first.*/ const scc = get(scaleCorrectionContext); - // @ts-expect-error + // @ts-ignore scc.forEach((v: { afterU: (arg0: boolean) => void }, i: any) => { v.afterU?.(true); }); diff --git a/src/lib/motion-start/context/MotionContext/index.ts b/src/lib/motion-start/context/MotionContext/index.ts index 6a63cf3..fb8272e 100755 --- a/src/lib/motion-start/context/MotionContext/index.ts +++ b/src/lib/motion-start/context/MotionContext/index.ts @@ -9,6 +9,6 @@ export interface MotionContextProps { animate?: string | string[]; } - +//@ts-ignore export { MotionContext, useVisualElementContext, default as UseVisualElementContext } from "./MotionContext.svelte"; diff --git a/src/lib/motion-start/events/use-pointer-event.ts b/src/lib/motion-start/events/use-pointer-event.ts index e73fd07..8672d03 100755 --- a/src/lib/motion-start/events/use-pointer-event.ts +++ b/src/lib/motion-start/events/use-pointer-event.ts @@ -29,4 +29,5 @@ export interface UsePointerEventProps { options?: AddEventListenerOptions; } +// @ts-ignore export { default as UsePointerEvent, addPointerEvent } from './UsePointerEvent.svelte'; diff --git a/src/lib/motion-start/gestures/drag/VisualElementDragControls.ts b/src/lib/motion-start/gestures/drag/VisualElementDragControls.ts index 463a445..cf75241 100755 --- a/src/lib/motion-start/gestures/drag/VisualElementDragControls.ts +++ b/src/lib/motion-start/gestures/drag/VisualElementDragControls.ts @@ -605,7 +605,7 @@ class VisualElementDragControls { /** * Attach a pointerdown event listener on this DOM element to initiate drag tracking. */ - var stopPointerListener = addPointerEvent(element, 'pointerdown', (event) => { + var stopPointerListener = addPointerEvent(element, 'pointerdown', (event: PointerEvent) => { var _a = this.props, drag = _a.drag, _b = _a.dragListener, diff --git a/src/lib/motion-start/motion/features/layout/index.ts b/src/lib/motion-start/motion/features/layout/index.ts index d353dd4..f135eb3 100755 --- a/src/lib/motion-start/motion/features/layout/index.ts +++ b/src/lib/motion-start/motion/features/layout/index.ts @@ -12,6 +12,7 @@ Copyright (c) 2018 Framer B.V. import { AnimateLayoutContextProvider } from './Animate.js'; import { MeasureContextProvider } from './Measure.js'; + var layoutAnimations = { measureLayout: MeasureContextProvider, layoutAnimation: AnimateLayoutContextProvider, diff --git a/src/lib/motion-start/render/dom/create-motion-class.ts b/src/lib/motion-start/render/dom/create-motion-class.ts index 0c0adf8..d1048ea 100755 --- a/src/lib/motion-start/render/dom/create-motion-class.ts +++ b/src/lib/motion-start/render/dom/create-motion-class.ts @@ -5,6 +5,7 @@ Copyright (c) 2018 Framer B.V. import Motion from '../../motion/Motion.svelte'; import { loadFeatures } from '../../motion/features/definitions'; + export const createMotionClass = (features: Parameters[0]) => { features && loadFeatures(features); return Motion; diff --git a/tsconfig.vitest-temp.json b/tsconfig.vitest-temp.json new file mode 100644 index 0000000..c819b3d --- /dev/null +++ b/tsconfig.vitest-temp.json @@ -0,0 +1,49 @@ +{ + "compilerOptions": { + "paths": { + "$lib": [ + "../src/lib" + ], + "$lib/*": [ + "../src/lib/*" + ] + }, + "rootDirs": [ + "..", + "./types" + ], + "verbatimModuleSyntax": true, + "isolatedModules": true, + "lib": [ + "esnext", + "DOM", + "DOM.Iterable" + ], + "moduleResolution": "Bundler", + "module": "ESNext", + "noEmit": true, + "target": "ES2020", + "useDefineForClassFields": true, + "sourceMap": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "declaration": true, + "declarationMap": true, + "types": [ + "vitest/globals" + ], + "emitDeclarationOnly": false, + "incremental": true, + "tsBuildInfoFile": "D:/clidoProjects/libraries/motion-start/node_modules/vitest/dist/chunks/tsconfig.tmp.tsbuildinfo" + }, + "include": [ + "src", + "src/**/*.{test,spec}-d.ts" + ], + "exclude": [ + "node_modules", + ".svelte-kit" + ] +} \ No newline at end of file