Merge pull request #1393 from react-native-community/types/text-detection
feat(types): add types for text detection feature
This commit is contained in:
commit
7fe8ca9b1f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue