Skip to content

Commit 5c20722

Browse files
committed
fix: remove unused exported type and unused deps
1 parent d4c8d18 commit 5c20722

File tree

4 files changed

+30
-255
lines changed

4 files changed

+30
-255
lines changed

packages/vue-pacer/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
"devDependencies": {
7575
"@tanstack/config": "0.18.0",
7676
"@vitejs/plugin-vue": "^4.5.0",
77-
"@vue/test-utils": "^2.4.0",
7877
"typescript": "5.8.3",
7978
"vite": "^6.3.5",
8079
"vitest": "^3.1.4"

packages/vue-pacer/src/debouncer/useDebouncedValue.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ import { useDebouncer } from './useDebouncer'
44
import type { MaybeRefOrGetter } from '../types'
55
import type { DebouncerOptions } from '@tanstack/pacer'
66

7-
export interface UseDebouncedValueReturn<TValue> {
8-
/** The current debounced value */
9-
value: Ref<TValue>
10-
/** Force immediate update of the value */
11-
flush: () => void
12-
/** Cancel any pending updates */
13-
cancel: () => void
14-
/** Check if there are any pending updates */
15-
isPending: Readonly<Ref<boolean>>
16-
}
17-
187
/**
198
* A Vue composable that creates a debounced value that updates only after a specified delay.
209
* This composable automatically tracks changes to the input value and updates the
@@ -99,7 +88,16 @@ export interface UseDebouncedValueReturn<TValue> {
9988
export function useDebouncedValue<TValue>(
10089
inputValue: MaybeRefOrGetter<TValue>,
10190
options: DebouncerOptions<(value: TValue) => void>,
102-
): UseDebouncedValueReturn<TValue> {
91+
): {
92+
/** The current debounced value */
93+
value: Ref<TValue>
94+
/** Force immediate update of the value */
95+
flush: () => void
96+
/** Cancel any pending updates */
97+
cancel: () => void
98+
/** Check if there are any pending updates */
99+
isPending: Readonly<Ref<boolean>>
100+
} {
103101
const getValue =
104102
typeof inputValue === 'function'
105103
? (inputValue as () => TValue)

packages/vue-pacer/src/debouncer/useDebouncer.ts

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,6 @@ import { readonly, ref, unref } from 'vue'
44
import type { MaybeRef } from '../types'
55
import type { DebouncerOptions } from '@tanstack/pacer'
66

7-
export interface UseDebouncerReturn<TValue> {
8-
/** The current debounced value */
9-
value: Ref<TValue>
10-
/** Set a new value (will be debounced) */
11-
setValue: (newValue: TValue) => void
12-
/** Force immediate update of the value */
13-
flush: () => void
14-
/** Cancel any pending updates */
15-
cancel: () => void
16-
/** Check if there are any pending updates */
17-
isPending: Readonly<Ref<boolean>>
18-
/** Get the number of times the value has been updated */
19-
executionCount: Readonly<Ref<number>>
20-
/** Update debouncer options */
21-
setOptions: (
22-
newOptions: Partial<DebouncerOptions<(value: TValue) => void>>,
23-
) => void
24-
/** Get current debouncer options */
25-
getOptions: () => Required<DebouncerOptions<(value: TValue) => void>>
26-
}
27-
287
/**
298
* Creates a debouncer instance with Vue reactivity integration.
309
* This composable provides a debounced value that updates only after
@@ -107,7 +86,26 @@ export interface UseDebouncerReturn<TValue> {
10786
export function useDebouncer<TValue>(
10887
initialValue: MaybeRef<TValue>,
10988
optionsInput: DebouncerOptions<(value: TValue) => void>,
110-
): UseDebouncerReturn<TValue> {
89+
): {
90+
/** The current debounced value */
91+
value: Ref<TValue>
92+
/** Set a new value (will be debounced) */
93+
setValue: (newValue: TValue) => void
94+
/** Force immediate update of the value */
95+
flush: () => void
96+
/** Cancel any pending updates */
97+
cancel: () => void
98+
/** Check if there are any pending updates */
99+
isPending: Readonly<Ref<boolean>>
100+
/** Get the number of times the value has been updated */
101+
executionCount: Readonly<Ref<number>>
102+
/** Update debouncer options */
103+
setOptions: (
104+
newOptions: Partial<DebouncerOptions<(value: TValue) => void>>,
105+
) => void
106+
/** Get current debouncer options */
107+
getOptions: () => Required<DebouncerOptions<(value: TValue) => void>>
108+
} {
111109
const value = ref<TValue>(unref(initialValue)) as Ref<TValue>
112110
const _isPending = ref(false)
113111
const _executionCount = ref(0)

0 commit comments

Comments
 (0)