{"_id":"detect-it","_rev":"26-7490981bd6a0a91fd62cbe0bdea984fb","name":"detect-it","description":"Detect if a device is mouse only, touch only, or hybrid","dist-tags":{"latest":"4.0.1","next":"4.0.0-next.2"},"versions":{"0.1.0":{"name":"detect-it","version":"0.1.0","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-it/issues"},"homepage":"https://github.com/rafrex/detect-it#readme","dependencies":{"detect-hover":"^0.1.1","detect-pointer":"^0.1.1","detect-pointer-events":"^0.1.1","detect-touch-events":"^0.2.1"},"devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"f7170e694b9c7066d9fc832c35a32e3733cf5185","_id":"detect-it@0.1.0","_shasum":"01a21f7a231728dff777624692eceae2a1526114","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.0","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"01a21f7a231728dff777624692eceae2a1526114","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-0.1.0.tgz","integrity":"sha512-nB0B4en2x/xsjFFQem2EUlQ4gZtI/XUMrrE9hoCixkOHnU6YIYj75CWyPXBX+F+ikXzqn9goFxboDe6pGDhsCw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDv4Gco7Y1cPsEGBrvo8GA8QbRxuCBCdvWIGnhpmz5uGAIgelAEfFpnfAzCSdLaYtxFwvF1YaDdLQPbsuD77FUwK9M="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/detect-it-0.1.0.tgz_1467952168193_0.001462260028347373"},"directories":{}},"0.2.0":{"name":"detect-it","version":"0.2.0","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-it/issues"},"homepage":"https://github.com/rafrex/detect-it#readme","dependencies":{"detect-hover":"^0.2.0","detect-pointer":"^0.1.1","detect-pointer-events":"^0.1.1","detect-touch-events":"^0.2.1"},"devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"166882274e2cc3f7c44ef04153cd9425d32a3eac","_id":"detect-it@0.2.0","_shasum":"831e0edd73be22fda5584a9c9bce371d03fd6ddf","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.0","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"831e0edd73be22fda5584a9c9bce371d03fd6ddf","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-0.2.0.tgz","integrity":"sha512-IZ+ewjzxZ8/SIrV8bH9hesVB8OmOGc5nkULjkgy5rhuIb0ShQ5eqgSp7lF27TDOdE893JImNnyBGzBklgNY9yw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgIkJoPBQ+AIbfXMlztnCb8ZzCGytdXPwqEzliYf8RSgIhAPL+wI52ZXa0SSNAmAxTKsqdi0AeBoiYMpwOXEbZ33VK"}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/detect-it-0.2.0.tgz_1469072492267_0.22115346370264888"},"directories":{}},"1.0.0":{"name":"detect-it","version":"1.0.0","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-it/issues"},"homepage":"https://github.com/rafrex/detect-it#readme","dependencies":{"detect-hover":"^1.0.0","detect-pointer":"^1.0.0","detect-pointer-events":"^1.0.0","detect-touch-events":"^1.0.0"},"devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"cc566c5f5cea2f164c1e2206ef47cbb1c47a3f39","_id":"detect-it@1.0.0","_shasum":"c5f9bd160e40707f09f15f20a18f91c9c914f1c4","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.0","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"c5f9bd160e40707f09f15f20a18f91c9c914f1c4","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-1.0.0.tgz","integrity":"sha512-4NdsBonvcon/Xl/hcZ9YypCYb1XVuXm3O8DFtQoHyHKfQquwByQiGP4XO57MTx6yzOAw9S7OgOnbmIWJAEH+0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBKDxP+9CosA064fuhjQmz/j911VoM9cYltBWxAYJr/wAiEAzYIAylo9ev5n8GgNKm4K3vikG3CHWxfkZiDz1bYTpT0="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/detect-it-1.0.0.tgz_1469143658401_0.09379921690560877"},"directories":{}},"1.1.0":{"name":"detect-it","version":"1.1.0","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-it/issues"},"homepage":"https://github.com/rafrex/detect-it#readme","dependencies":{"detect-hover":"^1.0.0","detect-passive-events":"^1.0.0","detect-pointer":"^1.0.0","detect-pointer-events":"^1.0.0","detect-touch-events":"^1.0.0"},"devDependencies":{"babel-cli":"^6.18.0","babel-eslint":"^7.1.0","babel-preset-es2015":"^6.18.0","eslint":"^3.9.1","eslint-config-airbnb-base":"^10.0.1","eslint-plugin-import":"^2.2.0"},"gitHead":"c62c5b2ca35e687865cf348658947de943a6ab75","_id":"detect-it@1.1.0","_shasum":"37ad0548e2509c5c70338dfa2d5212e2201f1cf1","_from":".","_npmVersion":"3.10.7","_nodeVersion":"6.2.0","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"37ad0548e2509c5c70338dfa2d5212e2201f1cf1","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-1.1.0.tgz","integrity":"sha512-u2q0h2Xo02bJywVrG/coaaiV0JrblFQZNDPMBTiNgQHpORFCVE8azByqagpgbHFHGHJQ8aa/E9ftFcNi5Yt7fA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICd0R2vGWkzNkkXO+T2JLNFpvyhCLTlgwTGr3ZV7kHOrAiEA4GU2NALYb+rrPFP0w5+gg1BeM/uXYeM+qkv1e5pqF8U="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/detect-it-1.1.0.tgz_1478645151803_0.4580025558825582"},"directories":{}},"2.0.0":{"name":"detect-it","version":"2.0.0","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-it/issues"},"homepage":"https://github.com/rafrex/detect-it#readme","dependencies":{"detect-hover":"^1.0.0","detect-passive-events":"^1.0.0","detect-pointer":"^1.0.0","detect-touch-events":"^1.0.0"},"devDependencies":{"babel-cli":"^6.18.0","babel-eslint":"^7.1.0","babel-preset-es2015":"^6.18.0","eslint":"^3.10.1","eslint-config-airbnb-base":"^10.0.1","eslint-plugin-import":"^2.2.0"},"gitHead":"7d0d2fd02b63c730387aee76ee4719948946fbc2","_id":"detect-it@2.0.0","_shasum":"59eab88098a6c01d59fd0ae914e0df105f9133d0","_from":".","_npmVersion":"3.10.7","_nodeVersion":"6.2.0","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"59eab88098a6c01d59fd0ae914e0df105f9133d0","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-2.0.0.tgz","integrity":"sha512-75yE9zmUJ33kWclt2n4aLYS7EHmz+B6qJPDrpbPZ5WgFvk4/o4WcnylF5HiKHbhFHKw0U4Gi1ZkovZ+cOjwPfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYUD57P24GlZRGnFI4dsux/4tKOn0fDb5nIoDQZCwmFwIgDpVaYdTKMUEdCDVU6jprNhaXudoYFHMLY2HLVOGciFM="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/detect-it-2.0.0.tgz_1479156959834_0.40187955484725535"},"directories":{}},"2.1.0":{"name":"detect-it","version":"2.1.0","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-it/issues"},"homepage":"https://github.com/rafrex/detect-it#readme","dependencies":{"detect-hover":"^1.0.1","detect-passive-events":"^1.0.1","detect-pointer":"^1.0.1","detect-touch-events":"^1.0.1"},"devDependencies":{"babel-cli":"^6.23.0","babel-eslint":"^7.1.0","babel-preset-es2015":"^6.22.0","eslint":"^3.10.1","eslint-config-airbnb-base":"^10.0.1","eslint-plugin-import":"^2.2.0"},"gitHead":"b774fdbb2f4e99bb54087295bf5280ef4a4ad696","_id":"detect-it@2.1.0","_shasum":"4c395fef40e390b1c24f8483ab0a1742c9e4221d","_from":".","_npmVersion":"4.2.0","_nodeVersion":"6.9.5","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"4c395fef40e390b1c24f8483ab0a1742c9e4221d","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-2.1.0.tgz","integrity":"sha512-k0D4I8Mi1o/h7m8ouBnclzV/DnHtVlbO/QSUEHXayhRpgdHTGgZ8VGPugCwDvbk2zNgyIPzcM2y5BOS0B1cMnQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJcaMc+oEdwOOf/fe4SDa1hwitopkrHJidCe66KonrqQIgI/Y59jPy994vijXyXU0XIjjIepbKMCtKCkb39OcrWLY="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/detect-it-2.1.0.tgz_1487964977698_0.043560287449508905"},"directories":{}},"2.1.1":{"name":"detect-it","version":"2.1.1","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-it/issues"},"homepage":"https://github.com/rafrex/detect-it#readme","dependencies":{"detect-hover":"^1.0.1","detect-passive-events":"^1.0.2","detect-pointer":"^1.0.1","detect-touch-events":"^1.0.1"},"devDependencies":{"babel-cli":"^6.23.0","babel-eslint":"^7.1.0","babel-preset-es2015":"^6.22.0","eslint":"^3.10.1","eslint-config-airbnb-base":"^10.0.1","eslint-plugin-import":"^2.2.0"},"gitHead":"23b006275fc52bd76d6b36578dced55b94b32191","_id":"detect-it@2.1.1","_shasum":"dfdb60bff097de9ebe7366201c5350d4e0d64225","_from":".","_npmVersion":"4.2.0","_nodeVersion":"6.9.5","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"dfdb60bff097de9ebe7366201c5350d4e0d64225","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-2.1.1.tgz","integrity":"sha512-ZBC+LVUG18aBmw4JRakDM5fI7kYcsbwpJTVuU6za7cWRfyzzhVbIWZVayGnon1xFeIGxFN3jiZ8QON3YteUyCw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID95tzmrdbLvD44nYHLiCUkEfKapGkZRTi5af2giz4hUAiEAiwUoT0Svr5txS5If9B0AW5InOd1Q7OBjrlNC7KFbPys="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/detect-it-2.1.1.tgz_1488225122256_0.9482177349273115"},"directories":{}},"3.0.0":{"name":"detect-it","version":"3.0.0","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src -d lib --presets=env","prepublish":"npm run build","dev":"npm link && babel src -d lib --watch --presets=env"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-it/issues"},"homepage":"https://github.com/rafrex/detect-it#readme","dependencies":{"detect-hover":"^1.0.1","detect-passive-events":"^1.0.2","detect-pointer":"^1.0.1","detect-touch-events":"^2.0.0"},"devDependencies":{"babel-cli":"^6.24.1","babel-eslint":"^7.2.3","babel-preset-env":"^1.4.0","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.1.3","eslint-plugin-import":"^2.2.0"},"gitHead":"abcd2f3c0a51bec4f9676d9cee41e4bf1a4f56f4","_id":"detect-it@3.0.0","_shasum":"871e4295d98820c75c11d716181bb47a0dc1f242","_from":".","_npmVersion":"4.5.0","_nodeVersion":"6.9.5","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"871e4295d98820c75c11d716181bb47a0dc1f242","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-3.0.0.tgz","integrity":"sha512-6b410QNb/SJiRPm6d+LiWhFtwIEcXHRwIN1lP6N41k1NQkwpvGwChenH0dfgWgc3oo8RzKvDRHN6h4kqaYRLGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAtl/oqUfaGewzN9cnF+fB4ZTzYF/wMNQb5zw96nxokjAiEAjUAq+lKYRACF+X6KzlE14e7emKCRqmHbKQvvF/fBFZE="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/detect-it-3.0.0.tgz_1493865811384_0.38696881430223584"},"directories":{}},"3.0.1":{"name":"detect-it","version":"3.0.1","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src -d lib --presets=env","prepublish":"yarn build","dev":"yarn link && babel src -d lib --watch --presets=env"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-it/issues"},"homepage":"https://github.com/rafrex/detect-it#readme","dependencies":{"detect-hover":"^1.0.1","detect-passive-events":"^1.0.2","detect-pointer":"^1.0.1","detect-touch-events":"^2.0.0"},"devDependencies":{"babel-cli":"^6.24.1","babel-eslint":"^7.2.3","babel-preset-env":"^1.4.0","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.1.3","eslint-plugin-import":"^2.2.0"},"gitHead":"29ff94f193a02566d9d1d910023f5f0f364d8224","_id":"detect-it@3.0.1","_shasum":"8c745eba45c73a8e1748163154da5bbf856f5a1b","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"8c745eba45c73a8e1748163154da5bbf856f5a1b","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-3.0.1.tgz","integrity":"sha512-JQ6LNCr107HNo/cdC+hrvZ5xYPpvx2jlWkGOse1ULRG/UtUYQp+h78ut7JzV0Nt7PesOv9mXGwTq7MFxbAVGvw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/tNnngpP1U+ocVUvj6iyE/Ph2UruHQ8oGCWrnwZPVowIgOnP+iulVMGFOmQQbe0juMjmk69TeDGAuAoADoyQgFGY="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-it-3.0.1.tgz_1502835463776_0.7567970568779856"},"directories":{}},"3.0.2":{"name":"detect-it","version":"3.0.2","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src -d lib --presets=env","prepublish":"yarn build","dev":"yarn link && babel src -d lib --watch --presets=env"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-it/issues"},"homepage":"https://github.com/rafrex/detect-it#readme","dependencies":{"detect-hover":"^1.0.2","detect-passive-events":"^1.0.3","detect-pointer":"^1.0.2","detect-touch-events":"^2.0.1"},"devDependencies":{"babel-cli":"^6.26.0","babel-eslint":"^7.2.3","babel-preset-env":"^1.4.0","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.1.3","eslint-plugin-import":"^2.2.0"},"gitHead":"39ae819948fa379e5ac66c5b226f25785cd73eac","_id":"detect-it@3.0.2","_shasum":"091b489df45ce8eafb3bc76a291ea9ea1687fcb3","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"091b489df45ce8eafb3bc76a291ea9ea1687fcb3","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-3.0.2.tgz","integrity":"sha512-RCzARVa4tKr3E1J2ubP2bPBkdk8agqbJnzf6CMhLBXdczacjThhllxkdojIm2JyV346nfbIbB4m8Tf+/bRj51A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAFyCIASR/gDEBZvXi2g7aDkPMucGRtbQhCZIprYdhDiAiA/pCOew/ZnUZXI7mtSEzS6MVEdRd5zrpSFw3y+//vALA=="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-it-3.0.2.tgz_1506365963566_0.0033517153933644295"},"directories":{}},"3.0.3":{"name":"detect-it","version":"3.0.3","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src -d lib --presets=env","prepublish":"yarn build","dev":"yarn link && babel src -d lib --watch --presets=env"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-it/issues"},"homepage":"https://github.com/rafrex/detect-it#readme","dependencies":{"detect-hover":"^1.0.2","detect-passive-events":"^1.0.4","detect-pointer":"^1.0.2","detect-touch-events":"^2.0.1"},"devDependencies":{"babel-cli":"^6.26.0","babel-eslint":"^7.2.3","babel-preset-env":"^1.4.0","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.1.3","eslint-plugin-import":"^2.2.0"},"gitHead":"19ecd0e45ef26026c23a2de172e5ad147877af3e","_id":"detect-it@3.0.3","_shasum":"8e13daa0b62126150cbf76d083a1d34d1b07d071","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"8e13daa0b62126150cbf76d083a1d34d1b07d071","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-3.0.3.tgz","integrity":"sha512-oTvnQQlTS6bmyy6xPlUGOYZSLOZWu4XgCjxJVX8LsXHUtpVsXd+RM2Mj6g0qTDK/N/QzaT1uhuL+cOZ/RpXftA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHtYOgCAX1J3jmrPZlJRFcGoNn/7hKZGVCKuG3xvc88IAiBv56bKE95Qxb9wbRbputKMR3Cb+7T01fiZJg3obGmumg=="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-it-3.0.3.tgz_1506450478823_0.48535759607329965"},"directories":{}},"3.0.4":{"name":"detect-it","version":"3.0.4","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src -d lib --presets=env","prepublish":"yarn build","dev":"yarn link && babel src -d lib --watch --presets=env"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-it/issues"},"homepage":"https://github.com/rafrex/detect-it#readme","dependencies":{"detect-hover":"^1.0.2","detect-passive-events":"^1.0.4","detect-pointer":"^1.0.2","detect-touch-events":"^2.0.1"},"devDependencies":{"babel-cli":"^6.26.0","babel-eslint":"^7.2.3","babel-preset-env":"^1.6.1","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.1.3","eslint-plugin-import":"^2.2.0"},"gitHead":"05006b7827d2be6aeeb482b147bf52f884d616e9","_id":"detect-it@3.0.4","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"integrity":"sha512-xk2vyacOy0Q4tmnRi+XgcryC+3hIttcGVXGAClkNZ8Sb7hmF9WvwQWfaZRtLR2af1Q7uVXHbmEh3IFMNtMpriA==","shasum":"79df04f25cc5b2529ebfa37c0fa1baa0e1d41862","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-3.0.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5D8mf221flmccVHN/ZQ8Xgn2I/NAabAe88Gn6vZnnEQIhAMvgNcOGyynS77hdCScrk1qRI2LrFT98YOPIgjXTHzEK"}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-it-3.0.4.tgz_1512417795187_0.4332623779773712"},"directories":{}},"3.0.5":{"name":"detect-it","version":"3.0.5","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src -d lib --presets=env","prepublish":"yarn build","dev":"yarn link && babel src -d lib --watch --presets=env"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-it/issues"},"homepage":"https://github.com/rafrex/detect-it#readme","dependencies":{"detect-hover":"^1.0.2","detect-passive-events":"^1.0.4","detect-pointer":"^1.0.2","detect-touch-events":"^2.0.1"},"devDependencies":{"babel-cli":"^6.26.0","babel-eslint":"^7.2.3","babel-preset-env":"^1.6.1","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.1.3","eslint-plugin-import":"^2.2.0"},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2016 Rafael Pedicini\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"detect-it@3.0.5","dist":{"shasum":"816396c0fe12b11af08299a7c2b8381e58d15175","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-3.0.5.tgz","fileCount":8,"unpackedSize":20206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa227CCRA9TVsSAnZWagAAG4kP/2/JZm6RgbQAS9HNjWB3\n9ybzXu6KE7G6srBsOjgwZEsO3yYDs56SCJNxn53pdOTKKyYCiPfdea2JVm37\nr3i5AzlCZAXMg2jBNfWwzCgfAA9SFdLzl6adeIjGbCjVxMrkfsQZxXDC/uoK\nFhwGraRr83mpecAaWYPdrawM7B+CZ3KhKLNNbkND4933N0s337Z6PzKriGLm\n+IotvFaWSRwBFNIjvSFb5lzruYKZCfaP5G3+DTAsiE9sVrMKSJsy3oKZNWaz\nzxJTsuSIbOXiHgWMP/Vc3nrLdtSiLRVLP4vfNr3T2nxwV5BwVOUUDiuAc6xb\nqvB2kRixmUDmVNWGXK0Aao3W1mBm7zO4JG+t3BiS2PCCJRzmL7WIxd/qnKUO\n1RWkn7bb/NrZKdfRgWAzAjififTsXEDZRXNfIdz5Y3EbVE82WMjjdkx8q9ln\nv9cbFNGGtxYG3Zfp4Teqn+lsLJtXxkdyBr1nF88nig227NDoFtYHHljA7i/N\n38rzx2sSmshrwFeiA5pPOh0/aD/mmBAkndFSGjIL5AuJ5FeBkgwutpVxaASa\n2n0bc7oxhrORBgKtHe7azeuJNpMlKE36vk8c+dyr7Tt97j2rvDiejA6mnLBU\nq8VBJl6I1Fhv9u+55oEHWmWFmmniW/+fI9dyN0omRuOvcFC1hqdAkMCGgLj0\nvhNh\r\n=mosF\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-jPqOOOfMkmXK90S0Y+3E/kmfk7vUwsXUMLvGKRDI/lB4L1tkv14NE7AI61k4xSjM7Hn0qwCQ1pndRWmMIXLH/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpYQQcAk0a+cmKq/0ngLjjkhznzr/50BJIp+3diN0K1gIgcx4sEK83Y94gpKt6sqUZ9w0LGn4MOluglmw03qr/7BI="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-it_3.0.5_1524330176677_0.7461891345069906"},"_hasShrinkwrap":false},"3.0.6":{"name":"detect-it","version":"3.0.6","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src -d lib --presets=env","prepublish":"yarn build","dev":"yarn link && babel src -d lib --watch --presets=env"},"repository":{"type":"git","url":"git+https://github.com/rafgraph/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events"],"author":{"name":"Rafael Pedicini","email":"rafael@rafgraph.dev"},"license":"MIT","bugs":{"url":"https://github.com/rafgraph/detect-it/issues"},"homepage":"https://github.com/rafgraph/detect-it#readme","dependencies":{"detect-hover":"^1.0.3","detect-passive-events":"^1.0.5","detect-pointer":"^1.0.3","detect-touch-events":"^2.0.2"},"devDependencies":{"babel-cli":"^6.26.0","babel-eslint":"^7.2.3","babel-preset-env":"^1.6.1","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.1.3","eslint-plugin-import":"^2.2.0"},"gitHead":"acba7f93bb5e6a1477d70d7a72770fe283ced0e0","_id":"detect-it@3.0.6","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-gn+qb1wAejvBGT/07bNC9T8KWVDYSqCXgFaVtPygzCyLK4L53o3b7ZtMTUPGCscT03R2IjXsOVGtzjf6a/8y7w==","shasum":"26b1f08d77949effe144f78dd311d4b2f7e688b1","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-3.0.6.tgz","fileCount":5,"unpackedSize":20289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWoBtCRA9TVsSAnZWagAA8ksQAJxNFrp6Yd6AGwpqxaoQ\nKq6M3NQ6+TrbmF08sFXOZkscxvPPTD81VW/zRlRLAWnhaEkSPlu232oEzOIg\nfCb2r4D96KUS3uz1X4A6AKi/k7HttUMkShlFvnKQrNkl8DvVZZjVI6e1tl5q\noSz4ShFmE6RkBtNikGNfuB9AwP2ygMIfLwy4S22n/EIzF42gddxPOLzfT21m\nfSqxbhcFIUS2Q/lHeWgUnvlz5r2afsODRST0uTus2eOUzCZJ+2uawJpH2rxu\nUpBiykQS593qJWjZoT/5spKfBEYujMy8zBvULetGiyYhtV4oYmB8hjv61rVk\naE/Od94Kzcf50TA0lh/g9Ho1d+SNRZlbW+GTI1pRInxPNOUYf8lIOSAlu5Ui\nhCV4ZgEe+mD6KRfzmYbJWw6yWGeaX2AI2idIC7C8Q2W1dGuUGq6ji6TWeDJH\n/GPqH8cjqnIH1A3NZDV0lW1fIi5Xx4dieop9gJIzSM0z1tx0PbWiN5mP2SkT\nKStseRFOnf5onPQxkCZUNOXmUv49mLRy97P1SN397xMQQC7iinQi2rdNO5bW\n1UJNSwbMLvuHf6vb4LqQ2isuLPx0Y87pfOVwbtiMjlDGMydZcbCEJr1wi6tO\nfpHlNe3cIKeOv0cjbRg062m6lFTITUvL4G2HZ6ImNNHgx+GR6WrpZaKqFBhi\nKuOl\r\n=MCNO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICiD7QqRD3eijes0XfgZS2JB0JeTEBzZneIhayH2QyfVAiAvQB6dlpssyKh87iHMfauDdoBetswsQ3LgUbuT8QwvQA=="}]},"maintainers":[{"name":"rafgraph","email":"rafael@rafgraph.dev"}],"_npmUser":{"name":"rafgraph","email":"rafael@rafgraph.dev"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-it_3.0.6_1599766636858_0.19125305850369556"},"_hasShrinkwrap":false},"3.0.7":{"name":"detect-it","version":"3.0.7","description":"Detect if a device is mouse only, touch only, or hybrid","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src -d lib --presets=env","prepublish":"yarn build","dev":"yarn link && babel src -d lib --watch --presets=env"},"repository":{"type":"git","url":"git+https://github.com/rafgraph/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events"],"author":{"name":"Rafael Pedicini","email":"rafael@rafgraph.dev"},"license":"MIT","bugs":{"url":"https://github.com/rafgraph/detect-it/issues"},"homepage":"https://github.com/rafgraph/detect-it#readme","dependencies":{"detect-hover":"^1.0.3","detect-passive-events":"^1.0.5","detect-pointer":"^1.0.3","detect-touch-events":"^2.0.2"},"devDependencies":{"babel-cli":"^6.26.0","babel-eslint":"^7.2.3","babel-preset-env":"^1.6.1","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.1.3","eslint-plugin-import":"^2.2.0"},"gitHead":"fde5354e315578f16c0c88bf77a3f79e92de1293","_id":"detect-it@3.0.7","_nodeVersion":"12.18.3","_npmVersion":"6.14.8","dist":{"integrity":"sha512-RxpgcdbatUX6epJE09K16iJqF7x6iEcEdoL18FR2zpBO4JhnL7aMOAUoUEyexdtbWOSfTmoDWmeD6mwRBQyRXg==","shasum":"54fcaff8265f8a581a6fd2d7d797b392497c9c27","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-3.0.7.tgz","fileCount":5,"unpackedSize":20315,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiGiVCRA9TVsSAnZWagAApwcP/2IsKvsaLJuzNLnCdrk3\nT2TR64wONvKepTzqlbp3ZN+LWijDbu6IXyC+12xCgSLudHAi4itzCxUXcPkx\n4mtXCSomqdfxYBYbh7cHDswQi1kFzLNmNlMFklQcPOlYdp/aapbcr5ib8OnX\nFuD3hSxyyNUkfm66BW0SwjrjCk8NydwtpbUmRgTFnmERgtcDeWvOCtNSzPQ1\npI5XrmfpAhY0amY5FSqGs5rOmAo4Nvqt0BtpdZCdXGcgMd+ky3LVWQe/qsEb\nTdVMe0msblamBqM/KSxmreu+1af2w4ZMxxRBlCDusZlskpxGjcOlYdwZ5OXn\n0qAx+5N++IdVG5PeilHEPsCFAASiJCEDpYeGw/141dnFeUMj6ZRMJ2uSJDzZ\nM1y7DmSujXUv5viJiDFVzBScGorjzQYI874+LF5r5gomB+YDRvLLcvI+muHd\nVrKNI2niOQGUjVnMFJjEbt7sTL6nwMujS2FXphTeNmeJdST4V7IFP6VL5XqR\nOJlhiihVtbm6XtmFpTD99btL7XtMiic19zjylPYUFmVZA75G6sBHCxU14u0h\nkTWrOOM68b0ove1ERuno8ylRWYl7+c1Mc7Z06qucHAG+QfLcUyRTL0KdkW0+\n2JkVKwdr7mhMWLBSL5F3c2vQ/xobBgLJelLDGrlNqIPcqPh4mrAF4Zp+JAAv\nKI4i\r\n=BOXq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPiAlwJHaBR8WPioubOIW+6y+RY4PAaVDCZr4veW4znwIhAOvD0kM7bc92JiLHQlGTxIE0MqqR++hohqk0k0Bl+z/X"}]},"maintainers":[{"name":"rafgraph","email":"rafael@rafgraph.dev"}],"_npmUser":{"name":"rafgraph","email":"rafael@rafgraph.dev"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-it_3.0.7_1602775188698_0.7396970697696907"},"_hasShrinkwrap":false},"4.0.0-next.0":{"name":"detect-it","version":"4.0.0-next.0","description":"Detect if a device is mouse only, touch only, or hybrid","source":"src/index.ts","main":"dist/detect-it.js","umd:main":"dist/detect-it.umd.min.js","module":"dist/detect-it.esm.js","types":"dist/index.d.ts","sideEffects":false,"scripts":{"dev":"npm link && npm run watch && npm unlink","watch":"rm -rf dist && trap 'exit 0' SIGINT; microbundle watch --format esm,cjs --no-compress --strict --tsconfig tsconfig.build.json & microbundle watch --format umd --compress --strict --tsconfig tsconfig.build.json --external peerDependencies","build":"rm -rf dist && microbundle build --format esm,cjs --no-compress --strict --tsconfig tsconfig.build.json && microbundle build --format umd --compress --strict --tsconfig tsconfig.build.json --external peerDependencies","prepublishOnly":"npm run build","tsc":"tsc --watch","test":"jest","test:watch":"jest --watchAll","coverage":"npx live-server coverage/lcov-report"},"repository":{"type":"git","url":"git+https://github.com/rafgraph/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events"],"author":{"name":"Rafael Pedicini","email":"rafael@rafgraph.dev"},"license":"MIT","bugs":{"url":"https://github.com/rafgraph/detect-it/issues"},"homepage":"https://detect-it.rafgraph.dev","devDependencies":{"@typescript-eslint/eslint-plugin":"^4.4.1","@typescript-eslint/parser":"^4.4.1","eslint":"^7.11.0","eslint-config-prettier":"^6.13.0","eslint-plugin-import":"^2.22.1","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","microbundle":"^0.12.4","prettier":"^2.1.2","ts-jest":"^26.4.1","typescript":"^4.0.3"},"eslintConfig":{"root":true,"parser":"@typescript-eslint/parser","parserOptions":{"sourceType":"module","project":"./tsconfig.json","createDefaultProgram":true},"env":{"browser":true},"extends":["eslint:recommended","plugin:import/errors","plugin:import/warnings","plugin:import/typescript","plugin:@typescript-eslint/recommended","plugin:@typescript-eslint/recommended-requiring-type-checking","prettier","prettier/@typescript-eslint"],"rules":{"import/no-default-export":"error"},"ignorePatterns":["dist","node_modules","jest.config.js"]},"prettier":{"trailingComma":"all","singleQuote":true,"printWidth":100},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"src/**/*":"prettier --write --ignore-unknown"},"readme":"# Detect It\n\nDetect if a device is `mouseOnly`, `touchOnly`, or `hybrid`, and if the primary input is `mouse` or `touch`. Also detects if the browser supports the Pointer Events API, the Touch Events API, and passive event listeners. Detect It is tree-shakable and side-effect free.\n\nThis is useful for creating device responsive UX and responding to user interactions. When creating apps with device responsive UX it is important to know what the user can do. Can they hover? Can they swipe? Etc. Once it's known what the user can do, the next question is how does the app listen for user input. For example, it's not enough to know that the user is on a touch device, the app also needs to know how to listen for touch input, should the app set PointerEvent listeners or TouchEvent listeners? For more on this see the [Recommended usage](#recommended-usage) section.\n\n---\n\n[Live detection test](https://detect-it.rafgraph.dev) (code in the [demo repo](https://github.com/rafgraph/detect-it-demo))\n\n[![npm](https://img.shields.io/npm/dm/detect-it?label=npm)](https://www.npmjs.com/package/detect-it) [![npm bundle size (version)](https://img.shields.io/bundlephobia/minzip/detect-it@next?color=purple)](https://bundlephobia.com/result?p=detect-it@next) ![npm type definitions](https://img.shields.io/npm/types/detect-it?color=blue)\n\n---\n\n> `detect-it` v4 is currently in pre-release, use the `@next` tag to install it, [v3 is available here](https://github.com/rafgraph/detect-it/tree/v3.0.7)\n\n```\nnpm install --save detect-it@next\n```\n\n```js\nimport * as detectIt from 'detect-it';\n// OR\nimport {\n  deviceType,\n  primaryInput,\n  supportsPointerEvents,\n  supportsTouchEvents,\n  supportsPassiveEvents,\n} from 'detect-it';\n```\n\n```js\n// types\ndeviceType: 'mouseOnly' | 'touchOnly' | 'hybrid';\nprimaryInput: 'mouse' | 'touch';\nsupportsPointerEvents: boolean;\nsupportsTouchEvents: boolean;\nsupportsPassiveEvents: boolean;\n```\n\n---\n\n### `deviceType`\n\n**`mouseOnly` | `touchOnly` | `hybrid`**\n\nIndicates if the the device is `mouseOnly`, `touchOnly` or `hybrid`. For info on how the detection works and how specific devices are classified see [Notes on detecting `deviceType`](#notes-on-detecting-devicetype).\n\n```js\nimport { deviceType } from 'detect-it';\n\nif (deviceType === 'hybrid') {\n  // ensure the site is usable by both mouse and touch input\n}\n```\n\n---\n\n### `primaryInput`\n\n**`mouse` | `touch`**\n\nIndicates if the primary input for the device is `mouse` or `touch`. For more info on how to use `primaryInput` see the [Recommended usage](#recommended-usage) section.\n\n```js\nimport { primaryInput } from 'detect-it';\n\nif (primaryInput === 'touch') {\n  // tailor UX for touch input\n} else {\n  // tailor UX for mouse input\n}\n```\n\n---\n\n### `supportsPointerEvents`\n\n**`boolean`**\n\nIndicates if the browser supports the Pointer Events API. See [MDN's Pointer Events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) and the [W3C Pointer Events specification](https://www.w3.org/TR/pointerevents/) for more information on Pointer Events. See [Can I use](https://caniuse.com/mdn-api_pointerevent) for current support.\n\n```js\nimport { supportsPointerEvents } from 'detect-it';\n\nif (supportsPointerEvents) {\n  element.addEventListener('pointerenter', handlePointerEnter, false);\n}\n```\n\n---\n\n### `supportsTouchEvents`\n\n**`boolean`**\n\nIndicates if the browser supports the Touch Events API. See [MDN's Touch Events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events) and the [W3C Touch Events specification](https://w3c.github.io/touch-events/) for more information on Touch Events.\n\n```js\nimport { supportsTouchEvents } from 'detect-it';\n\nif (supportsTouchEvents) {\n  element.addEventListener('touchstart', handleTouchStart, false);\n}\n```\n\n---\n\n### `supportsPassiveEvents`\n\n**`boolean`**\n\nIndicates if the browser supports passive event listeners. See this [Passive Events Explainer](https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md) for more information on passive events. See [Can I use](https://caniuse.com/passive-event-listener) for current support.\n\n```js\nimport { supportsPassiveEvents } from 'detect-it';\n\nif (supportsPassiveEvents) {\n  // passive events are supported by the browser\n  document.addEventListener('scroll', handleScroll, { capture: false, passive: true });\n} else {\n  // passive events are not supported by the browser\n  document.addEventListener('scroll', handleScroll, false);\n}\n```\n\n---\n\n## Pre-built option served from Unpkg CDN\n\nOptionally, instead of using `npm install` you can load Detect It directly in the browser. A minified UMD version is available from Unpkg for this purpose.\n\n```html\n<!-- in index.html -->\n<script src=\"https://unpkg.com/detect-it/dist/detect-it.umd.min.js\"></script>\n```\n\n```js\n// it will be available on the window as detectIt\nif (window.detectIt.primaryInput === 'touch') {\n  // tailor UX for touch input\n}\n```\n\n---\n\n## Recommended usage\n\nTL;DR:\n\n- Use `primaryInput` for creating device responsive UX that optimizes the user experience for either `mouse` or `touch` input (note that the app should still be usable by both inputs). Use this along with classic responsive design that adapts to screen/window size to create a fully device responsive app.\n- Listening for user interactions:\n  - If the browser `supportsPointerEvents` then only set PointerEvent listeners and use [`pointerType`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType) to determine if the interaction was from `mouse` or `touch`.\n  - Otherwise always set both MouseEvent and TouchEvent listeners and use [`event-from`](https://github.com/rafgraph/event-from) to ignore MouseEvents generated from touch input.\n\n### Device responsive UX\n\nDevice responsive UX is about creating web apps that feel native on every device. This goes beyond classic responsive design, which only responds to the screen/window size, and includes how the user can interact with the app (the capabilities of the device). Can the user hover, swipe, long press, etc?\n\nThere are 3 parts of device responsive UX: **Size** (size of screen/window), **Can** (what the user can do/capabilities of the device), and **Is** (is the user hovering, touching, etc). **Size** and **Can** need to be known at render time (when the UI is rendered), and **Is** needs to be known at interaction time (when the user is interacting with the app).\n\n- **Size**\n  - This can be determined using media queries, for example `(max-width: 600px)`, either applied via CSS or in JavaScript by using something like [`react-media`](https://github.com/ReactTraining/react-media).\n- **Can**\n  - This is what **Detect It** is built for - knowing at render time what the capabilities of the device are (what can the user do). There are a number of ways that you could use `deviceType` or `primaryInput` to optimize the UX for the capabilities of the device, however, in most cases I've found it makes sense to just use `primaryInput` and optimize the UX for `mouse` or `touch`, while ensuring that the app is still usable by both inputs.\n- Putting **Size** and **Can** together, my preferred approach is to optimize the UX for 4 scenarios:\n  - Wide screen with `primaryInput` `mouse`: desktop/laptop with a normal window\n  - Narrow screen and `primaryInput` `mouse`: desktop/laptop with a narrow window\n  - Wide screen with `primaryInput` `touch`: tablet\n  - Narrow screen with `primaryInput` `touch`: phone\n- **Is**\n  - Is the user hovering, touching, etc. To help with this I created [React Interactive]() which provides a callback for interactive state changes (`hover`, `mouseActive`, `touchActive`, `keyActive`) and allows you to style touch interactions in ways that are not possible with CSS pseudo selectors.\n\n### Setting event listeners\n\nSetting event listeners can be thought of as either setting PointerEvent listeners **_or_** setting MouseEvent and TouchEvent listeners. PointerEvents can do everything that MouseEvents and TouchEvents can do (and more), without having to worry about if a MouseEvent was caused by touch input and so should be ignored. It is recommended to use PointerEvents if they are supported.\n\n#### PointerEvent listeners\n\nIf the browser `supportsPointerEvents` then only set PointerEvent listeners and use [`pointerType`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType) to determine if the interaction was from `mouse` or `touch`.\n\n```js\nimport { supportsPointerEvents } from 'detect-it';\n\nconst handlePointerEnter = (e) => {\n  if (e.pointerType === 'mouse') {\n    // event from mouse input\n  } else {\n    // event from touch input\n    // note that pointerType can be 'mouse', 'touch' or 'pen'\n    // but in most situations it makes it makes sense to treat 'touch' and 'pen' as the same\n  }\n};\n\nif (supportsPointerEvents) {\n  element.addEventListener('pointerenter', handlePointerEnter, false);\n} else {\n  // set mouse and touch event listeners\n}\n```\n\n#### MouseEvent and TouchEvent listeners\n\nIf the browser doesn't support PointerEvents, then there are a couple of ways to approach setting mouse and touch event listeners.\n\n> Note that a touch interaction will fire TouchEvents as the interaction is in progress (finger on the screen), and then will fire MouseEvents after the touch interaction has finished (after the finger is removed from the screen) to support sites that only listen for MouseEvents.\n\n**Option 1**: If the device is `mouseOnly` or `touchOnly` then only set mouse or touch listeners, and if the device is `hybrid` set both mouse and touch event listeners and ignore MouseEvents caused by touch input (you can use [`event-from`](https://github.com/rafgraph/event-from) for this).\n\n**Option 2**: Always set both mouse and touch event listeners and use [`event-from`](https://github.com/rafgraph/event-from) to ignore MouseEvents from touch input.\n\nI prefer option 2 as it's simpler to code and I haven't noticed any performance impact from setting extra listeners (note that setting TouchEvent listeners on a browser that doesn't support TouchEvents is fine, the browser will just ignore the event listeners).\n\n```js\nimport { supportsPointerEvents } from 'detect-it';\nimport { eventFrom } from 'event-from';\n\nconst handleMouseEnter = (e) => {\n  if (eventFrom(e) !== 'mouse') return;\n  // code for handling mouse enter event from mouse input\n};\n\nconst handleTouchStart = (e) => {\n  // code for handling touch start from touch input\n};\n\nif (supportsPointerEvents) {\n  // set pointer event listeners\n} else {\n  // PointerEvents are not supported so set both MouseEvent and TouchEvent listeners\n  element.addEventListener('mouseenter', handleMouseEnter, false);\n  element.addEventListener('touchstart', handleTouchStart, false);\n}\n```\n\n---\n\n## Notes on detecting `deviceType`\n\nTo determine the `deviceType` and `primaryInput` Detect It uses multiple API detections and media query results to triangulate what type of device is being used. The entire detection is done when the script is imported so the results are known at render time (Detect It doesn't set any event listeners).\n\nDetect It has a wide definition for what constitutes a `hybrid` device, or rather a strict definition for what are `mouseOnly` and `touchOnly` devices, because if a device strays from only a fine point and hover with a mouse, or a coarse touch with a finger, then it should be treated uniquely when considering how the user will interact with it. Below is the source code for determining `deviceType`:\n\n```js\n// a hybrid device is one that both hasTouch and\n// any input can hover or has a fine pointer, or the primary pointer is not coarse\n// if it's not a hybrid, then if it hasTouch it's touchOnly, otherwise it's mouseOnly\nexport const deviceType =\n  hasTouch && (hasAnyHoverOrAnyFinePointer || !hasCoarsePrimaryPointer)\n    ? 'hybrid'\n    : hasTouch\n    ? 'touchOnly'\n    : 'mouseOnly';\n```\n\n#### Some `hybrid` device examples\n\n- A touch capable Chromebook\n- A touch capable Windows computer (both when it's used as a regular computer, and when in tablet mode, e.g. Microsoft Surface without a keyboard)\n- A Samsung Galaxy Note with stylus\n- All iPads now that they support a mouse and keyboard (note that Apple makes it impossible to know if a mouse or keyboard is attached, so iPads are always treated as a `hybrid` with `primaryInput` `touch`)\n\n#### Detection limitations\n\nThese detections are limited by how the browser presents itself (the APIs it exposes and how it responds to media queries) so there is the potential for errors. As anyone who has done web development knows, browsers are quirky and they don't always behave in expected ways, so **Detect It uses real world browser behavior to triangulate the `deviceType` and `primaryInput`.** For more on this see the comments in the [source code](https://github.com/rafgraph/detect-it/blob/main/src/index.ts) for notes about detecting the device type. Also, [tests](https://github.com/rafgraph/detect-it/tree/main/src/__tests__) have been written to mock a number of different browser behaviors and edge cases. Cloning this repo and running `npm test` will provide insight into how `detect-it` will preform on different devices.\n","readmeFilename":"README.md","gitHead":"66266ea7a7ea2e4597971f1039737034350aafc7","_id":"detect-it@4.0.0-next.0","_nodeVersion":"12.18.3","_npmVersion":"6.14.8","dist":{"integrity":"sha512-0/pWPu6XbZVPI2yGNssDh5ghi/Q2i3pnsINtArkVZk6/R41bPIWsrMXNwPpQV4y0urQpPS1MGnWsJ+koQlCVMQ==","shasum":"b3f442019c4227f7733cdd67ad7ba22f2f42cb48","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-4.0.0-next.0.tgz","fileCount":54,"unpackedSize":80803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkJqgCRA9TVsSAnZWagAA+5QQAIWsl5KPdmqyvdwWisKh\n3wgvEG7ObNRGKn4XFGRn2ijayfTcbW6bGdI2owQSigr7Heb6cJeQGBBNf+F9\nHh8z0EjheWKKcziTNTbQ9Bx/5KAaw/f3VuRHKYDbkC6UBq5sogKBBOQvPSyN\ng2q2rOt99NnlK/3TS9J3QxKC3pQc5fzbe7jkDhui5yWScakCN8HfH5RqFaoa\nLtx3uj0BncFdVJlYQCxrQNAaL8i/rQR0xV3XblbxuAQvqrf6PHMaeK8SB/QD\nWbTedtdzWNBil+KH0BbS50z3qXxyJR9+zocen+N9tJpEk9Q2bepbalaGQngS\nDtRcxwB8AfAaaMNs6k8PHQ9L4mQxSZp4Q5+LNFDLdIb2iDlF8sjniovO4j2B\niDPdmeoPYULeMun7WAak7sDwuUbIAuGpfCFyCS0QL69YCgrQEKJVNKc5q1ai\nKRtQHoGqe3jDRg6RE6RQGiPL2tWRZppHYpcq+Y46HFYMQQAwg2/qqK5bTM1W\n22SsbfIgE9ZZshojGUYca/3BthhoU5/gCL51sGjtUvGxwLLGvqyLEfCbleuX\nLRb1gldDM0Fpvrpjx23KazPoxw7sXL+s+gZqtE9luGUqfV3shApN46kv20hS\nY2xv3CFO9AZofysD8zg6OPGt+FxuxxYmGXIbFTnHUnC9fbOWUQuwLjuhD4N/\n5CuV\r\n=WWKS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDCO3zEWIjC7LozLLSug6zDlH7sDboZcvHAFLgPugb69AiEAw304jGstXyHDtGwFtNI8BLFvDEOJ1Al+e8KHToE46Bw="}]},"maintainers":[{"name":"rafgraph","email":"rafael@rafgraph.dev"}],"_npmUser":{"name":"rafgraph","email":"rafael@rafgraph.dev"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-it_4.0.0-next.0_1603312288207_0.6317040380286993"},"_hasShrinkwrap":false},"4.0.0-next.1":{"name":"detect-it","version":"4.0.0-next.1","description":"Detect if a device is mouse only, touch only, or hybrid","main":"dist/detect-it.cjs.js","module":"dist/detect-it.esm.js","types":"dist/index.d.ts","sideEffects":false,"scripts":{"dev":"npm link && npm run watch && npm unlink -g","build":"rollpkg build","watch":"rollpkg watch","prepublishOnly":"npm run lint && npm test && npm run build","lint":"eslint src","test":"jest","test:watch":"jest --watchAll","coverage":"npx live-server coverage/lcov-report","lintStaged":"lint-staged"},"repository":{"type":"git","url":"git+https://github.com/rafgraph/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events","pointer events"],"author":{"name":"Rafael Pedicini","email":"rafael@rafgraph.dev"},"license":"MIT","bugs":{"url":"https://github.com/rafgraph/detect-it/issues"},"homepage":"https://detect-it.rafgraph.dev","devDependencies":{"lint-staged":"^10.5.2","pre-commit":"^1.2.2","rollpkg":"^0.1.1","typescript":"^4.1.2"},"pre-commit":"lintStaged","lint-staged":{"src/**/*":["eslint","prettier --write --ignore-unknown"]},"prettier":"rollpkg/configs/prettier.json","eslintConfig":{"extends":["./node_modules/rollpkg/configs/eslint"],"rules":{"jest/no-mocks-import":"off"}},"jest":{"preset":"rollpkg"},"readme":"# Detect It\n\n- Detect if a device is `mouseOnly`, `touchOnly`, or `hybrid`\n- Detect if the primary input is `mouse` or `touch`\n- Detect if the browser supports Pointer Events, Touch Events, and passive event listeners\n\n[Live detection test](https://detect-it.rafgraph.dev) (code in the [demo repo](https://github.com/rafgraph/detect-it-demo))\n\nDetect It's state is determined using multiple media query and API detections. Detect It uses the `hover` and `pointer` media queries, the Pointer Events API and max touch points detections, and two Touch Events API detections (browsers respond differently to each Touch Events API detection depending on the device 😩 welcome to WebDev). But now you don't have to worry about any of this, just let Detect It handle the details while you optimize your app for the type of device that's being used. 😁 \n\nDetect It has been tested on numerous real world devices (since 2016), and the tests mock multiple devices and edge cases to ensure accurate results, but it should be noted that the detection is reliant on how the browser presents the capabilities of the device as it is not possible to access the device hardware directly.\n\n[![npm](https://img.shields.io/npm/dm/detect-it?label=npm)](https://www.npmjs.com/package/detect-it) [![npm bundle size (version)](https://img.shields.io/bundlephobia/minzip/detect-it@next?color=purple)](https://bundlephobia.com/result?p=detect-it@next) ![npm type definitions](https://img.shields.io/npm/types/detect-it?color=blue)\n\n---\n\n[CDN option](#pre-built-cdn-option) ⚡️ [Recommended usage](#recommended-usage) ⚡️ [Device responsive UX](#device-responsive-ux) ⚡️ [Setting event listeners](#setting-event-listeners) ⚡️ [Detection details](#detection-details)\n\n---\n\n> `detect-it` v4 is currently in pre-release, use the `@next` tag to install it, [v3 is available here](https://github.com/rafgraph/detect-it/tree/v3.0.7)\n\n```\nnpm install --save detect-it@next\n```\n\n```js\nimport * as detectIt from 'detect-it';\n// OR\nimport {\n  deviceType,\n  primaryInput,\n  supportsPointerEvents,\n  supportsTouchEvents,\n  supportsPassiveEvents,\n} from 'detect-it';\n```\n\n```js\n// types\ndeviceType: 'mouseOnly' | 'touchOnly' | 'hybrid';\nprimaryInput: 'mouse' | 'touch';\nsupportsPointerEvents: boolean;\nsupportsTouchEvents: boolean;\nsupportsPassiveEvents: boolean;\n```\n\n---\n\n### `deviceType`\n\n**`mouseOnly` | `touchOnly` | `hybrid`**\n\nIndicates if the the device is `mouseOnly`, `touchOnly` or `hybrid`. For info on how the detection works and how specific devices are classified see the [Detection details](#detection-details) section.\n\n```js\nimport { deviceType } from 'detect-it';\n\nif (deviceType === 'hybrid') {\n  // ensure the site is usable by both mouse and touch input\n}\n```\n\n---\n\n### `primaryInput`\n\n**`mouse` | `touch`**\n\nIndicates if the primary input for the device is `mouse` or `touch`. For more info on how to use `primaryInput` see the [Recommended usage](#recommended-usage) section.\n\n```js\nimport { primaryInput } from 'detect-it';\n\nif (primaryInput === 'touch') {\n  // tailor UX for touch input\n} else {\n  // tailor UX for mouse input\n}\n```\n\n---\n\n### `supportsPointerEvents`\n\n**`boolean`**\n\nIndicates if the browser supports the Pointer Events API. See [MDN's Pointer Events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) and the [W3C Pointer Events specification](https://www.w3.org/TR/pointerevents/) for more information on Pointer Events. See [Can I use](https://caniuse.com/mdn-api_pointerevent) for current support.\n\n```js\nimport { supportsPointerEvents } from 'detect-it';\n\nif (supportsPointerEvents) {\n  element.addEventListener('pointerenter', handlePointerEnter, false);\n}\n```\n\n---\n\n### `supportsTouchEvents`\n\n**`boolean`**\n\nIndicates if the browser supports the Touch Events API. See [MDN's Touch Events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events) and the [W3C Touch Events specification](https://w3c.github.io/touch-events/) for more information on Touch Events.\n\n```js\nimport { supportsTouchEvents } from 'detect-it';\n\nif (supportsTouchEvents) {\n  element.addEventListener('touchstart', handleTouchStart, false);\n}\n```\n\n---\n\n### `supportsPassiveEvents`\n\n**`boolean`**\n\nIndicates if the browser supports passive event listeners. See this [Passive Events Explainer](https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md) for more information on passive events. See [Can I use](https://caniuse.com/passive-event-listener) for current support.\n\n```js\nimport { supportsPassiveEvents } from 'detect-it';\n\nif (supportsPassiveEvents) {\n  // passive events are supported by the browser\n  document.addEventListener('scroll', handleScroll, { capture: false, passive: true });\n} else {\n  // passive events are not supported by the browser\n  document.addEventListener('scroll', handleScroll, false);\n}\n```\n\n---\n\n## Pre-built CDN option\n\nOptionally, instead of using `npm install` you can load Detect It directly in the browser. A minified and production ready UMD version is available from the Unpkg CDN for this purpose.\n\n```html\n<!-- in index.html -->\n<script src=\"https://unpkg.com/detect-it/dist/detect-it.umd.min.js\"></script>\n```\n\n```js\n// it will be available on the window as detectIt\nif (window.detectIt.primaryInput === 'touch') {\n  // tailor UX for touch input\n}\n```\n\n---\n\n## Recommended usage\n\nTL;DR:\n\n- Use `primaryInput` to optimize the user experience for either `mouse` or `touch` input (note that the app should still be usable by both inputs). Use this along with classic responsive design that adapts to screen/window size to create a fully device responsive app.\n- Listening for user interactions:\n  - If the browser `supportsPointerEvents` then only set Pointer Event listeners and use [`pointerType`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType) to determine if the interaction was from `mouse` or `touch`.\n  - Otherwise always set both Mouse Event and Touch Event listeners and use [`event-from`](https://github.com/rafgraph/event-from) to ignore Mouse Events generated from touch input.\n\n### Device responsive UX\n\nDevice responsive UX is about creating web apps that feel native on every device. This goes beyond classic responsive design, which only responds to the screen/window size, and includes how the user can interact with the app (the capabilities of the device). Can the user hover, swipe, long press, etc?\n\nThere are 3 parts of device responsive UX: **Size** (size of screen/window), **Capabilities** (what the user can do/capabilities of the device), and **Interaction** (is the user hovering, touching, etc). **Size** and **Capabilities** need to be known at render time (when the UI is rendered before the user interacts with it), and **Interaction** needs to be known at interaction time (when the user is interacting with the app).\n\n- **Size**\n  - This can be determined using media queries, for example `(max-width: 600px)`, either applied via CSS or in JavaScript by using something like [`react-media`](https://github.com/ReactTraining/react-media).\n- **Capabilities**\n  - This is what **Detect It** is for - knowing at render time what the capabilities of the device are. There are a number of ways that you can use `deviceType` or `primaryInput` to optimize the UX for the capabilities of the device, however, in most cases I've found it makes sense to just use `primaryInput` and optimize the UX for `mouse` or `touch`, while ensuring that the app is still usable by both inputs.\n- Putting **Size** and **Capabilities** together, one approach is to optimize the UX for 4 scenarios:\n  - Wide screen with `primaryInput` `mouse`: desktop/laptop with a normal window\n  - Narrow screen and `primaryInput` `mouse`: desktop/laptop with a narrow window\n  - Wide screen with `primaryInput` `touch`: tablet\n  - Narrow screen with `primaryInput` `touch`: phone\n- **Interaction**\n  - Is the user hovering, touching, etc. To help with this I created [React Interactive](https://github.com/rafgraph/react-interactive) which provides a callback for interactive state changes (`hover`, `mouseActive`, `touchActive`, `keyActive`) and allows you to style touch interactions in ways that feel native and are not possible with CSS pseudo classes.\n\n### Setting event listeners\n\nSetting event listeners can be thought of as either setting Pointer Event listeners **_or_** setting Mouse Event and Touch Event listeners. Pointer Events can do everything that Mouse Events and Touch Events can do (and more), without having to worry about if a Mouse Event was caused by touch input and so should be ignored. It is recommended to use Pointer Events if they are supported.\n\n#### Pointer Event listeners\n\nIf the browser `supportsPointerEvents` then only set Pointer Event listeners and use [`pointerType`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType) to determine if the interaction was from `mouse` or `touch`.\n\n```js\nimport { supportsPointerEvents } from 'detect-it';\n\nconst handlePointerEnter = (e) => {\n  if (e.pointerType === 'mouse') {\n    // event from mouse input\n  } else {\n    // event from touch input\n    // note that pointerType can be 'mouse', 'touch' or 'pen'\n    // but in most situations it makes it makes sense to treat 'touch' and 'pen' as the same\n  }\n};\n\nif (supportsPointerEvents) {\n  element.addEventListener('pointerenter', handlePointerEnter, false);\n} else {\n  // set mouse and touch event listeners\n}\n```\n\n#### Mouse Event and Touch Event listeners\n\nIf the browser doesn't support Pointer Events, then there are a couple of ways to approach setting mouse and touch event listeners.\n\n> Note that a touch interaction will fire Touch Events as the interaction is in progress (finger on the screen), and then will fire Mouse Events after the touch interaction has finished (after the finger is removed from the screen) to support sites that only listen for Mouse Events.\n\n**Option 1**: If the device is `mouseOnly` or `touchOnly` then only set mouse or touch listeners, and if the device is `hybrid` set both mouse and touch event listeners and ignore Mouse Events caused by touch input (you can use [`event-from`](https://github.com/rafgraph/event-from) for this).\n\n**Option 2**: Always set both mouse and touch event listeners and use [`event-from`](https://github.com/rafgraph/event-from) to ignore Mouse Events from touch input.\n\nI prefer option 2 as it's simpler to code and I haven't noticed any performance impact from setting extra listeners (note that setting Touch Event listeners on a browser that doesn't support Touch Events is fine, the browser will just ignore the event listeners).\n\n```js\nimport { supportsPointerEvents } from 'detect-it';\nimport { eventFrom } from 'event-from';\n\nconst handleMouseEnter = (e) => {\n  if (eventFrom(e) !== 'mouse') return;\n  // code for handling mouse enter event from mouse input\n};\n\nconst handleTouchStart = (e) => {\n  // code for handling touch start from touch input\n};\n\nif (supportsPointerEvents) {\n  // set pointer event listeners\n} else {\n  // Pointer Events are not supported so set both Mouse Event and Touch Event listeners\n  element.addEventListener('mouseenter', handleMouseEnter, false);\n  element.addEventListener('touchstart', handleTouchStart, false);\n}\n```\n\n---\n\n## Detection details\n\n#### Determining the `deviceType` and `primaryInput`\n\nTo determine the `deviceType` and `primaryInput` Detect It uses several media query and API detections to triangulate what type of device is being used. The entire detection is done when the script is imported so the results are known at render time (Detect It doesn't set any event listeners).\n\nDetect It uses the `hover` and `pointer` media queries, the Pointer Events API and max touch points detections, and two Touch Events API detections (browsers respond differently to each Touch Events API detection depending on the device). For more on this see the comments in the [source code](https://github.com/rafgraph/detect-it/blob/main/src/index.ts) for notes about detecting the device type and edge cases.\n\n#### Device tests and limitations\n\nDetect It has been tested on numerous real world devices (since 2016), and the [tests](https://github.com/rafgraph/detect-it/tree/main/src/__tests__) mock multiple devices and edge cases to ensure accurate results. However, these detections are limited by how the browser presents the capabilities of the device (the APIs it exposes and how it responds to media queries) so there are some limitations. For example, on an iPad it is impossible to tell if a mouse is connected, so Detect It always treats iPads as a `hybrid` device with `primaryInput` `touch`.\n\nIn the case of a legacy browser or device that doesn't support the detections (e.g. no media query or Pointer Events support), Detect It will fall back to a default `mouseOnly` or `touchOnly` state.\n\n#### Hybrid device definition\n\nDetect It has a wide definition for what constitutes a `hybrid` device, or rather a strict definition for what are `mouseOnly` and `touchOnly` devices, because if a device strays from only a fine point and hover with a mouse, or a coarse touch with a finger, then it should be treated uniquely when considering how the user will interact with it. Below is the source code for determining `deviceType`:\n\n```js\n// a hybrid device is one that both hasTouch and\n// any input can hover or has a fine pointer, or the primary pointer is not coarse\n// if it's not a hybrid, then if it hasTouch it's touchOnly, otherwise it's mouseOnly\nexport const deviceType =\n  hasTouch && (hasAnyHoverOrAnyFinePointer || !hasCoarsePrimaryPointer)\n    ? 'hybrid'\n    : hasTouch\n    ? 'touchOnly'\n    : 'mouseOnly';\n```\n\n#### Some `hybrid` device examples\n\n- A touch capable Chromebook\n- A touch capable Windows computer (both when it's used as a regular computer, and when in tablet mode, e.g. Microsoft Surface without a keyboard)\n- A Samsung Galaxy Note with stylus\n- All iPads now that they support a mouse and keyboard (note that Apple makes it impossible to know if a mouse or keyboard is attached, so iPads are always treated as a `hybrid` with `primaryInput` `touch`)\n","readmeFilename":"README.md","gitHead":"348011935c640f95d3c1e6db79aa09cbb595396d","_id":"detect-it@4.0.0-next.1","_nodeVersion":"14.15.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-suUViDADg07P2NvXmovrl1dO83eiEcdTdtC3UWolHY5JjOIm7UFKUOxKYdNo/2aUQMBMLH+dzBaMG+IIDoEZ+g==","shasum":"799031f5261ecef71433da6cc43496dd1f2519e5","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-4.0.0-next.1.tgz","fileCount":15,"unpackedSize":72228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfwSpECRA9TVsSAnZWagAA/hwQAIvABy8DZFJ6F88nHhxU\nCx95Gl7inInIy1czErp7x0hKcVHuHQ/E+xHvg9Wm829IwE6qUjK6foih2bk3\nAbFbT7NZRN7dEUZzjlCYI/ZcWAdGBkilONIWq/5ZHhEAR/tcfDlixrmkV+qu\n8BfE9sRZbkcVAH8i618Sa3tPFWw43O5SDInK/+9lwdUzINA5sbhhSg9x0Qca\n6TdS/3e/jKVgVkx3Y8uDSFKDNfrSBIkoSYTZ78BOm043TYRvH7Fqi85rzr4+\n3l23oYE3sPa3J4k58I+/5bUnvQ6rmZY/2ycQYnHjtRostQs0eAr7ATAdoUu7\nxiUW/fEqkfysa7WU8HB/GMBrqPw5aqex8aOs51uFvjGzxyOpLsdJ1yar0kOL\ngENzHdH8i8cLpKAqgWF2jYfpiLJi4zqFH0GQxt5WyfT9zQiMSWU0/N4c97oH\nn4o1uxznq9PB9bFqsJjhma1S6cWFpI5MlWZJYMk1BSG27syUbSGHtGbWa4h6\nf1IGYhZaII/cyq5pEy/8bpaeLBonRDs1kHXuyzxbuuC3WIDsGU1eQu0eVgEt\nX0B+KUjpTlK0whw5bl7lSyUXs/JDMSIv5X6ennoMqO6zWi+zVLY5tKcfS2Xx\nv1rJYyFclPikpfUZpJt2yVW+0QlH5hoiVheUGImSJZByApmVBYZHlugOPWkd\nC568\r\n=gMIZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCq8htUWwpvrNFjFLGSK4lRvcEYmfFHHJSwV51+7SWh8gIgS0z9YN0oFQNdmD+3FSpMMVgftxw0Wmcs1LV4WvtHG3Q="}]},"_npmUser":{"name":"rafgraph","email":"rafael@rafgraph.dev"},"directories":{},"maintainers":[{"name":"rafgraph","email":"rafael@rafgraph.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-it_4.0.0-next.1_1606494787697_0.12454855086253391"},"_hasShrinkwrap":false},"4.0.0-next.2":{"name":"detect-it","version":"4.0.0-next.2","description":"Detect if a device is mouse only, touch only, or hybrid","main":"dist/detect-it.cjs.js","module":"dist/detect-it.esm.js","types":"dist/index.d.ts","sideEffects":false,"scripts":{"dev":"npm link && npm run watch && npm unlink -g","build":"rollpkg build","watch":"rollpkg watch","prepublishOnly":"npm run lint && npm test && npm run build","lint":"eslint src","test":"jest","test:watch":"jest --watchAll","coverage":"npx live-server coverage/lcov-report","lintStaged":"lint-staged"},"repository":{"type":"git","url":"git+https://github.com/rafgraph/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events","pointer events"],"author":{"name":"Rafael Pedicini","email":"rafael@rafgraph.dev"},"license":"MIT","bugs":{"url":"https://github.com/rafgraph/detect-it/issues"},"homepage":"https://detect-it.rafgraph.dev","devDependencies":{"lint-staged":"^10.5.2","pre-commit":"^1.2.2","rollpkg":"^0.2.0","typescript":"^4.1.2"},"pre-commit":"lintStaged","lint-staged":{"src/**/*":["eslint","prettier --write --ignore-unknown"]},"prettier":"rollpkg/configs/prettier.json","eslintConfig":{"extends":["./node_modules/rollpkg/configs/eslint"],"rules":{"jest/no-mocks-import":"off"}},"jest":{"preset":"rollpkg"},"readme":"# Detect It\n\n- Detect if a device is `mouseOnly`, `touchOnly`, or `hybrid`\n- Detect if the primary input is `mouse` or `touch`\n- Detect if the browser supports Pointer Events, Touch Events, and passive event listeners\n\n[Live detection test](https://detect-it.rafgraph.dev) (code in the [demo repo](https://github.com/rafgraph/detect-it-demo))\n\nDetect It's state is determined using multiple media query and API detections. Detect It uses the `hover` and `pointer` media queries, the Pointer Events API and max touch points detections, and two Touch Events API detections (browsers respond differently to each Touch Events API detection depending on the device 😩 welcome to WebDev). But now you don't have to worry about any of this, just let Detect It handle the details while you optimize your app for the type of device that's being used. 😁 \n\nDetect It has been tested on numerous real world devices (since 2016), and the tests mock multiple devices and edge cases to ensure accurate results, but it should be noted that the detection is reliant on how the browser presents the capabilities of the device as it is not possible to access the device hardware directly.\n\n[![npm](https://img.shields.io/npm/dm/detect-it?label=npm)](https://www.npmjs.com/package/detect-it) [![npm bundle size (version)](https://img.shields.io/bundlephobia/minzip/detect-it@next?color=purple)](https://bundlephobia.com/result?p=detect-it@next) ![npm type definitions](https://img.shields.io/npm/types/detect-it?color=blue)\n\n---\n\n[CDN option](#pre-built-cdn-option) ⚡️ [Recommended usage](#recommended-usage) ⚡️ [Device responsive UX](#device-responsive-ux) ⚡️ [Setting event listeners](#setting-event-listeners) ⚡️ [Detection details](#detection-details)\n\n---\n\n> `detect-it` v4 is currently in pre-release, use the `@next` tag to install it, [v3 is available here](https://github.com/rafgraph/detect-it/tree/v3.0.7)\n\n```\nnpm install --save detect-it@next\n```\n\n```js\nimport * as detectIt from 'detect-it';\n// OR\nimport {\n  deviceType,\n  primaryInput,\n  supportsPointerEvents,\n  supportsTouchEvents,\n  supportsPassiveEvents,\n} from 'detect-it';\n```\n\n```js\n// types\ndeviceType: 'mouseOnly' | 'touchOnly' | 'hybrid';\nprimaryInput: 'mouse' | 'touch';\nsupportsPointerEvents: boolean;\nsupportsTouchEvents: boolean;\nsupportsPassiveEvents: boolean;\n```\n\n---\n\n### `deviceType`\n\n**`mouseOnly` | `touchOnly` | `hybrid`**\n\nIndicates if the the device is `mouseOnly`, `touchOnly` or `hybrid`. For info on how the detection works and how specific devices are classified see the [Detection details](#detection-details) section.\n\n```js\nimport { deviceType } from 'detect-it';\n\nif (deviceType === 'hybrid') {\n  // ensure the site is usable by both mouse and touch input\n}\n```\n\n---\n\n### `primaryInput`\n\n**`mouse` | `touch`**\n\nIndicates if the primary input for the device is `mouse` or `touch`. For more info on how to use `primaryInput` see the [Recommended usage](#recommended-usage) section.\n\n```js\nimport { primaryInput } from 'detect-it';\n\nif (primaryInput === 'touch') {\n  // tailor UX for touch input\n} else {\n  // tailor UX for mouse input\n}\n```\n\n---\n\n### `supportsPointerEvents`\n\n**`boolean`**\n\nIndicates if the browser supports the Pointer Events API. See [MDN's Pointer Events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) and the [W3C Pointer Events specification](https://www.w3.org/TR/pointerevents/) for more information on Pointer Events. See [Can I use](https://caniuse.com/mdn-api_pointerevent) for current support.\n\n```js\nimport { supportsPointerEvents } from 'detect-it';\n\nif (supportsPointerEvents) {\n  element.addEventListener('pointerenter', handlePointerEnter, false);\n}\n```\n\n---\n\n### `supportsTouchEvents`\n\n**`boolean`**\n\nIndicates if the browser supports the Touch Events API. See [MDN's Touch Events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events) and the [W3C Touch Events specification](https://w3c.github.io/touch-events/) for more information on Touch Events.\n\n```js\nimport { supportsTouchEvents } from 'detect-it';\n\nif (supportsTouchEvents) {\n  element.addEventListener('touchstart', handleTouchStart, false);\n}\n```\n\n---\n\n### `supportsPassiveEvents`\n\n**`boolean`**\n\nIndicates if the browser supports passive event listeners. See this [Passive Events Explainer](https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md) for more information on passive events. See [Can I use](https://caniuse.com/passive-event-listener) for current support.\n\n```js\nimport { supportsPassiveEvents } from 'detect-it';\n\nif (supportsPassiveEvents) {\n  // passive events are supported by the browser\n  document.addEventListener('scroll', handleScroll, { capture: false, passive: true });\n} else {\n  // passive events are not supported by the browser\n  document.addEventListener('scroll', handleScroll, false);\n}\n```\n\n---\n\n## Pre-built CDN option\n\nOptionally, instead of using `npm install` you can load Detect It directly in the browser. A minified and production ready UMD version is available from the Unpkg CDN for this purpose.\n\n```html\n<!-- in index.html -->\n<script src=\"https://unpkg.com/detect-it/dist/detect-it.umd.production.js\"></script>\n```\n\n```js\n// it will be available on the window as DetectIt\nif (window.DetectIt.primaryInput === 'touch') {\n  // tailor UX for touch input\n}\n```\n\n---\n\n## Recommended usage\n\nTL;DR:\n\n- Use `primaryInput` to optimize the user experience for either `mouse` or `touch` input (note that the app should still be usable by both inputs). Use this along with classic responsive design that adapts to screen/window size to create a fully device responsive app.\n- Listening for user interactions:\n  - If the browser `supportsPointerEvents` then only set Pointer Event listeners and use [`pointerType`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType) to determine if the interaction was from `mouse` or `touch`.\n  - Otherwise always set both Mouse Event and Touch Event listeners and use [`event-from`](https://github.com/rafgraph/event-from) to ignore Mouse Events generated from touch input.\n\n### Device responsive UX\n\nDevice responsive UX is about creating web apps that feel native on every device. This goes beyond classic responsive design, which only responds to the screen/window size, and includes how the user can interact with the app (the capabilities of the device). Can the user hover, swipe, long press, etc?\n\nThere are 3 parts of device responsive UX: **Size** (size of screen/window), **Capabilities** (what the user can do/capabilities of the device), and **Interaction** (is the user hovering, touching, etc). **Size** and **Capabilities** need to be known at render time (when the UI is rendered before the user interacts with it), and **Interaction** needs to be known at interaction time (when the user is interacting with the app).\n\n- **Size**\n  - This can be determined using media queries, for example `(max-width: 600px)`, either applied via CSS or in JavaScript by using something like [`react-media`](https://github.com/ReactTraining/react-media).\n- **Capabilities**\n  - This is what **Detect It** is for - knowing at render time what the capabilities of the device are. There are a number of ways that you can use `deviceType` or `primaryInput` to optimize the UX for the capabilities of the device, however, in most cases I've found it makes sense to just use `primaryInput` and optimize the UX for `mouse` or `touch`, while ensuring that the app is still usable by both inputs.\n- Putting **Size** and **Capabilities** together, one approach is to optimize the UX for 4 scenarios:\n  - Wide screen with `primaryInput` `mouse`: desktop/laptop with a normal window\n  - Narrow screen and `primaryInput` `mouse`: desktop/laptop with a narrow window\n  - Wide screen with `primaryInput` `touch`: tablet\n  - Narrow screen with `primaryInput` `touch`: phone\n- **Interaction**\n  - Is the user hovering, touching, etc. To help with this I created [React Interactive](https://github.com/rafgraph/react-interactive) which provides a callback for interactive state changes (`hover`, `mouseActive`, `touchActive`, `keyActive`) and allows you to style touch interactions in ways that feel native and are not possible with CSS pseudo classes.\n\n### Setting event listeners\n\nSetting event listeners can be thought of as either setting Pointer Event listeners **_or_** setting Mouse Event and Touch Event listeners. Pointer Events can do everything that Mouse Events and Touch Events can do (and more), without having to worry about if a Mouse Event was caused by touch input and so should be ignored. It is recommended to use Pointer Events if they are supported.\n\n#### Pointer Event listeners\n\nIf the browser `supportsPointerEvents` then only set Pointer Event listeners and use [`pointerType`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType) to determine if the interaction was from `mouse` or `touch`.\n\n```js\nimport { supportsPointerEvents } from 'detect-it';\n\nconst handlePointerEnter = (e) => {\n  if (e.pointerType === 'mouse') {\n    // event from mouse input\n  } else {\n    // event from touch input\n    // note that pointerType can be 'mouse', 'touch' or 'pen'\n    // but in most situations it makes it makes sense to treat 'touch' and 'pen' as the same\n  }\n};\n\nif (supportsPointerEvents) {\n  element.addEventListener('pointerenter', handlePointerEnter, false);\n} else {\n  // set mouse and touch event listeners\n}\n```\n\n#### Mouse Event and Touch Event listeners\n\nIf the browser doesn't support Pointer Events, then there are a couple of ways to approach setting mouse and touch event listeners.\n\n> Note that a touch interaction will fire Touch Events as the interaction is in progress (finger on the screen), and then will fire Mouse Events after the touch interaction has finished (after the finger is removed from the screen) to support sites that only listen for Mouse Events.\n\n**Option 1**: If the device is `mouseOnly` or `touchOnly` then only set mouse or touch listeners, and if the device is `hybrid` set both mouse and touch event listeners and ignore Mouse Events caused by touch input (you can use [`event-from`](https://github.com/rafgraph/event-from) for this).\n\n**Option 2**: Always set both mouse and touch event listeners and use [`event-from`](https://github.com/rafgraph/event-from) to ignore Mouse Events from touch input.\n\nI prefer option 2 as it's simpler to code and I haven't noticed any performance impact from setting extra listeners (note that setting Touch Event listeners on a browser that doesn't support Touch Events is fine, the browser will just ignore the event listeners).\n\n```js\nimport { supportsPointerEvents } from 'detect-it';\nimport { eventFrom } from 'event-from';\n\nconst handleMouseEnter = (e) => {\n  if (eventFrom(e) !== 'mouse') return;\n  // code for handling mouse enter event from mouse input\n};\n\nconst handleTouchStart = (e) => {\n  // code for handling touch start from touch input\n};\n\nif (supportsPointerEvents) {\n  // set pointer event listeners\n} else {\n  // Pointer Events are not supported so set both Mouse Event and Touch Event listeners\n  element.addEventListener('mouseenter', handleMouseEnter, false);\n  element.addEventListener('touchstart', handleTouchStart, false);\n}\n```\n\n---\n\n## Detection details\n\n#### Determining the `deviceType` and `primaryInput`\n\nTo determine the `deviceType` and `primaryInput` Detect It uses several media query and API detections to triangulate what type of device is being used. The entire detection is done when the script is imported so the results are known at render time (Detect It doesn't set any event listeners).\n\nDetect It uses the `hover` and `pointer` media queries, the Pointer Events API and max touch points detections, and two Touch Events API detections (browsers respond differently to each Touch Events API detection depending on the device). For more on this see the comments in the [source code](https://github.com/rafgraph/detect-it/blob/main/src/index.ts) for notes about detecting the device type and edge cases.\n\n#### Device tests and limitations\n\nDetect It has been tested on numerous real world devices (since 2016), and the [tests](https://github.com/rafgraph/detect-it/tree/main/src/__tests__) mock multiple devices and edge cases to ensure accurate results. However, these detections are limited by how the browser presents the capabilities of the device (the APIs it exposes and how it responds to media queries) so there are some limitations. For example, on an iPad it is impossible to tell if a mouse is connected, so Detect It always treats iPads as a `hybrid` device with `primaryInput` `touch`.\n\nIn the case of a legacy browser or device that doesn't support the detections (e.g. no media query or Pointer Events support), Detect It will fall back to a default `mouseOnly` or `touchOnly` state.\n\n#### Hybrid device definition\n\nDetect It has a wide definition for what constitutes a `hybrid` device, or rather a strict definition for what are `mouseOnly` and `touchOnly` devices, because if a device strays from only a fine point and hover with a mouse, or a coarse touch with a finger, then it should be treated uniquely when considering how the user will interact with it. Below is the source code for determining `deviceType`:\n\n```js\n// a hybrid device is one that both hasTouch and\n// any input can hover or has a fine pointer, or the primary pointer is not coarse\n// if it's not a hybrid, then if it hasTouch it's touchOnly, otherwise it's mouseOnly\nexport const deviceType =\n  hasTouch && (hasAnyHoverOrAnyFinePointer || !hasCoarsePrimaryPointer)\n    ? 'hybrid'\n    : hasTouch\n    ? 'touchOnly'\n    : 'mouseOnly';\n```\n\n#### Some `hybrid` device examples\n\n- A touch capable Chromebook\n- A touch capable Windows computer (both when it's used as a regular computer, and when in tablet mode, e.g. Microsoft Surface without a keyboard)\n- A Samsung Galaxy Note with stylus\n- All iPads now that they support a mouse and keyboard (note that Apple makes it impossible to know if a mouse or keyboard is attached, so iPads are always treated as a `hybrid` with `primaryInput` `touch`)\n","readmeFilename":"README.md","gitHead":"b7ae96c8e6f5eb46d8ea9656e39358be81602525","_id":"detect-it@4.0.0-next.2","_nodeVersion":"14.15.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-C/QK4j/M6k/ia3zXFVtM0zldGrc0agbjdHp7YSQ2qtuTEXxebaZsHmKqfjLQvAv+kR2e2brMhBpaNLyCTen0fg==","shasum":"252c8c031a5f3d5fc4381236c55ecc2ad9525fc1","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-4.0.0-next.2.tgz","fileCount":15,"unpackedSize":72235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxaw/CRA9TVsSAnZWagAAz2UP/jxBxQc5lrsJ1lFevCa+\n1++tEbOfAMmt/DxmpjMq9uTBVEYbfqRTmJ+Jcl+UBIByX38SmJtggWAZxoii\nIufkYhe/iSbbn+9RYTJdq5u7YapRZ/+JInrHR0fetfeiqDfofftcYSca/K4D\nWdgE0gZEjHCipniXff3eJqm8Rq3RfzO2zPgkNAp4pkJEbHRi47G//vuypw7W\nzUMx7tsXz1I73hKGlnqcKQ/MbUrvv+yNzPQKSQx70p9anazwlMhr8tfyKakn\nvnnzq19g6GIrhsScHDFIlQIrVQuRCT2BFdFHXbljqCqLAdJjyLUm07ruJhtz\n8MIV7Rk2oKFq3M2boA1Jo20lAK5shD1laJJvK4KQgTxDujXd7w6RgzQRIjaL\nNKHZNpq1HbMZ4bodDtKjAUXdTOOHX2RddLAVqmuMl6itm6dFdKQ8ZHc7jWij\nGJiB2+kQxzlu60o6EEBruwP+8eN4Z8e7f8AXsyEkb6soONKryH0YxJI5Duy3\ni0zqh4Od2k6t6ojxJDbqAfUJBRoc9WyO6f7RoRNEGpAkUOYyiyKNM/EyaF8w\noWAqu+5Hhh9JDgd2gAvz/XSQ3mjDolsFYxLOfO/WFTvpqfJllCoMgKYWYZsQ\n2hAMnGldoX62/AzYkYvMWkvUyhUq8sanFkrMe/BkCqXm+DluJp86WlualgNq\nRu4k\r\n=koEA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG20lNSAHARVM3+GqHmNRbR9jIFsA1ENp3AEDkkdJWdmAiEAvy5GOkvh5BWAvMQp4blUfo7UKhkQd4PIcqW9Tq36skA="}]},"_npmUser":{"name":"rafgraph","email":"rafael@rafgraph.dev"},"directories":{},"maintainers":[{"name":"rafgraph","email":"rafael@rafgraph.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-it_4.0.0-next.2_1606790206566_0.6881538054737522"},"_hasShrinkwrap":false},"4.0.0":{"name":"detect-it","version":"4.0.0","description":"Detect if a device is mouse only, touch only, or hybrid","main":"dist/detect-it.cjs.js","module":"dist/detect-it.esm.js","types":"dist/index.d.ts","sideEffects":false,"scripts":{"dev":"npm link && npm run watch && npm unlink -g","build":"rollpkg build","watch":"rollpkg watch","prepublishOnly":"npm run lint && npm test && npm run build","lint":"eslint src","test":"jest","test:watch":"jest --watchAll","coverage":"npx live-server coverage/lcov-report","lintStaged":"lint-staged"},"repository":{"type":"git","url":"git+https://github.com/rafgraph/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events","pointer events"],"author":{"name":"Rafael Pedicini","email":"rafael@rafgraph.dev"},"license":"MIT","bugs":{"url":"https://github.com/rafgraph/detect-it/issues"},"homepage":"https://detect-it.rafgraph.dev","devDependencies":{"lint-staged":"^10.5.3","pre-commit":"^1.2.2","rollpkg":"^0.2.1","typescript":"^4.1.3"},"pre-commit":"lintStaged","lint-staged":{"src/**/*":["eslint","prettier --write --ignore-unknown"]},"prettier":"rollpkg/configs/prettier.json","eslintConfig":{"extends":["./node_modules/rollpkg/configs/eslint"],"rules":{"jest/no-mocks-import":"off"}},"jest":{"preset":"rollpkg"},"gitHead":"623bc87ed30785056b60bdb4a95436a2b5f97e71","_id":"detect-it@4.0.0","_nodeVersion":"14.15.0","_npmVersion":"7.2.0","dist":{"integrity":"sha512-JyzLcGWYHIHFfJAEkzLTqm+cyq6hIHn0H8TA1mbvJKMbIFabjwzfZN2b7GSFlvoMXTgC4oYKLOtBxohGOsuLFQ==","shasum":"55980a58f69d799086ff7afddc30b8c1005c9739","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-4.0.0.tgz","fileCount":15,"unpackedSize":72302,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2scZCRA9TVsSAnZWagAA0ZwP/RodEy4OnFxNg8e2OWkE\n9NQmxOQ21Bn6TxFXWvjWTUesGczDJHtoRvf4QgutCaTtDVXAbOs2dLghNesp\nclgG0E212K2i6p4a7Vs6/DFEFdz8NWQBrdZuu/bzCB3uxK2DHS6l0BsYYxAq\nF9sxMhk1866eLFu0aFljcIpBRC4pC/WZi3/ZnfXB23FDvnaYQBVDbJNKA6cK\nlkGsQGkjq3kKGbsGgBm9AaegWgxwNWG4p4IoMba9O/PN24VhaEfybVrPzwgh\nI6r+QJmM1B8N17Qkou76llBzfmviYDiB/B7ilXMzsTuxXSncdL0RgViyV/O/\nNpTtWRrwfrag9VCAf7Mu6Vp8teK82Dkx3PYyU7zmTFtwfmN18nmEebP9l3nE\ntpAPuRK6WlCOGm5o+raEQEEYy+nYMMlUoZgO7IfkJshjveSzf7wNAnRWpiPO\nowVuvBPoaZI+6SGSgPPFWoig2AEMA0IrUtJIPP+9GcdaVOogcdiY+Bu8ygpZ\nvBZQsF6P4H3EJZBF6RpcKvof5niJwpfa416IcFmrex0+sAHLMxPyw0IVf37F\nzwV7Fg+wGm0wN7uls9BXQJQJk1VNLCvuy7WT08Fk/7LdMlH38qOGg6vqjS83\n6vwtbSz7SgWj5yTtvwMbVSROs0t9qDMMAx9Ne6N62zFyEFvrpk8l0a69LN6g\nI8Ib\r\n=WSof\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUaI06M7nYP31jTFxp7cYY1Ap2HCUhCkPeqSvdgiXDWgIgXqOql+a4wgWXx8nmUi+QqRyaF3ocIUuW8EQopsvBTkM="}]},"_npmUser":{"name":"rafgraph","email":"rafael@rafgraph.dev"},"directories":{},"maintainers":[{"name":"rafgraph","email":"rafael@rafgraph.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-it_4.0.0_1608173337205_0.5065711403680442"},"_hasShrinkwrap":false},"4.0.1":{"name":"detect-it","version":"4.0.1","description":"Detect if a device is mouse only, touch only, or hybrid","main":"dist/detect-it.cjs.js","module":"dist/detect-it.esm.js","types":"dist/index.d.ts","sideEffects":false,"scripts":{"build":"rollpkg build --addUmdBuild","watch":"rollpkg watch","prepublishOnly":"npm run lint && npm test && npm run build","lint":"eslint src","test":"jest","test:watch":"jest --watchAll","coverage":"npx live-server coverage/lcov-report","lintStaged":"lint-staged"},"repository":{"type":"git","url":"git+https://github.com/rafgraph/detect-it.git"},"keywords":["detect","device","mouse","touch","hybrid","passive events","pointer events"],"author":{"name":"Rafael Pedicini","email":"rafael@rafgraph.dev"},"license":"MIT","bugs":{"url":"https://github.com/rafgraph/detect-it/issues"},"homepage":"https://detect-it.rafgraph.dev","devDependencies":{"lint-staged":"^10.5.4","pre-commit":"^1.2.2","rollpkg":"^0.4.2","typescript":"^4.1.5"},"pre-commit":"lintStaged","lint-staged":{"(src/**/*|demo/src/**/*)":["eslint","prettier --write --ignore-unknown"]},"prettier":"rollpkg/configs/prettier.json","eslintConfig":{"extends":["./node_modules/rollpkg/configs/eslint"],"rules":{"jest/no-mocks-import":"off"}},"jest":{"preset":"rollpkg"},"gitHead":"20c97dfa0d41e49ab949cc0fec82f56d189cb738","_id":"detect-it@4.0.1","_nodeVersion":"14.15.4","_npmVersion":"7.5.3","dist":{"integrity":"sha512-dg5YBTJYvogK1+dA2mBUDKzOWfYZtHVba89SyZUhc4+e3i2tzgjANFg5lDRCd3UOtRcw00vUTMK8LELcMdicug==","shasum":"3f8de6b8330f5086270571251bedf10aec049e18","tarball":"https://registry.npmjs.org/detect-it/-/detect-it-4.0.1.tgz","fileCount":15,"unpackedSize":71470,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJcjYCRA9TVsSAnZWagAAzNoP/2JRlFzaH/yAFkI5cAfX\nqeZkULWlkf4EdrxC59iDzNM5RO8I6x0OMCtF/JFF8IUHZ7pRP1cyURZNkaw2\ndrTpXbOJf7/UVXUgvLqCNYgq4fnlz8Ki6QJgpKsBgEfxzuV7XXMJhKNen2+m\nBjtL9zLz1c0J1xK9mDLTLrQPFhH4XWOCb2W+87pPm+6ECTOD60JhNAA67ydx\nBXL9fjMJWPhkHq1cVmmE44ILg+k5ePN+zA+7TjtpSI0QQxZiW9jPUEQ9eP1N\nPcNtAYPn6WJrvz1v0A+8yZS6UN8GkEPgkP6SI5IsZF7pXLGF9binbUC5rSxM\nad3OVZe/913b9uI0BCvBexPYNgnAnIqPNy0of7Vx/okrkdMW5UB44pjMe2Ja\nMlyjHV80fdINQLk81k1w2+g+Pf0re1XY6iHaGfr/EjTDPOevnLOevphgEo8p\n8elJyYW9LKxtvDCe2zm2T+XwRW5LgtJltd/KzI2cCyHOiRvHiCqJSKZlJf9l\n0qxRsnuyRez9zgRhX5m9anQCDaaMJz3jsqmMrBYZdpYl5g3JjgsHds4lVgg0\ntiiAk+XutAnxAHCylAgRjl3Hg/m/YxIhkBrloVWmJ0FF0CNnggVXxGJx43mY\n/imrCEUdt+VSMz/FYZFxECX062AreSjV6uWnW93bDj7kz8lJQbPUwz1MTcRW\nM6Pa\r\n=mjip\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQxhlDJ4As93fBlzO3ZqiT+nPk0ghnZwxadvyXB9jWSAIgaDxOTRhyjQjogIY82x6mg41rLOovg2otVfeht0QvYx8="}]},"_npmUser":{"name":"rafgraph","email":"rafael@rafgraph.dev"},"directories":{},"maintainers":[{"name":"rafgraph","email":"rafael@rafgraph.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-it_4.0.1_1613088983746_0.044334908954256624"},"_hasShrinkwrap":false}},"readme":"# Detect It\n\n[![npm](https://img.shields.io/npm/dm/detect-it?label=npm)](https://www.npmjs.com/package/detect-it) [![npm bundle size (version)](https://img.shields.io/bundlephobia/minzip/detect-it?color=purple)](https://bundlephobia.com/result?p=detect-it) ![npm type definitions](https://img.shields.io/npm/types/detect-it?color=blue)\n\n- **[Live detection demo](https://detect-it.rafgraph.dev)**\n- Detect if a device is `mouseOnly`, `touchOnly`, or `hybrid`\n- Detect if the primary input is `mouse` or `touch`\n- Detect if the browser supports Pointer Events, Touch Events, and passive event listeners\n- You may also be interested in [Event From](https://github.com/rafgraph/event-from), which determines if a browser event was caused by `mouse`, `touch`, or `key` input\n\n\nDetect It's state is determined using multiple media query and API detections. Detect It uses the `hover` and `pointer` media queries, the Pointer Events API and max touch points detections, and two Touch Events API detections (browsers respond differently to each Touch Events API detection depending on the device 😩 welcome to WebDev). But now you don't have to worry about any of this, just let Detect It handle the details while you optimize your app for the type of device that's being used. 😁\n\nDetect It has been tested on numerous real world devices (since 2016), and the tests mock multiple devices and edge cases to ensure accurate results. The detection relies on how the browser presents the capabilities of the device as it is not possible to access the device hardware directly.\n\n---\n\n[CDN option](#pre-built-cdn-option) ⚡️ [Recommended usage](#recommended-usage) ⚡️ [Device responsive UX](#device-responsive-ux) ⚡️ [Setting event listeners](#setting-event-listeners) ⚡️ [Detection details](#detection-details)\n\n---\n\n```\nnpm install --save detect-it\n```\n\n```js\nimport * as detectIt from 'detect-it';\n// OR\nimport {\n  deviceType,\n  primaryInput,\n  supportsPointerEvents,\n  supportsTouchEvents,\n  supportsPassiveEvents,\n} from 'detect-it';\n```\n\n```js\n// types\ndeviceType: 'mouseOnly' | 'touchOnly' | 'hybrid';\nprimaryInput: 'mouse' | 'touch';\nsupportsPointerEvents: boolean;\nsupportsTouchEvents: boolean;\nsupportsPassiveEvents: boolean;\n```\n\n---\n\n### `deviceType`\n\n**`mouseOnly` | `touchOnly` | `hybrid`**\n\nIndicates if the the device is `mouseOnly`, `touchOnly` or `hybrid`. For info on how the detection works and how specific devices are classified see the [Detection details](#detection-details) section.\n\n```js\nimport { deviceType } from 'detect-it';\n\nif (deviceType === 'hybrid') {\n  // ensure the site is usable by both mouse and touch input\n}\n```\n\n---\n\n### `primaryInput`\n\n**`mouse` | `touch`**\n\nIndicates if the primary input for the device is `mouse` or `touch`. For more info on how to use `primaryInput` see the [Recommended usage](#recommended-usage) section.\n\n```js\nimport { primaryInput } from 'detect-it';\n\nif (primaryInput === 'touch') {\n  // tailor UX for touch input\n} else {\n  // tailor UX for mouse input\n}\n```\n\n---\n\n### `supportsPointerEvents`\n\n**`boolean`**\n\nIndicates if the browser supports the Pointer Events API. See [MDN's Pointer Events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) and the [W3C Pointer Events specification](https://www.w3.org/TR/pointerevents/) for more information on Pointer Events. See [Can I use](https://caniuse.com/mdn-api_pointerevent) for current support.\n\n```js\nimport { supportsPointerEvents } from 'detect-it';\n\nif (supportsPointerEvents) {\n  element.addEventListener('pointerenter', handlePointerEnter, false);\n}\n```\n\n---\n\n### `supportsTouchEvents`\n\n**`boolean`**\n\nIndicates if the browser supports the Touch Events API. See [MDN's Touch Events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events) and the [W3C Touch Events specification](https://w3c.github.io/touch-events/) for more information on Touch Events.\n\n```js\nimport { supportsTouchEvents } from 'detect-it';\n\nif (supportsTouchEvents) {\n  element.addEventListener('touchstart', handleTouchStart, false);\n}\n```\n\n---\n\n### `supportsPassiveEvents`\n\n**`boolean`**\n\nIndicates if the browser supports passive event listeners. See this [Passive Events Explainer](https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md) for more information on passive events. See [Can I use](https://caniuse.com/passive-event-listener) for current support.\n\n```js\nimport { supportsPassiveEvents } from 'detect-it';\n\nif (supportsPassiveEvents) {\n  // passive events are supported by the browser\n  document.addEventListener('scroll', handleScroll, {\n    capture: false,\n    passive: true,\n  });\n} else {\n  // passive events are not supported by the browser\n  document.addEventListener('scroll', handleScroll, false);\n}\n```\n\n---\n\n## Pre-built CDN option\n\nOptionally, instead of using `npm install` you can load Detect It directly in the browser. A minified and production ready UMD version is available from the Unpkg CDN for this purpose.\n\n```html\n<!-- in index.html -->\n<script src=\"https://unpkg.com/detect-it@4/dist/detect-it.umd.production.js\"></script>\n```\n\n```js\n// it will be available on the window as DetectIt\nif (window.DetectIt.primaryInput === 'touch') {\n  // tailor UX for touch input\n}\n```\n\n---\n\n## Recommended usage\n\nTL;DR:\n\n- Use `primaryInput` to optimize the user experience for either `mouse` or `touch` input (note that the app should still be usable by both inputs). Use this along with classic responsive design that adapts to screen/window size to create a fully device responsive app.\n- Listening for user interactions:\n  - If the browser `supportsPointerEvents` then only set Pointer Event listeners and use [`pointerType`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType) to determine if the interaction was from `mouse` or `touch`.\n  - Otherwise always set both Mouse Event and Touch Event listeners and use [Event From](https://github.com/rafgraph/event-from) to ignore Mouse Events generated from touch input.\n\n### Device responsive UX\n\nDevice responsive UX is about creating web apps that feel native on every device. This goes beyond classic responsive design, which only responds to the screen/window size, and includes how the user can interact with the app (the capabilities of the device). Can the user hover, swipe, long press, etc?\n\nThere are 3 parts of device responsive UX: **Size** (size of screen/window), **Capabilities** (what the user can do/capabilities of the device), and **Interaction** (is the user hovering, touching, etc). **Size** and **Capabilities** need to be known at render time (when the UI is rendered before the user interacts with it), and **Interaction** needs to be known at interaction time (when the user is interacting with the app).\n\n- **Size**\n  - This can be determined using media queries, for example `(max-width: 600px)`, either applied via CSS or in JavaScript by using something like [React Media](https://github.com/ReactTraining/react-media).\n- **Capabilities**\n  - This is what **Detect It** is for - knowing at render time what the capabilities of the device are. There are a number of ways that you can use `deviceType` or `primaryInput` to optimize the UX for the capabilities of the device, however, in most cases I've found it makes sense to just use `primaryInput` and optimize the UX for `mouse` or `touch`, while ensuring that the app is still usable by both inputs.\n- Putting **Size** and **Capabilities** together, one approach is to optimize the UX for 4 scenarios:\n  - Wide screen with `primaryInput` `mouse`: desktop/laptop with a normal window\n  - Narrow screen and `primaryInput` `mouse`: desktop/laptop with a narrow window\n  - Wide screen with `primaryInput` `touch`: tablet\n  - Narrow screen with `primaryInput` `touch`: phone\n- **Interaction**\n  - Is the user hovering, touching, etc. To help with this I created [React Interactive](https://github.com/rafgraph/react-interactive) which provides a callback for interactive state changes (`hover`, `mouseActive`, `touchActive`, `keyActive`) and allows you to style touch interactions in a way that feels native and is not possible with CSS pseudo classes.\n\n### Setting event listeners\n\nSetting event listeners can be thought of as either setting Pointer Event listeners **_or_** setting Mouse Event and Touch Event listeners. Pointer Events can do everything that Mouse Events and Touch Events can do (and more), without having to worry about if a Mouse Event was caused by touch input and so should be ignored. It is generally preferred to use Pointer Events if they are supported.\n\n#### Pointer Event listeners\n\nIf the browser `supportsPointerEvents` then only set Pointer Event listeners and use [`pointerType`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType) to determine if the interaction was from `mouse` or `touch`.\n\n```js\nimport { supportsPointerEvents } from 'detect-it';\n\nconst handlePointerEnter = (e) => {\n  if (e.pointerType === 'mouse') {\n    // event from mouse input\n  } else {\n    // event from touch input\n    // note that pointerType can be 'mouse', 'touch' or 'pen'\n    // but in most situations it makes it makes sense to treat 'touch' and 'pen' as the same\n  }\n};\n\nif (supportsPointerEvents) {\n  element.addEventListener('pointerenter', handlePointerEnter, false);\n} else {\n  // set mouse and touch event listeners\n}\n```\n\n#### Mouse Event and Touch Event listeners\n\nIf the browser doesn't support Pointer Events, then there are a couple of ways to approach setting mouse and touch event listeners.\n\n> Note that a touch interaction will fire Touch Events as the interaction is in progress (touch on the screen), and will fire Mouse Events during a long press (extended touch on the screen), or after the touch interaction has finished (after the touch is removed from the screen) to support sites that only listen for Mouse Events.\n\n**Option 1**: If the device is `mouseOnly` or `touchOnly` then only set mouse or touch listeners, and if the device is `hybrid` set both mouse and touch event listeners and ignore Mouse Events caused by touch input (you can use [Event From](https://github.com/rafgraph/event-from) for this).\n\n**Option 2**: Always set both mouse and touch event listeners and use [Event From](https://github.com/rafgraph/event-from) to ignore Mouse Events from touch input.\n\nI prefer option 2 as it's simpler to code and I haven't noticed any performance impact from setting extra listeners (note that setting Touch Event listeners on a browser that doesn't support Touch Events is fine, the browser will just ignore the event listeners).\n\n```js\nimport { supportsPointerEvents } from 'detect-it';\nimport { eventFrom } from 'event-from';\n\nconst handleMouseEnter = (e) => {\n  if (eventFrom(e) !== 'mouse') return;\n  // code for handling mouse enter event from mouse input\n};\n\nconst handleTouchStart = (e) => {\n  // code for handling touch start from touch input\n};\n\nif (supportsPointerEvents) {\n  // set pointer event listeners\n} else {\n  // Pointer Events are not supported so set both Mouse Event and Touch Event listeners\n  element.addEventListener('mouseenter', handleMouseEnter, false);\n  element.addEventListener('touchstart', handleTouchStart, false);\n}\n```\n\n---\n\n## Detection details\n\n#### Determining the `deviceType` and `primaryInput`\n\nTo determine the `deviceType` and `primaryInput` Detect It uses several media query and API detections to triangulate what type of device is being used. The entire detection is done when the script is imported so the results are known at render time (Detect It doesn't set any event listeners).\n\nDetect It uses the `hover` and `pointer` media queries, the Pointer Events API and max touch points detections, and two Touch Events API detections (browsers respond differently to each Touch Events API detection depending on the device). For more on this see the comments in the [source code](https://github.com/rafgraph/detect-it/blob/main/src/index.ts) for notes about detecting the device type and edge cases.\n\n#### Device tests and limitations\n\nDetect It has been tested on numerous real world devices (since 2016), and the [tests](https://github.com/rafgraph/detect-it/tree/main/src/__tests__) mock multiple devices and edge cases to ensure accurate results. However, these detections are limited by how the browser presents the capabilities of the device (the APIs it exposes and how it responds to media queries) so there are some limitations. For example, on an iPad it is impossible to tell if a mouse is connected, so Detect It always treats iPads as a `hybrid` device with `primaryInput` `touch`.\n\nIn the case of a legacy browser or device that doesn't support the detections (e.g. no media query or Pointer Events support), Detect It will fall back to a default `mouseOnly` or `touchOnly` state.\n\n#### Hybrid device definition\n\nDetect It has a wide definition for what constitutes a `hybrid` device, or rather a strict definition for what are `mouseOnly` and `touchOnly` devices, because if a device strays from only a fine point and hover with a mouse, or a coarse touch with a finger, then it should be treated uniquely when considering how the user will interact with it. Below is the source code for determining `deviceType`:\n\n```js\n// a hybrid device is one that both hasTouch and\n// any input can hover or has a fine pointer, or the primary pointer is not coarse\n// if it's not a hybrid, then if it hasTouch it's touchOnly, otherwise it's mouseOnly\nexport const deviceType =\n  hasTouch && (hasAnyHoverOrAnyFinePointer || !hasCoarsePrimaryPointer)\n    ? 'hybrid'\n    : hasTouch\n    ? 'touchOnly'\n    : 'mouseOnly';\n```\n\n#### Some `hybrid` device examples\n\n- A touch capable Chromebook\n- A touch capable Windows computer (both when it's used as a regular computer, and when in tablet mode, e.g. Microsoft Surface without a keyboard)\n- A Samsung Galaxy Note with stylus\n- All iPads now that they support a mouse and keyboard (note that Apple makes it impossible to know if a mouse or keyboard is attached, so iPads are always treated as a `hybrid` with `primaryInput` `touch`)\n","maintainers":[{"name":"rafgraph","email":"rafael@rafgraph.dev"}],"time":{"modified":"2022-06-15T01:56:42.988Z","created":"2016-07-08T04:29:30.467Z","0.1.0":"2016-07-08T04:29:30.467Z","0.2.0":"2016-07-21T03:41:33.941Z","1.0.0":"2016-07-21T23:27:41.281Z","1.1.0":"2016-11-08T22:45:53.821Z","2.0.0":"2016-11-14T20:56:00.068Z","2.1.0":"2017-02-24T19:36:19.502Z","2.1.1":"2017-02-27T19:52:04.070Z","3.0.0":"2017-05-04T02:43:34.002Z","3.0.1":"2017-08-15T22:17:43.839Z","3.0.2":"2017-09-25T18:59:23.634Z","3.0.3":"2017-09-26T18:27:59.802Z","3.0.4":"2017-12-04T20:03:15.680Z","3.0.5":"2018-04-21T17:02:56.768Z","3.0.6":"2020-09-10T19:37:16.971Z","3.0.7":"2020-10-15T15:19:48.798Z","4.0.0-next.0":"2020-10-21T20:31:28.415Z","4.0.0-next.1":"2020-11-27T16:33:07.881Z","4.0.0-next.2":"2020-12-01T02:36:46.773Z","4.0.0":"2020-12-17T02:48:57.366Z","4.0.1":"2021-02-12T00:16:23.899Z"},"homepage":"https://detect-it.rafgraph.dev","keywords":["detect","device","mouse","touch","hybrid","passive events","pointer events"],"repository":{"type":"git","url":"git+https://github.com/rafgraph/detect-it.git"},"author":{"name":"Rafael Pedicini","email":"rafael@rafgraph.dev"},"bugs":{"url":"https://github.com/rafgraph/detect-it/issues"},"license":"MIT","readmeFilename":"README.md","users":{"xiechao06":true}}