From bb7b516c504907c0a3fb908ea8515f5f638f3d62 Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Mon, 3 Jun 2019 01:55:00 -0300 Subject: [PATCH] feat(full-screen-image): add plugin (#3026) * feat(full-screen-image): add plugin * Update index.ts --- .../plugins/full-screen-image/index.ts | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/@ionic-native/plugins/full-screen-image/index.ts diff --git a/src/@ionic-native/plugins/full-screen-image/index.ts b/src/@ionic-native/plugins/full-screen-image/index.ts new file mode 100644 index 000000000..4d273bb85 --- /dev/null +++ b/src/@ionic-native/plugins/full-screen-image/index.ts @@ -0,0 +1,61 @@ +import { Injectable } from '@angular/core'; +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; + +/** + * @name Full Screen Image + * @description + * This plugin does something + * + * @usage + * ```typescript + * import { FullScreenImage } from '@ionic-native/full-screen-image'; + * + * + * constructor(private fullScreenImage: FullScreenImage) { } + * + * ... + * + * this.fullScreenImage.showImageURL('/assets/...') + * .then((data: any) => console.log(res)) + * .catch((error: any) => console.error(error)); + * + * ... + * + * this.fullScreenImage.showImageBase64('iVBORw0KGgoAAAANSUhEUgAAA...') + * .then((data: any) => console.log(res)) + * .catch((error: any) => console.error(error)); + * + * ``` + */ +@Plugin({ + pluginName: 'FullScreenImage', + plugin: 'es.keensoft.fullscreenimage', + pluginRef: 'FullScreenImage', + repo: 'https://github.com/keensoft/FullScreenImage-Cordova-Plugin', + platforms: ['Android', 'iOS'] +}) +@Injectable() +export class FullScreenImage extends IonicNativePlugin { + + /** + * Opens an image from a URL or path + * @param url {string} url or image path + * @return {Promise} + */ + @Cordova({ sync: true }) + showImageURL(url: string): Promise { + return; + } + + /** + * Opens an image from a base64 string + * @param base64String {string} base64 string + * @param name? {string} image name + * @param type? {string} image extension + * @return {Promise} + */ + @Cordova({ sync: true }) + showImageBase64(base64String: string, name?: string, type?: string): Promise { + return; + } +}