mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
feat(photo-viewer): add wrapper for plugin (#359)
* feat(photo-viewer): add wrapper for plugin * tslint
This commit is contained in:
parent
4b8ab4a00f
commit
154c029f79
@ -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';
|
||||
@ -148,6 +149,7 @@ export {
|
||||
NativeStorage,
|
||||
Network,
|
||||
OneSignal,
|
||||
PhotoViewer,
|
||||
ScreenOrientation,
|
||||
PinDialog,
|
||||
Screenshot,
|
||||
@ -223,6 +225,7 @@ window['IonicNative'] = {
|
||||
Printer: Printer,
|
||||
Push: Push,
|
||||
OneSignal: OneSignal,
|
||||
PhotoViewer: PhotoViewer,
|
||||
ScreenOrientation: ScreenOrientation,
|
||||
PinDialog: PinDialog,
|
||||
SafariViewController: SafariViewController,
|
||||
|
28
src/plugins/photo-viewer.ts
Normal file
28
src/plugins/photo-viewer.ts
Normal file
@ -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 { }
|
||||
}
|
Loading…
Reference in New Issue
Block a user