react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
57 lines • 2.09 kB
TypeScript
import { ColorValue, ViewStyle } from 'react-native';
import { StyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet';
import { ImageRef, ImageRotation } from '../../imageRef';
import { DeepPartial, Point } from '../../utils';
export type FileSrc = {
imageFileUri: string;
};
export type ImageSrc = FileSrc | {
imageRefUUID: string;
};
export type CroppingViewRotation = 'CLOCKWISE' | 'COUNTERCLOCKWISE';
export interface ScanbotCroppingViewProperties {
style?: StyleProp<ViewStyle>;
/** A result callback that is triggered with `extractCroppedArea`. */
onCroppedAreaResult: (result: CroppingViewResult) => void;
/** An error callback that is triggered when an error occurs. */
onError?: (errorMessage: string) => void;
/**
* The source of the image, specified either by a local file URI
* or an ImageRef UUID.
*/
src: ImageSrc;
/** The color of the non-snapped edges. */
edgeColor?: ColorValue;
/** The width of the edges. */
edgeLineWidth?: number;
/** The color of the edges when positioned on the magnetic line. */
edgeColorOnLine?: ColorValue;
/** The color of the anchor points. */
anchorPointsColor?: ColorValue;
}
export interface ScanbotCroppingViewHandle {
/** Reset the drawn polygons */
resetPolygon: () => void;
/** Detect a document on the source image and draw the polygons. */
detectPolygon: () => void;
/** Rotates the source image. */
rotate: (rotation: CroppingViewRotation) => void;
/** Extracts cropped area from the currently drawn polygon area on the image */
extractCroppedArea: () => void;
}
export declare class CroppingViewResult {
/**
* The polygon of the cropped area.
*/
readonly polygon: Point[];
/**
* The rotation of the resulting cropped area
*/
readonly rotation: ImageRotation;
/**
A crop from the input image.
*/
readonly sourceImage: ImageRef | null;
constructor(source: DeepPartial<CroppingViewResult>);
}
//# sourceMappingURL=ScanbotCroppingViewProperties.d.ts.map