Device
isBrowser
Checks if the code is being executed in a browser environment.
ts
export type IsBrowser = booleanisServer
Checks if the code is being executed in a server environment.
ts
export type IsServer = booleanmobileDevicesRegExp
Regular expression pattern to match mobile device user agents.
ts
export type MobileDevicesRegExp = RegExpisMobile
Check if the code is running on a mobile device.
ts
export declare function isMobile(): booleantabletDevicesRegExp
Regular expression pattern to match tablet device user agents.
ts
export type TabletDevicesRegExp = RegExpisTablet
Check if the code is running on a tablet device. Tablet also is kind of mobile device.
ts
export declare function isTablet(): booleanisDesktop
Check if the code is running on a desktop device.
ts
export declare function isDesktop(): booleanappleDevicesRegExp
Regular expression pattern to match apple device user agents.
ts
export type AppleDevicesRegExp = RegExpisApple
Check if the code is running on a apple device.
ts
export declare function isApple(): booleanisAndroid
Check if the code is running on a android device.
ts
export type IsAndroid = booleanwatchResize
Monitor page size changes and execute callbacks.
ts
export interface DeviceResizeWatcherOptions {
immediate: boolean
}
export declare function watchResize(
callback: () => void,
options: DeviceResizeWatcherOptions = { immediate: true }
): void