@dvcol/common-utils
Version:
Typescript library for common utility functions and constants
27 lines (25 loc) • 681 B
text/typescript
interface NavigatorBrandVersion {
readonly brand: string;
readonly version: string;
}
interface NavigatorUserAgentData {
readonly brands: NavigatorBrandVersion[];
readonly mobile: boolean;
readonly platform: string;
}
declare global {
interface Navigator {
userAgentData?: NavigatorUserAgentData;
}
}
/**
* Returns true if the navigator indicates macOS
*/
declare const isMacOs: () => boolean;
/**
* Returns the short locale (ISO 639-1) of the current browser.
* I.e. 'en' for 'en-US'.
*/
declare const getShortLocale: () => string;
declare const getNavigatorVersion: () => string;
export { getNavigatorVersion, getShortLocale, isMacOs };