feat(types): add types for #1547 (#1548)

This commit is contained in:
Felipe Cavalcante Constantino 2018-05-07 13:33:58 -03:00 committed by GitHub
parent 86125a0a79
commit 3ce3c80db6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

32
types/index.d.ts vendored
View File

@ -12,34 +12,36 @@
import { Component, ReactNode } from 'react';
import { ViewProperties } from "react-native";
type AutoFocus = { on: any, off: any };
type FlashMode = { on: any, off: any, torch: any, auto: any };
type CameraType = { front: any, back: any };
type WhiteBalance = { sunny: any, cloudy: any, shadow: any, incandescent: any, fluorescent: any, auto: any };
type BarCodeType = { aztec: any, code128: any, code39: any, code39mod43: any, code93: any, ean13: any, ean8: any, pdf417: any, qr: any, upce: any, interleaved2of5: any, itf14: any, datamatrix: any };
type VideoQuality = {
type AutoFocus = Readonly<{ on: any, off: any }>;
type FlashMode = Readonly<{ on: any, off: any, torch: any, auto: any }>;
type CameraType = Readonly<{ front: any, back: any }>;
type WhiteBalance = Readonly<{ sunny: any, cloudy: any, shadow: any, incandescent: any, fluorescent: any, auto: any }>;
type BarCodeType = Readonly<{ aztec: any, code128: any, code39: any, code39mod43: any, code93: any, ean13: any, ean8: any, pdf417: any, qr: any, upce: any, interleaved2of5: any, itf14: any, datamatrix: any }>;
type VideoQuality = Readonly<{
'2160p': any, '1080p': any, '720p': any, '480p': any, '4:3': any;
/** iOS Only. Android not supported. */
'288p': any;
};
type VideoCodec = { 'H264': symbol, 'JPEG': symbol, 'HVEC': symbol, 'AppleProRes422': symbol, 'AppleProRes4444': symbol };
}>;
type VideoCodec = Readonly<{ 'H264': symbol, 'JPEG': symbol, 'HVEC': symbol, 'AppleProRes422': symbol, 'AppleProRes4444': symbol }>;
type FaceDetectionClassifications = { all: any, none: any };
type FaceDetectionLandmarks = { all: any, none: any };
type FaceDetectionMode = { fast: any, accurate: any };
type GoogleVisionBarcodeType = {
type FaceDetectionClassifications = Readonly<{ all: any, none: any }>;
type FaceDetectionLandmarks = Readonly<{ all: any, none: any }>;
type FaceDetectionMode = Readonly<{ fast: any, accurate: any }>;
type GoogleVisionBarcodeType = Readonly<{
CODE_128: any, CODE_39: any, CODABAR: any, DATA_MATRIX: any, EAN_13: any, EAN_8: any,
ITF: any, QR_CODE: any, UPC_A: any, UPC_E: any, PDF417: any, AZTEC: any
};
}>;
// FaCC (Function as Child Components)
type CameraStatus = 'READY' | 'PENDING_AUTHORIZATION' | 'NOT_AUTHORIZED';
type Self<T> = { [P in keyof T]: P }
type CameraStatus = Readonly<Self<{ READY, PENDING_AUTHORIZATION, NOT_AUTHORIZED }>>;
type FaCC = (params: {
camera: RNCamera,
status: CameraStatus
status: keyof CameraStatus
}) => JSX.Element;
export interface Constants {
CameraStatus: CameraStatus;
AutoFocus: AutoFocus;
FlashMode: FlashMode;
VideoCodec: VideoCodec;