Skip to content

Commit c0efec2

Browse files
authored
Merge pull request #259 from BobbieGoede/refactor/utility-type-import-consistency
refactor: import functions and types directly from `vue`
2 parents 20bf349 + b95343a commit c0efec2

11 files changed

+14
-19
lines changed

src/types/instance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { MaybeRef, VueInstance } from '@vueuse/core'
2-
import type { Ref, UnwrapRef } from 'vue'
1+
import type { VueInstance } from '@vueuse/core'
2+
import type { MaybeRef, Ref, UnwrapRef } from 'vue'
33
import type { MotionProperties, MotionVariants, Variant } from './variants'
44

55
export type PermissiveTarget = VueInstance | MotionTarget

src/useElementStyle.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { MaybeRef } from '@vueuse/core'
2-
import type { Reactive } from 'vue'
1+
import type { MaybeRef, Reactive } from 'vue'
32
import { watch } from 'vue'
43
import { reactiveStyle } from './reactiveStyle'
54
import type { MotionTarget, PermissiveTarget, StyleProperties } from './types'

src/useElementTransform.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import type { MaybeRef } from '@vueuse/core'
21
import { watch } from 'vue'
3-
import type { Reactive } from 'vue'
2+
import type { MaybeRef, Reactive } from 'vue'
43
import { reactiveTransform } from './reactiveTransform'
54
import type { MotionTarget, PermissiveTarget, TransformProperties } from './types'
65
import { usePermissiveTarget } from './usePermissiveTarget'

src/useMotion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { MaybeRef } from '@vueuse/core'
1+
import type { MaybeRef } from 'vue'
22
import type { MotionInstance, MotionVariants, PermissiveTarget, UseMotionOptions } from './types'
33
import { useMotionControls } from './useMotionControls'
44
import { useMotionFeatures } from './useMotionFeatures'

src/useMotionControls.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { MaybeRef } from '@vueuse/core'
1+
import type { MaybeRef } from 'vue'
22
import { isObject } from '@vueuse/core'
33
import { ref, unref, watch } from 'vue'
44
import type { MotionControls, MotionProperties, MotionTransitions, MotionVariants, Variant } from './types'

src/useMotionProperties.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import type { MaybeRef } from '@vueuse/core'
21
import { reactive, watch } from 'vue'
3-
import type { Reactive } from 'vue'
2+
import type { MaybeRef, Reactive } from 'vue'
43
import type { MotionProperties, PermissiveTarget, StyleProperties, TransformProperties } from './types'
54
import { useElementStyle } from './useElementStyle'
65
import { useElementTransform } from './useElementTransform'

src/useMotionVariants.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { MaybeRef } from '@vueuse/core'
2-
import type { Ref } from 'vue'
1+
import type { MaybeRef, Ref } from 'vue'
32
import { computed, ref, unref } from 'vue'
43
import type { MotionVariants, Variant } from './types'
54

src/usePermissiveTarget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { watch } from 'vue'
22
import { unrefElement } from '@vueuse/core'
3-
import type { MaybeRef } from '@vueuse/shared'
3+
import type { MaybeRef } from 'vue'
44
import type { PermissiveTarget } from './types'
55

66
export function usePermissiveTarget(target: MaybeRef<PermissiveTarget>, onTarget: (target: HTMLElement | SVGElement) => void) {

src/useReducedMotion.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { type Ref, computed } from 'vue'
1+
import { computed } from 'vue'
2+
import type { Ref } from 'vue'
23
import { useMediaQuery } from '@vueuse/core'
34

45
/**

src/useSpring.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { MaybeRef } from '@vueuse/shared'
1+
import type { MaybeRef } from 'vue'
22
import { animate } from 'popmotion'
33
import type { MotionProperties, PermissiveMotionProperties, PermissiveTarget, Spring, SpringControls } from './types'
44
import { useMotionValues } from './useMotionValues'

src/utils/element.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import type { Ref } from '@vue/reactivity'
2-
import { ref } from '@vue/reactivity'
3-
import { watch } from '@vue/runtime-core'
1+
import { ref, watch } from 'vue'
42
import type { VueInstance } from '@vueuse/core'
5-
import type { MaybeRef } from '@vueuse/shared'
3+
import type { MaybeRef, Ref } from 'vue'
64
import type { MotionTarget, PermissiveTarget } from '../types'
75

86
export function resolveElement(target: MaybeRef<PermissiveTarget>): Ref<MotionTarget> {

0 commit comments

Comments
 (0)