Skip to content

Commit

Permalink
feat(photo-viewer): add wrapper for plugin (#359)
Browse files Browse the repository at this point in the history
* feat(photo-viewer): add wrapper for plugin

* tslint
  • Loading branch information
ihadeed committed Aug 11, 2016
1 parent 4b8ab4a commit 154c029
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import {NativeStorage} from './plugins/nativestorage';
import {MediaPlugin} from './plugins/media';
import {Network} from './plugins/network';
import {OneSignal} from './plugins/onesignal';
import { PhotoViewer } from './plugins/photo-viewer';
import {ScreenOrientation} from './plugins/screen-orientation';
import {PinDialog} from './plugins/pin-dialog';
import {Printer} from './plugins/printer';
Expand Down Expand Up @@ -148,6 +149,7 @@ export {
NativeStorage,
Network,
OneSignal,
PhotoViewer,
ScreenOrientation,
PinDialog,
Screenshot,
Expand Down Expand Up @@ -223,6 +225,7 @@ window['IonicNative'] = {
Printer: Printer,
Push: Push,
OneSignal: OneSignal,
PhotoViewer: PhotoViewer,
ScreenOrientation: ScreenOrientation,
PinDialog: PinDialog,
SafariViewController: SafariViewController,
Expand Down
28 changes: 28 additions & 0 deletions src/plugins/photo-viewer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Plugin, Cordova } from './plugin';
/**
* @name Photo Viewer
* @description This plugin can display your image in full screen with the ability to pan, zoom, and share the image.
* @usage
* ```typescript
* import { PhotoViewer } from 'ionic-native';
*
* PhotoViewer.show('https://mysite.com/path/to/image.jpg');
*
* PhotoViewer.show('https://mysite.com/path/to/image.jpg', 'My image title', {share: false});
* ```
*/
@Plugin({
plugin: 'com-sarriaroman-photoviewer',
pluginRef: 'PhotoViewer',
repo: 'https://github.com/sarriaroman/photoviewer'
})
export class PhotoViewer {
/**
* Shows an image in full screen
* @param url {string} URL or path to image
* @param title {string}
* @param options {any}
*/
@Cordova({sync: true})
show(url: string, title?: string, options?: {share?: boolean; }): void { }
}

0 comments on commit 154c029

Please sign in to comment.