Skip to main content

Variable: env

const env: object;

Type declaration

getBrowser()

getBrowser: () => object;

Gets browser info (IE, Firefox, Safari).

Returns

object

firefox
firefox: boolean;
ie
ie: boolean;
safari
safari: boolean;

getDevice()

getDevice: () => object;

Detects if the device is iOS or Android.

Returns

object

android
android: boolean;
ios
ios: boolean;

getMouseCoords()

getMouseCoords: (e) => object;

Gets mouse or touch coordinates from an event.

Parameters

ParameterTypeDescription
eMouseEvent | TouchEvent | TriggeredEvent<any, any, any, any>

Returns

object

x
x: number;
y
y: number;

getUserAgent()

getUserAgent: () => string;

Gets the user agent string in lowercase.

Returns

string

isMac()

isMac: () => boolean;

Checks if the current OS is Mac.

Returns

boolean

isPhone()

isPhone: () => boolean;

Checks if the device is a phone (max-width: 767px).

Returns

boolean