Skip to content

Commit 1b3d4e6

Browse files
authored
feat(useDevicePixelRatio): improve types (#4927)
1 parent a73eedd commit 1b3d4e6

File tree

1 file changed

+2
-1
lines changed
  • packages/core/useDevicePixelRatio

1 file changed

+2
-1
lines changed

packages/core/useDevicePixelRatio/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { WatchStopHandle } from 'vue'
12
import type { ConfigurableWindow } from '../_configurable'
23
import { noop, watchImmediate } from '@vueuse/shared'
34
import { readonly, shallowRef } from 'vue'
@@ -18,7 +19,7 @@ export function useDevicePixelRatio(options: ConfigurableWindow = {}) {
1819

1920
const pixelRatio = shallowRef(1)
2021
const query = useMediaQuery(() => `(resolution: ${pixelRatio.value}dppx)`, options)
21-
let stop = noop
22+
let stop: WatchStopHandle = noop
2223

2324
if (window) {
2425
stop = watchImmediate(query, () => pixelRatio.value = window!.devicePixelRatio)

0 commit comments

Comments
 (0)