Merge pull request #1393 from react-native-community/types/text-detection

feat(types): add types for text detection feature
This commit is contained in:
Sibelius Seraphini 2018-03-24 12:38:51 -03:00 committed by GitHub
commit 7fe8ca9b1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 5 deletions

23
types/index.d.ts vendored
View File

@ -70,7 +70,8 @@ export interface RNCameraProps {
faceDetectionClassifications?: keyof FaceDetectionClassifications;
// -- ANDROID ONLY PROPS
/** Android only */
onTextRecognized?(response: { textBlocks: TrackedTextFeature[] }): void;
/** Android only */
ratio?: string;
/** Android only */
@ -90,13 +91,15 @@ interface Point {
y: number
}
interface Size {
width: number;
height: number;
}
interface Face {
faceID?: number,
bounds: {
size: {
width: number;
height: number;
};
size: Size;
origin: Point;
};
smilingProbability?: number;
@ -117,6 +120,16 @@ interface Face {
rollAngle?: number;
}
interface TrackedTextFeature {
type: 'block' | 'line' | 'element';
bounds: {
size: Size;
origin: Point;
},
value: string;
components: TrackedTextFeature[];
}
interface TakePictureOptions {
quality?: number;
base64?: boolean;