react-user-agent-client-hints
Advanced tools
Comparing version 0.2.8 to 0.3.0
@@ -0,4 +1,7 @@ | ||
import { UADataValues, UALowEntropyJSON, NavigatorUA } from "../userAgentData"; | ||
declare type Hint = "brand" | "model" | "version" | "architecture" | "platform" | "mobile" | "platformVersion" | "uaFullVersion" | "bitness" | "wow64" | "fullVersionList"; | ||
export declare function useUserAgentData(hints: Hint[]): [UADataValues | null, Error | null]; | ||
export declare function getLowEntropyUserAgentData(): UALowEntropyJSON | void; | ||
export declare function isNavigatorUA(navigator: unknown): navigator is NavigatorUA; | ||
export {}; | ||
//# sourceMappingURL=useUserAgentData.d.ts.map |
@@ -17,2 +17,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (!isNavigatorUA(navigator)) | ||
return; | ||
try { | ||
@@ -42,3 +44,5 @@ // check if the `navigator.userAgentData` object is available | ||
} | ||
function getLowEntropyUserAgentData() { | ||
export function getLowEntropyUserAgentData() { | ||
if (!isNavigatorUA(navigator)) | ||
return; | ||
if (navigator.userAgentData === undefined) | ||
@@ -48,1 +52,4 @@ return; | ||
} | ||
export function isNavigatorUA(navigator) { | ||
return navigator instanceof Navigator && "userAgentData" in navigator; | ||
} |
{ | ||
"name": "react-user-agent-client-hints", | ||
"version": "0.2.8", | ||
"version": "0.3.0", | ||
"description": "", | ||
@@ -58,5 +58,4 @@ "main": "./dist/index.js", | ||
"files": [ | ||
"dist", | ||
"userAgentData.d.ts" | ||
"dist" | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
11812
12
92