21 lines
660 B
TypeScript
21 lines
660 B
TypeScript
import { requireNativeViewManager } from 'expo-modules-core';
|
|
import * as React from 'react';
|
|
import { ViewProps, Platform } from 'react-native';
|
|
|
|
const viewName = 'UsbCamera';
|
|
|
|
export interface UsbCameraViewProps extends ViewProps {
|
|
// Add props here if we decide to pass them from JS
|
|
}
|
|
|
|
export interface UsbCameraRef {
|
|
takePicture(savePath: string): Promise<string>;
|
|
isCameraConnected(): Promise<boolean>;
|
|
}
|
|
|
|
// Export the native view manager component
|
|
export const UsbCameraView: React.ComponentType<UsbCameraViewProps & { ref?: React.RefObject<any> }> =
|
|
Platform.OS === 'android'
|
|
? requireNativeViewManager(viewName)
|
|
: (() => null) as any;
|