forked from NativeScript/NativeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcamera.d.ts
More file actions
35 lines (30 loc) · 1.51 KB
/
camera.d.ts
File metadata and controls
35 lines (30 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* Allows you to take pictrues with the device's camera.
*/
declare module "camera" {
import imageSource = require("image-source");
/**
* Take a photo using the camera.
* @param options - Optional parameter for setting different camera options.
*/
export function takePicture(options?: CameraOptions): Promise<imageSource.ImageSource>;
export interface CameraOptions {
/**
* Defines the desired width (in device independent pixels) of the taken image. It should be used with height property.
* If `keepAspectRatio` actual image width could be different in order to keep the aspect ratio of the original camera image.
* The actual image width will be greater than requested if the display density of the device is higher (than 1) (full HD+ resolutions).
*/
width?: number;
/**
* Defines the desired height (in device independent pixels) of the taken image. It should be used with width property.
* If `keepAspectRatio` actual image width could be different in order to keep the aspect ratio of the original camera image.
* The actual image height will be greater than requested if the display density of the device is higher (than 1) (full HD+ resolutions).
*/
height?: number;
/**
* Defines if camera picture aspect ratio should be kept during picture resizing.
* This property could affect width or heigth return values.
*/
keepAspectRatio?: boolean;
}
}