Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BarcodeScanner plugin. #3

Merged
merged 1 commit into from
Feb 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions demo/www/app/home/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Page, NavController} from 'ionic/ionic'

import {
ActionSheet,
BarcodeScanner,
BLE,
Camera,
Calendar,
Expand All @@ -26,6 +27,7 @@ export class HomePage {

this.plugins = [
ActionSheet,
BarcodeScanner,
BLE,
Camera,
Calendar,
Expand Down
3 changes: 2 additions & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ActionSheet } from './plugins/actionsheet';
import { BarcodeScanner } from './plugins/barcodescanner';
import { BLE } from './plugins/ble';
import { Camera } from './plugins/camera';
import { Calendar } from './plugins/calendar';
Expand All @@ -10,4 +11,4 @@ import { Push } from './plugins/push';
import { StatusBar } from './plugins/statusbar';
import { Toast } from './plugins/toast';
import { TouchID } from './plugins/touchid';
export { ActionSheet, BLE, Camera, Calendar, Contacts, Device, Facebook, Geolocation, Push, StatusBar, Toast, TouchID };
export { ActionSheet, BarcodeScanner, BLE, Camera, Calendar, Contacts, Device, Facebook, Geolocation, Push, StatusBar, Toast, TouchID };
3 changes: 3 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions dist/plugins/barcodescanner.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* The Barcode Scanner Plugin opens a camera view and automatically scans a barcode, returning the data back to you.
*
* Requires Cordova plugin: `phonegap-plugin-barcodescanner`. For more info, please see the [BardcodeScanner plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner).
*
* @usage
* ```js
* BarcodeScanner.scan(options).then((barcodeData) => {
* // Success! Barcode data is here
* }, (err) => {
* // An error occurred
* });
* ```
*/
export declare class BarcodeScanner {
static scan(options: any): void;
}
40 changes: 40 additions & 0 deletions dist/plugins/barcodescanner.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/plugins/barcodescanner.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions dist/plugins/camera.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* Take a photo or capture video.
*
* Requires Cordova plugin: `cordova-plugin-camera`. For more info, please see the [Cordova Camera Plugin Docs](https://github.com/apache/cordova-plugin-camera).
*
* @usage
* ```js
* Camera.getPicture(options).then((imageData) => {
* // imageData is either a base64 encoded string or a file URI
* // If it's base64:
* let base64Image = "data:image/jpeg;base64," + imageData;
* }, (err) => {
* });
* ```
*/
export declare class Camera {
static getPicture(options: any): void;
static cleanup(): void;
Expand Down
15 changes: 15 additions & 0 deletions dist/plugins/camera.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/camera.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions dist/plugins/contacts.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Access and manage Contacts on the device.
*
* Requires plugin: `cordova-plugin-contacts`
* For full info, please see the [Cordova Contacts Docs](https://github.com/apache/cordova-plugin-contacts)
*
* @usage
*
* ```js
* Contacts.save({
* displayName: "Mr. Ionitron"
* }).then((contact) => {}, (err) => {})
* ```
*
* See the `save()` docs for a full list of fields.
*
*/
export declare class Contacts {
static create(fields: string[], options: any): void;
static find(fields: string[], options: any): void;
Expand Down
17 changes: 17 additions & 0 deletions dist/plugins/contacts.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/contacts.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions dist/plugins/device.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
/**
* Access information about the underlying device and platform.
*
* @usage
* ```js
* let info = Device.getDevice();
* // Device sits below
* ```
*/
export declare class Device {
/**
* Returns the whole device object.
* @see https://github.com/apache/cordova-plugin-device
* @returns {Object} The device object.
*/
static getDevice(): any;
}
14 changes: 14 additions & 0 deletions dist/plugins/device.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/device.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions dist/plugins/geolocation.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Get geolocation data.
*
* @usage
* ```js
* Geolocation.getCurrentPosition().then((resp) => {
* //resp.coords.latitude
* //resp.coords.longitude
* })
*
* let watch = Geolocation.watchPosition();
* watch.source.subscribe((data) => {
* //data.coords.latitude
* //data.coords.longitude
* })
* ```
*/
export declare class Geolocation {
static getCurrentPosition(options: any): void;
static watchPosition(options: any): void;
Expand Down
17 changes: 17 additions & 0 deletions dist/plugins/geolocation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/geolocation.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions dist/plugins/statusbar.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,57 @@
/**
* Manage the appearance of the native status bar.
*
* @usage
* ```js
* StatusBar.hide(); // Hide the bar
*
* StatusBar.setStyle(StatusBar.LIGHT_CONTENT) // Good for dark backgrounds
* ```
*/
export declare class StatusBar {
/**
* Set whether the status bar overlays the main app view. The default
* is true.
*
* @param doesOverlay whether the status bar overlays the main app view.
*/
static overlaysWebView(doOverlay: boolean): void;
static styleDefault(): void;
static styleLightContent(): void;
static styleBlackTranslucent(): void;
static styleBlackOpaque(): void;
/**
* Set the status bar to a specific named color. Valid options:
* black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown.
*
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing.
*
* @param name the name of the color (from above)
*/
static backgroundColorByName(colorName: string): void;
/**
* Set the status bar to a specific hex color (CSS shorthand supported!).
*
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing.
*
* @param hex the hex value of the color.
*/
static backgroundColorByHexString(hexString: string): void;
/**
* Hide the StatusBar
*
* Options:
*
* StatusBar.DEFAULT
* StatusBar.LIGHT_CONTENT
* StatusBar.BLACK_TRANSLUCENT
* StatusBar.BLACK_OPAQUE
*
* @param style the style from above
*/
static hide(): void;
/**
* Show the StatusBar
*/
static show(): void;
}
Loading