mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-17 00:51:07 +08:00
Screenshot Plugin
This commit is contained in:
parent
8e062a94c7
commit
ec4f3c69ec
@ -38,6 +38,7 @@ import {LaunchNavigator} from './plugins/launchnavigator';
|
|||||||
import {LocalNotifications} from './plugins/localnotifications';
|
import {LocalNotifications} from './plugins/localnotifications';
|
||||||
import {Network, Connection} from './plugins/network';
|
import {Network, Connection} from './plugins/network';
|
||||||
import {Push} from './plugins/push';
|
import {Push} from './plugins/push';
|
||||||
|
import {Screenshot} from './plugins/screenshot';
|
||||||
import {SMS} from './plugins/sms';
|
import {SMS} from './plugins/sms';
|
||||||
import {SocialSharing} from './plugins/socialsharing';
|
import {SocialSharing} from './plugins/socialsharing';
|
||||||
import {SpinnerDialog} from './plugins/spinnerdialog';
|
import {SpinnerDialog} from './plugins/spinnerdialog';
|
||||||
@ -82,6 +83,7 @@ export {
|
|||||||
LocalNotifications,
|
LocalNotifications,
|
||||||
Network,
|
Network,
|
||||||
Push,
|
Push,
|
||||||
|
Screenshot,
|
||||||
SMS,
|
SMS,
|
||||||
SocialSharing,
|
SocialSharing,
|
||||||
SpinnerDialog,
|
SpinnerDialog,
|
||||||
@ -130,6 +132,7 @@ window['IonicNative'] = {
|
|||||||
LocalNotifications: LocalNotifications,
|
LocalNotifications: LocalNotifications,
|
||||||
Network: Network,
|
Network: Network,
|
||||||
Push: Push,
|
Push: Push,
|
||||||
|
Screenshot: Screenshot,
|
||||||
SMS: SMS,
|
SMS: SMS,
|
||||||
SocialSharing: SocialSharing,
|
SocialSharing: SocialSharing,
|
||||||
SpinnerDialog: SpinnerDialog,
|
SpinnerDialog: SpinnerDialog,
|
||||||
|
36
src/plugins/screenshot.ts
Normal file
36
src/plugins/screenshot.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import {Cordova, Plugin} from './plugin';
|
||||||
|
@Plugin({
|
||||||
|
plugin: 'https://github.com/gitawego/cordova-screenshot.git',
|
||||||
|
pluginRef: 'navigator.screenshot',
|
||||||
|
repo: 'https://github.com/gitawego/cordova-screenshot.git'
|
||||||
|
})
|
||||||
|
export class Screenshot {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Takes screenshot and saves the image
|
||||||
|
*
|
||||||
|
* @param {string} format. Format can take the value of either 'jpg' or 'png'
|
||||||
|
* On ios, only 'jpg' format is supported
|
||||||
|
* @param {number} quality. Determines the quality of the screenshot.
|
||||||
|
* Default quality is set to 100.
|
||||||
|
* @param {string} filename. Name of the file as stored on the storage
|
||||||
|
*/
|
||||||
|
@Cordova({
|
||||||
|
successIndex: 1,
|
||||||
|
errorIndex: 0
|
||||||
|
})
|
||||||
|
static save (format: string, quality: number, filename: string) : Promise<any> {return}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Takes screenshot and returns the image as an URI
|
||||||
|
*
|
||||||
|
* @param {number} quality. Determines the quality of the screenshot.
|
||||||
|
* Default quality is set to 100.
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Cordova({
|
||||||
|
successIndex: 1,
|
||||||
|
errorIndex: 0
|
||||||
|
})
|
||||||
|
static URI (quality: number) : Promise<any> {return}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user