Giter VIP home page Giter VIP logo

capacitor-device's Introduction

npm Gitpod Discord

Provides links based on @capacitor/device.

Documentation

How to use?

Prerequisitions

  1. Install this package in your deep by using npm-packager

By using DeepClient (DeepCase/programmatic)

  1. Insert a link of type Device
  2. Change its object value to the object with propertied described in Device Object Value
    or
    Insert a link of any type with a any name of the list described in Device Object Value from Device link to the same Device link and set its value to the value of the corresponding property of the Device object value

By using this library programatically

Device Object Value

The Device link can have object value that can have following properties:

  • name (type: String): The name of the device.
  • operatingSystem (type: String): The operating system of the device.
  • webViewVersion (type: String): The version of the WebView on the device.
  • manufacturer (type: String): The manufacturer of the device.
  • languageCode (type: String): The language code set on the device.
  • batteryLevel (type: Number): The battery level of the device.
  • languageTag (type: String): The language tag set on the device.
  • isCharging (type: Boolean): Whether the device is charging or not.
  • osVersion (type: String): The version of the operating system on the device.
  • isVirtual (type: Boolean): Whether the device is virtual or not.
  • platform (type: String): The platform on which the device runs.
  • model (type: String): The model of the device.

No one field is required. You can add any of these fields as you want

Fake Json

{
  "identifier": "d787dc6b-041f-4a61-8078-d5573c2e7a4e",
  "model": "X11",
  "platform": "web",
  "isVirtual": false,
  "osVersion": "x86.64",
  "isCharging": true,
  "languageTag": "en",
  "batteryLevel": 1,
  "languageCode": "en",
  "manufacturer": "Google Inc.",
  "webViewVersion": "113.0.0.0",
  "operatingSystem": "unknown"
}

Update Handling

This package includes the HandleUpdate functionality (type: UpdateHandler) that is used to handle updates related to the Device object. HandleUpdate uses handler from @freephoenix888/object-to-links-async-converter to convert Device object value to links everytime when you update it

Contribution

Feel free to contribute. Please fork the repository and submit a pull request for any bugs, improvements, or features.

capacitor-device's People

Contributors

freephoenix888 avatar flakeed avatar github-actions[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.