{"version":3,"sources":["../../../../src/sensors/useDevicePixelRatio/index.ts"],"sourcesContent":["\"use client\";\nimport { useScope, toObs } from \"@usels/core\";\nimport { createDevicePixelRatio } from \"./core\";\n\nexport { createDevicePixelRatio } from \"./core\";\nexport type { UseDevicePixelRatioOptions, UseDevicePixelRatioReturn } from \"./core\";\n\n/**\n * Reactive wrapper around `window.devicePixelRatio`.\n *\n * Tracks the current device pixel ratio and updates automatically when\n * the display's pixel density changes (e.g. moving a window between\n * monitors with different DPI, or browser zoom level changes).\n */\nexport type UseDevicePixelRatio = typeof createDevicePixelRatio;\nexport const useDevicePixelRatio: UseDevicePixelRatio = (options = {}) => {\n  return useScope(\n    (opts) => {\n      const opts$ = toObs(opts, { window: \"opaque\" });\n      return createDevicePixelRatio(opts$);\n    },\n    options as Record<string, unknown>\n  );\n};\n"],"mappings":";AACA,SAAS,UAAU,aAAa;AAChC,SAAS,8BAA8B;AAEvC,SAAS,0BAAAA,+BAA8B;AAWhC,MAAM,sBAA2C,CAAC,UAAU,CAAC,MAAM;AACxE,SAAO;AAAA,IACL,CAAC,SAAS;AACR,YAAM,QAAQ,MAAM,MAAM,EAAE,QAAQ,SAAS,CAAC;AAC9C,aAAO,uBAAuB,KAAK;AAAA,IACrC;AAAA,IACA;AAAA,EACF;AACF;","names":["createDevicePixelRatio"]}