UNPKG

1.22 kBTypeScriptView Raw
1/**
2 * @name Screenshot
3 * @description Captures a screen shot
4 * @usage
5 * ```typescript
6 * import {Screenshot} from 'ionic-native';
7 *
8 * // Take a screenshot and save to file
9 * Screenshot.save('jpg', 80, 'myscreenshot.jpg').then(onSuccess, onError);
10 *
11 * // Take a screenshot and get temporary file URI
12 * Screenshot.URI(80).then(onSuccess, onError);
13 * ```
14 */
15export declare class Screenshot {
16 /**
17 * Takes screenshot and saves the image
18 *
19 * @param {string} format. Format can take the value of either 'jpg' or 'png'
20 * On ios, only 'jpg' format is supported
21 * @param {number} quality. Determines the quality of the screenshot.
22 * Default quality is set to 100.
23 * @param {string} filename. Name of the file as stored on the storage
24 * @returns {Promise<any>}
25 */
26 static save(format?: string, quality?: number, filename?: string): Promise<any>;
27 /**
28 * Takes screenshot and returns the image as an URI
29 *
30 * @param {number} quality. Determines the quality of the screenshot.
31 * Default quality is set to 100.
32 * @returns {Promise<any>}
33 */
34 static URI(quality?: number): Promise<any>;
35}