Skip to content

Commit

Permalink
Merge pull request #259 from BobbieGoede/refactor/utility-type-import…
Browse files Browse the repository at this point in the history
…-consistency

refactor: import functions and types directly from `vue`
  • Loading branch information
BobbieGoede authored Mar 11, 2025
2 parents 20bf349 + b95343a commit c0efec2
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/types/instance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { MaybeRef, VueInstance } from '@vueuse/core'
import type { Ref, UnwrapRef } from 'vue'
import type { VueInstance } from '@vueuse/core'
import type { MaybeRef, Ref, UnwrapRef } from 'vue'
import type { MotionProperties, MotionVariants, Variant } from './variants'

export type PermissiveTarget = VueInstance | MotionTarget
Expand Down
3 changes: 1 addition & 2 deletions src/useElementStyle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { MaybeRef } from '@vueuse/core'
import type { Reactive } from 'vue'
import type { MaybeRef, Reactive } from 'vue'
import { watch } from 'vue'
import { reactiveStyle } from './reactiveStyle'
import type { MotionTarget, PermissiveTarget, StyleProperties } from './types'
Expand Down
3 changes: 1 addition & 2 deletions src/useElementTransform.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { MaybeRef } from '@vueuse/core'
import { watch } from 'vue'
import type { Reactive } from 'vue'
import type { MaybeRef, Reactive } from 'vue'
import { reactiveTransform } from './reactiveTransform'
import type { MotionTarget, PermissiveTarget, TransformProperties } from './types'
import { usePermissiveTarget } from './usePermissiveTarget'
Expand Down
2 changes: 1 addition & 1 deletion src/useMotion.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MaybeRef } from '@vueuse/core'
import type { MaybeRef } from 'vue'
import type { MotionInstance, MotionVariants, PermissiveTarget, UseMotionOptions } from './types'
import { useMotionControls } from './useMotionControls'
import { useMotionFeatures } from './useMotionFeatures'
Expand Down
2 changes: 1 addition & 1 deletion src/useMotionControls.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MaybeRef } from '@vueuse/core'
import type { MaybeRef } from 'vue'
import { isObject } from '@vueuse/core'
import { ref, unref, watch } from 'vue'
import type { MotionControls, MotionProperties, MotionTransitions, MotionVariants, Variant } from './types'
Expand Down
3 changes: 1 addition & 2 deletions src/useMotionProperties.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { MaybeRef } from '@vueuse/core'
import { reactive, watch } from 'vue'
import type { Reactive } from 'vue'
import type { MaybeRef, Reactive } from 'vue'
import type { MotionProperties, PermissiveTarget, StyleProperties, TransformProperties } from './types'
import { useElementStyle } from './useElementStyle'
import { useElementTransform } from './useElementTransform'
Expand Down
3 changes: 1 addition & 2 deletions src/useMotionVariants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { MaybeRef } from '@vueuse/core'
import type { Ref } from 'vue'
import type { MaybeRef, Ref } from 'vue'
import { computed, ref, unref } from 'vue'
import type { MotionVariants, Variant } from './types'

Expand Down
2 changes: 1 addition & 1 deletion src/usePermissiveTarget.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { watch } from 'vue'
import { unrefElement } from '@vueuse/core'
import type { MaybeRef } from '@vueuse/shared'
import type { MaybeRef } from 'vue'
import type { PermissiveTarget } from './types'

export function usePermissiveTarget(target: MaybeRef<PermissiveTarget>, onTarget: (target: HTMLElement | SVGElement) => void) {
Expand Down
3 changes: 2 additions & 1 deletion src/useReducedMotion.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type Ref, computed } from 'vue'
import { computed } from 'vue'
import type { Ref } from 'vue'
import { useMediaQuery } from '@vueuse/core'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/useSpring.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MaybeRef } from '@vueuse/shared'
import type { MaybeRef } from 'vue'
import { animate } from 'popmotion'
import type { MotionProperties, PermissiveMotionProperties, PermissiveTarget, Spring, SpringControls } from './types'
import { useMotionValues } from './useMotionValues'
Expand Down
6 changes: 2 additions & 4 deletions src/utils/element.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { Ref } from '@vue/reactivity'
import { ref } from '@vue/reactivity'
import { watch } from '@vue/runtime-core'
import { ref, watch } from 'vue'
import type { VueInstance } from '@vueuse/core'
import type { MaybeRef } from '@vueuse/shared'
import type { MaybeRef, Ref } from 'vue'
import type { MotionTarget, PermissiveTarget } from '../types'

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

0 comments on commit c0efec2

Please sign in to comment.