From a47ea3c714df133fbfd06264cf0effaa21104037 Mon Sep 17 00:00:00 2001 From: Jordan Benge Date: Thu, 4 Oct 2018 11:40:39 -0400 Subject: [PATCH 1/4] feat(lastCam): add plugin --- src/@ionic-native/plugins/last-cam/index.ts | 123 ++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 src/@ionic-native/plugins/last-cam/index.ts diff --git a/src/@ionic-native/plugins/last-cam/index.ts b/src/@ionic-native/plugins/last-cam/index.ts new file mode 100644 index 0000000000..290691c967 --- /dev/null +++ b/src/@ionic-native/plugins/last-cam/index.ts @@ -0,0 +1,123 @@ +import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { Observable } from 'rxjs/Observable'; + +/* + @Name: @ionic-native/LastCam + @Description: Last Cam is a Camera Preview plugin that allows you to take capture both Videos and images in a + custom html preview of your choice. + */ + +export interface LastCamStartupOptions { + /** The left edge in pixels, default 0 */ + x?: number; + + /** The top edge in pixels, default 0 */ + y?: number; + + /** The width in pixels, default window.screen.width */ + width?: number; + + /** The height in pixels, default window.screen.height */ + height?: number; + + /** Choose the camera to use 'front' or 'back', default 'front' */ + camera?: string; + +} + +@Plugin({ + pluginName: 'LastCam', + plugin: 'cordova-plugin-last-cam', + pluginRef: 'LastCam', + repo: + 'https://github.com/bengejd/cordova-plugin-last-cam', + platforms: ['iOS'] +}) +@Injectable() +export class LastCam extends IonicNativePlugin { + /** + * Starts the camera preview instance. + * @param {LastCamStartupOptions} options + * @return {Promise} + */ + @Cordova({ + successIndex: 1, + errorIndex: 2 + }) + startCamera(options: LastCamStartupOptions): Promise { + return; + } + + /** + * Stops the camera preview instance. (iOS) + * @return {Promise} + */ + @Cordova() + stopCamera(): Promise { + return; + } + + /** + * Switch from the rear camera and front camera, if available. + * @return {Promise} + */ + @Cordova() + switchCamera(): Promise { + return; + } + + /** + * Switch the flash mode. + * @return {Promise} + */ + @Cordova() + switchFlash(): Promise { + return; + } + + /** + * Take the picture (base64) + * @return {Promise} + */ + @Cordova({ + successIndex: 0, + errorIndex: 1 + }) + takePicture(): Promise { + return; + } + + /** + * Start the video capture + * @return {Promise} + */ + @Cordova() + startVideoCapture(): Promise { + return; + } + + /** + * Stops the video capture + * @return {Promise} + */ + @Cordova({ + successIndex: 0, + errorIndex: 1 + }) + stopVideoCapture(): Promise { + return; + } + + /** + * Promise of the recordingTimer. + * @return {Promise} + */ + @Cordova({ + successIndex : 0, + errorIndex : 1, + }) + recordingTimer(): Promise { + return; + } +} From 3a06b8fb166cbd4d1a7d4f87f1c4490ab51254de Mon Sep 17 00:00:00 2001 From: Jordan Benge Date: Wed, 10 Oct 2018 23:05:21 -0400 Subject: [PATCH 2/4] feat: added watchRecordingTimer observer --- src/@ionic-native/plugins/last-cam/index.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/@ionic-native/plugins/last-cam/index.ts b/src/@ionic-native/plugins/last-cam/index.ts index 290691c967..8b5196ca68 100644 --- a/src/@ionic-native/plugins/last-cam/index.ts +++ b/src/@ionic-native/plugins/last-cam/index.ts @@ -120,4 +120,17 @@ export class LastCam extends IonicNativePlugin { recordingTimer(): Promise { return; } + + /** + * Observable of the recordingTimer. + * @return {Observable} + */ + @Cordova({ + successIndex : 0, + errorIndex : 1, + observable: true + }) + watchRecordingTimer(): Observable { + return; + } } From c7d8bd07867de1c4f2f7a8751084564b8cf9d988 Mon Sep 17 00:00:00 2001 From: Jordan Benge Date: Thu, 11 Oct 2018 01:48:29 -0400 Subject: [PATCH 3/4] fix(lastCam): update plugin name --- src/@ionic-native/plugins/last-cam/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/@ionic-native/plugins/last-cam/index.ts b/src/@ionic-native/plugins/last-cam/index.ts index 8b5196ca68..782f184120 100644 --- a/src/@ionic-native/plugins/last-cam/index.ts +++ b/src/@ionic-native/plugins/last-cam/index.ts @@ -3,7 +3,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs/Observable'; /* - @Name: @ionic-native/LastCam + @Name: LastCam @Description: Last Cam is a Camera Preview plugin that allows you to take capture both Videos and images in a custom html preview of your choice. */ From 644e373471fca40cab4ce98f34e5337c67fdca9c Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Thu, 11 Oct 2018 10:37:03 +0200 Subject: [PATCH 4/4] refactor: lint file and refactor description --- src/@ionic-native/plugins/last-cam/index.ts | 27 +++++++++++---------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/@ionic-native/plugins/last-cam/index.ts b/src/@ionic-native/plugins/last-cam/index.ts index 782f184120..cb8f4cb578 100644 --- a/src/@ionic-native/plugins/last-cam/index.ts +++ b/src/@ionic-native/plugins/last-cam/index.ts @@ -2,12 +2,6 @@ import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs/Observable'; -/* - @Name: LastCam - @Description: Last Cam is a Camera Preview plugin that allows you to take capture both Videos and images in a - custom html preview of your choice. - */ - export interface LastCamStartupOptions { /** The left edge in pixels, default 0 */ x?: number; @@ -23,15 +17,22 @@ export interface LastCamStartupOptions { /** Choose the camera to use 'front' or 'back', default 'front' */ camera?: string; - } +/** + * @name LastCam + * @description + * Last Cam is a Camera Preview plugin that allows you to take capture both Videos and images in a + * custom html preview of your choice. + * + * @interfaces + * LastCamStartupOptions + */ @Plugin({ pluginName: 'LastCam', plugin: 'cordova-plugin-last-cam', pluginRef: 'LastCam', - repo: - 'https://github.com/bengejd/cordova-plugin-last-cam', + repo: 'https://github.com/bengejd/cordova-plugin-last-cam', platforms: ['iOS'] }) @Injectable() @@ -114,8 +115,8 @@ export class LastCam extends IonicNativePlugin { * @return {Promise} */ @Cordova({ - successIndex : 0, - errorIndex : 1, + successIndex: 0, + errorIndex: 1 }) recordingTimer(): Promise { return; @@ -126,8 +127,8 @@ export class LastCam extends IonicNativePlugin { * @return {Observable} */ @Cordova({ - successIndex : 0, - errorIndex : 1, + successIndex: 0, + errorIndex: 1, observable: true }) watchRecordingTimer(): Observable {