Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@markknol
Last active March 1, 2017 00:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markknol/824743c67585ebc18005c30550bb5de9 to your computer and use it in GitHub Desktop.
Save markknol/824743c67585ebc18005c30550bb5de9 to your computer and use it in GitHub Desktop.
Haxe type definitions for isMobile checks https://github.com/kaimallea/isMobile
/**
* Type definitions for <https://github.com/kaimallea/isMobile>
* Don't forget to add the actual script in the head of the html.
*
* @author Mark Knol
*/
@:native("isMobile")
extern class IsMobile
{
public static var apple(default,null):{phone:Bool, ipod:Bool, tablet:Bool, device:Bool};
public static var android(default,null):{phone:Bool, tablet:Bool, device:Bool};
public static var amazon(default,null):{phone:Bool, tablet:Bool, device:Bool};
public static var windows(default,null):{phone:Bool, tablet:Bool, device:Bool};
public static var seven_inch(default,null):Bool;
public static var any(default,null):Bool;
public static var phone(default,null):Bool;
public static var tablet(default,null):Bool;
public static var other(default,null):{blackberry_10:Bool, blackberry:Bool, opera:Bool, firefox:Bool, chrome:Bool, device:Bool};
}
@nadako
Copy link

nadako commented Mar 1, 2017

really no need to write public for extern definitions :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment