DeviceUtils: {
    addOnlineStatusListener(callback): (() => void);
    getBatteryLevel(): Promise<null | number>;
    getConnectionType(): null | string;
    getDeviceType(): "mobile" | "tablet" | "desktop";
    getHardwareConcurrency(): number;
    getLanguage(): string;
    getMemory(): null | number;
    getOrientation(): "portrait" | "landscape";
    getPixelRatio(): number;
    getPlatform(): string;
    getScreenDimensions(): {
        width: number;
        height: number;
    };
    getVendor(): string;
    isMacAddress(mac): boolean;
    isMobile(): boolean;
    isOnline(): boolean;
    supportsTouch(): boolean;
} = ...

Type declaration

  • addOnlineStatusListener:function
    • Adds a listener for online/offline status changes

      Parameters

      • callback: ((isOnline) => void)

        Function to call when status changes

          • (isOnline): void
          • Parameters

            • isOnline: boolean

            Returns void

      Returns (() => void)

      Function to remove the listener

        • (): void
        • Returns void

  • getBatteryLevel:function
    • Gets the battery level of the device

      Returns Promise<null | number>

      Promise resolving to battery level (0-1) or null if not available

  • getConnectionType:function
    • Gets the connection type of the device

      Returns null | string

      Connection type or null if not available

  • getDeviceType:function
    • Gets the device type (mobile, tablet, desktop)

      Returns "mobile" | "tablet" | "desktop"

      Device type

  • getHardwareConcurrency:function
    • Gets the number of CPU cores available

      Returns number

      Number of CPU cores

  • getLanguage:function
    • Gets the device language

      Returns string

      Device language

  • getMemory:function
    • Gets the device memory in GB

      Returns null | number

      Device memory or null if not available

  • getOrientation:function
    • Gets the device orientation

      Returns "portrait" | "landscape"

      Device orientation

  • getPixelRatio:function
    • Gets the device pixel ratio

      Returns number

      Device pixel ratio

  • getPlatform:function
    • Gets the device platform

      Returns string

      Device platform

  • getScreenDimensions:function
    • Gets the screen dimensions

      Returns {
          width: number;
          height: number;
      }

      Object containing screen width and height

      • width: number
      • height: number
  • getVendor:function
    • Gets the device vendor

      Returns string

      Device vendor

  • isMacAddress:function
    • Checks if a string is a valid MAC address

      Parameters

      • mac: string

        MAC address to validate

      Returns boolean

      True if valid, false otherwise

  • isMobile:function
    • Checks if the device is a mobile device

      Returns boolean

      True if mobile device

  • isOnline:function
    • Checks if the device is online

      Returns boolean

      True if online

  • supportsTouch:function
    • Checks if the device supports touch events

      Returns boolean

      True if touch is supported