awesome-cordova-plugins/src/plugins/base64togallery.ts

36 lines
1.1 KiB
TypeScript
Raw Normal View History

import {Plugin, Cordova} from './plugin';
2016-03-14 01:39:29 +08:00
/**
* @name Base64 To Gallery
* @description This plugin allows you to save base64 data as a png image into the device
* @usage
* ```ts
* import {Base64ToGallery} from 'ionic-native';
*
*
2016-03-14 01:39:29 +08:00
* Base64ToGallery.base64ToGallery(base64Data, 'img_').then(
* res => console.log("Saved image to gallery ", res),
* err => console.log("Error saving image to gallery ", err)
* );
* ```
*/
@Plugin({
plugin: 'cordova-base64-to-gallery',
pluginRef: 'cordova',
2016-03-15 01:38:35 +08:00
repo: 'https://github.com/Nexxa/cordova-base64-to-gallery',
platforms: ['Android', 'iOS', 'Windows Phone 8']
2016-03-14 01:39:29 +08:00
})
export class Base64ToGallery {
/**
* Converts a base64 string to an image file in the device gallery
2016-07-06 04:11:27 +08:00
* @param {string} data The actual base64 string that you want to save
* @param {sstring} prefix Prefix the file with a string. Default is 'img_'. Optional.
* @returns {Promise} returns a promise that resolves when the image is saved.
2016-03-14 01:39:29 +08:00
*/
@Cordova()
static base64ToGallery(data: string , prefix?: string ): Promise<any> {
return;
2016-03-14 01:39:29 +08:00
}
2016-07-06 04:11:27 +08:00
}