-
-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathindex.d.ts
More file actions
75 lines (64 loc) · 2.57 KB
/
index.d.ts
File metadata and controls
75 lines (64 loc) · 2.57 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { ImageAsset } from '@nativescript/core';
/**
* Take a photo using the camera.
* @param options - Optional parameter for setting different camera options.
*/
export function takePicture(options?: CameraOptions): Promise<ImageAsset>;
/**
* Check required permissions for using device camera.
*/
export function requestPermissions(): Promise<any>;
export function requestCameraPermissions(): Promise<any>;
export function requestPhotosPermissions(): Promise<any>;
export function requestRecordPermissions(): Promise<any>;
export function recordVideo(options?: CameraRecordOptions): Promise<{ file: string }>;
/**
* Is the camera available to use
*/
export function isAvailable(): Boolean;
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 height return values.
*/
keepAspectRatio?: boolean;
/**
* Defines if camera picture should be copied to photo Gallery (Android) or Photos (iOS)
*/
saveToGallery?: boolean;
/**
* iOS Only
* Defines if camera "Retake" or "Use Photo" screen forces user to crop camera picture to a square and optionally lets them zoom in.
*/
allowsEditing?: boolean;
/**
* The initial camera. Default "rear".
* The current implementation doesn't work on all Android devices, in which case it falls back to the default behavior.
*/
cameraFacing?: 'front' | 'rear';
/**
* (iOS Only) Specify a custom UIModalPresentationStyle (Defaults to UIModalPresentationStyle.FullScreen)
*/
modalPresentationStyle?: number;
}
export interface CameraRecordOptions {
size?: number;
hd?: boolean;
saveToGallery?: boolean;
duration?: number;
format?: 'default' | 'mp4';
cameraFacing?: 'front' | 'back';
allowsEditing?: boolean;
}