Options
All
  • Public
  • Public/Protected
  • All
Menu

Device

Drafts defines a single global device object which provides access to information about the current device.

Examples

// get system info from device object
var model = device.model;
var system = device.systemName;
var osVersion = device.systemVersion;
var batteryLevel = device.batteryLevel;

// create and display it in an alert
var s = "Model: " + model + "\n";
s = s + "System: " + system + "\n";
s = s + "OS: " + osVersion + "\n";
s = s + "Battery: " + batteryLevel;
alert(s);

Hierarchy

  • Device

Index

Properties

batteryLevel

batteryLevel: number

Current battery level as a number between 0.0 and 1.0

model

model: "iPhone" | "iPad" | "Mac"

Model of current device.

systemName

systemName: "iOS" | "macOS"

Name of current OS.

systemVersion

systemVersion: string

Version of current OS.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc