UNPKG

1.6 kBTypeScriptView Raw
1import ExpoFaceDetector from './ExpoFaceDetector';
2declare type Point = {
3 x: number;
4 y: number;
5};
6export declare type FaceFeature = {
7 bounds: {
8 size: {
9 width: number;
10 height: number;
11 };
12 origin: Point;
13 };
14 smilingProbability?: number;
15 leftEarPosition?: Point;
16 rightEarPosition?: Point;
17 leftEyePosition?: Point;
18 leftEyeOpenProbability?: number;
19 rightEyePosition?: Point;
20 rightEyeOpenProbability?: number;
21 leftCheekPosition?: Point;
22 rightCheekPosition?: Point;
23 leftMouthPosition?: Point;
24 mouthPosition?: Point;
25 rightMouthPosition?: Point;
26 bottomMouthPosition?: Point;
27 noseBasePosition?: Point;
28 yawAngle?: number;
29 rollAngle?: number;
30 faceID?: number;
31};
32declare type ValuesOf<T extends any[]> = T[number];
33export declare type FaceDetectorMode = string[];
34export declare type FaceDetectorLandmarks = ValuesOf<typeof ExpoFaceDetector.Landmarks>;
35export declare type FaceDetectorClassifications = ValuesOf<typeof ExpoFaceDetector.Classifications>;
36export interface Image {
37 uri: string;
38 width: number;
39 height: number;
40 orientation: number;
41}
42export declare type DetectionOptions = {
43 mode?: FaceDetectorMode;
44 detectLandmarks?: FaceDetectorLandmarks;
45 runClassifications?: FaceDetectorClassifications;
46};
47export declare function detectFacesAsync(uri: string, options?: DetectionOptions): Promise<{
48 faces: FaceFeature[];
49 image: Image;
50}>;
51export declare const Constants: {
52 Mode: any;
53 Landmarks: any;
54 Classifications: any;
55};
56export {};