pixi.js
    Preparing search index...

    Type Alias isMobileResult

    The result of the mobile device detection system. Provides detailed information about device type and platform.

    // Type usage with isMobile
    const deviceInfo: isMobileResult = isMobile;

    // Check device categories
    if (deviceInfo.apple.device) {
    console.log('iOS Device Details:', {
    isPhone: deviceInfo.apple.phone,
    isTablet: deviceInfo.apple.tablet,
    isUniversal: deviceInfo.apple.universal
    });
    }

    // Platform-specific checks
    const platformInfo = {
    isApple: deviceInfo.apple.device,
    isAndroid: deviceInfo.android.device,
    isAmazon: deviceInfo.amazon.device,
    isWindows: deviceInfo.windows.device
    };
    type isMobileResult = {
        amazon: { device: boolean; phone: boolean; tablet: boolean };
        android: { device: boolean; phone: boolean; tablet: boolean };
        any: boolean;
        apple: {
            device: boolean;
            ipod: boolean;
            phone: boolean;
            tablet: boolean;
            universal: boolean;
        };
        other: {
            blackberry: boolean;
            blackberry10: boolean;
            chrome: boolean;
            device: boolean;
            firefox: boolean;
            opera: boolean;
        };
        phone: boolean;
        tablet: boolean;
        windows: { device: boolean; phone: boolean; tablet: boolean };
    }
    Index

    Properties

    amazon: { device: boolean; phone: boolean; tablet: boolean }

    Amazon device detection information. Identifies Amazon Fire tablets and phones.

    Type declaration

    • device: boolean

      Whether device is any Amazon mobile device

    • phone: boolean

      Whether device is a Fire Phone

    • tablet: boolean

      Whether device is a Fire Tablet

    // Amazon Fire tablet detection
    if (isMobile.amazon.tablet) {
    // Fire tablet optimizations
    optimizeForFireTablet();
    }
    android: { device: boolean; phone: boolean; tablet: boolean }

    Android device detection information. Categorizes Android phones and tablets.

    Type declaration

    • device: boolean

      Whether device is any Android device

    • phone: boolean

      Whether device is an Android phone

    • tablet: boolean

      Whether device is an Android tablet

    // Android device handling
    if (isMobile.android.device) {
    // Check specific type
    const deviceType = isMobile.android.tablet ?
    'tablet' : 'phone';
    console.log(`Android ${deviceType} detected`);
    }
    any: boolean

    Whether the device is any type of mobile device. True if any mobile platform is detected.

    // Check if device is mobile
    if (isMobile.any) {
    console.log('Running on a mobile device');
    }
    apple: {
        device: boolean;
        ipod: boolean;
        phone: boolean;
        tablet: boolean;
        universal: boolean;
    }

    Apple device detection information. Provides detailed iOS device categorization.

    Type declaration

    • device: boolean

      Whether device is any Apple mobile device

    • ipod: boolean

      Whether the device is an iPod Touch

    • phone: boolean

      Whether the device is an iPhone

    • tablet: boolean

      Whether the device is an iPad

    • universal: boolean

      Whether app is running in iOS universal mode

    // iOS device checks
    if (isMobile.apple.device) {
    if (isMobile.apple.tablet) {
    // iPad-specific code
    useTabletLayout();
    } else if (isMobile.apple.phone) {
    // iPhone-specific code
    usePhoneLayout();
    }
    }
    other: {
        blackberry: boolean;
        blackberry10: boolean;
        chrome: boolean;
        device: boolean;
        firefox: boolean;
        opera: boolean;
    }

    Other device detection information. Covers additional platforms and browsers.

    Type declaration

    • blackberry: boolean

      Whether device is a BlackBerry

    • blackberry10: boolean

      Whether device is a BlackBerry 10

    • chrome: boolean

      Whether browser is Chrome Mobile

    • device: boolean

      Whether device is any other mobile device

    • firefox: boolean

      Whether browser is Firefox Mobile

    • opera: boolean

      Whether browser is Opera Mobile

    // Check other platforms
    if (isMobile.other.blackberry10) {
    // BlackBerry 10 specific code
    } else if (isMobile.other.chrome) {
    // Chrome mobile specific code
    }
    phone: boolean

    Whether the device is any type of phone. Combines detection across all platforms.

    // Check if device is a phone
    if (isMobile.phone) {
    console.log('Running on a mobile phone');
    }
    tablet: boolean

    Whether the device is any type of tablet. Combines detection across all platforms.

    // Check if device is a tablet
    if (isMobile.tablet) {
    console.log('Running on a mobile tablet');
    }
    windows: { device: boolean; phone: boolean; tablet: boolean }

    Windows device detection information. Identifies Windows phones and tablets.

    Type declaration

    • device: boolean

      Whether device is any Windows mobile device

    • phone: boolean

      Whether device is a Windows Phone

    • tablet: boolean

      Whether device is a Windows tablet

    // Windows device checks
    if (isMobile.windows.tablet) {
    // Surface tablet optimizations
    enableTouchFeatures();
    }