@clerk/shared
Version:
Internal package utils used by the Clerk SDKs
34 lines • 991 B
TypeScript
//#region src/browser.d.ts
/**
* Checks if the window object is defined. You can also use this to check if something is happening on the client side.
*
* @returns
*/
declare function inBrowser(): boolean;
/**
* Checks if the user agent is a bot.
*
* @param userAgent - Any user agent string
* @returns
*/
declare function userAgentIsRobot(userAgent: string): boolean;
/**
* Checks if the current environment is a browser and the user agent is not a bot.
*
* @returns
*/
declare function isValidBrowser(): boolean;
/**
* Checks if the current environment is a browser and if the navigator is online.
*
* @returns
*/
declare function isBrowserOnline(): boolean;
/**
* Runs `isBrowserOnline` and `isValidBrowser` to check if the current environment is a valid browser and if the navigator is online.
*
* @returns
*/
declare function isValidBrowserOnline(): boolean;
//#endregion
export { inBrowser, isBrowserOnline, isValidBrowser, isValidBrowserOnline, userAgentIsRobot };