UNPKG

ionic-native

Version:

Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support

79 lines 2.8 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var plugin_1 = require('./plugin'); /** * @name Flashlight * @description This plugin allows you to switch the flashlight / torch of the device on and off. * * Requires Cordova plugin: `cordova-plugin-flashlight`. For more info, please see the [Flashlight plugin docs](https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin). * * @usage * ```typescript * import { Flashlight } from 'ionic-native'; * * * * ``` */ var Flashlight = (function () { function Flashlight() { } /** * Checks if the flashlight is available * @returns {Promise<boolean>} Returns a promise that resolves with a boolean stating if the flashlight is available. */ Flashlight.available = function () { return; }; /** * Switches the flashlight on * @returns {Promise<boolean>} */ Flashlight.switchOn = function () { return; }; /** * Switches the flashlight off * @returns {Promise<boolean>} */ Flashlight.switchOff = function () { return; }; /** * Toggles the flashlight * @returns {Promise<any>} */ Flashlight.toggle = function () { return; }; /** * Checks if the flashlight is turned on. * @returns {boolean} */ Flashlight.isSwitchedOn = function () { return; }; __decorate([ plugin_1.Cordova() ], Flashlight, "available", null); __decorate([ plugin_1.Cordova() ], Flashlight, "switchOn", null); __decorate([ plugin_1.Cordova() ], Flashlight, "switchOff", null); __decorate([ plugin_1.Cordova() ], Flashlight, "toggle", null); __decorate([ plugin_1.Cordova({ sync: true }) ], Flashlight, "isSwitchedOn", null); Flashlight = __decorate([ plugin_1.Plugin({ pluginName: 'Flashlight', plugin: 'cordova-plugin-flashlight', pluginRef: 'window.plugins.flashlight', repo: 'https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git' }) ], Flashlight); return Flashlight; }()); exports.Flashlight = Flashlight; //# sourceMappingURL=flashlight.js.map