/ src / types / modules.d.ts
modules.d.ts
 1  /**
 2   * Type declarations for modules without TypeScript types
 3   */
 4  
 5  declare module 'react-native-qrcode-svg' {
 6    import { Component } from 'react';
 7  
 8    interface QRCodeProps {
 9      value: string;
10      size?: number;
11      color?: string;
12      backgroundColor?: string;
13      logo?: number | { uri: string };
14      logoSize?: number;
15      logoBackgroundColor?: string;
16      logoMargin?: number;
17      logoBorderRadius?: number;
18      quietZone?: number;
19      enableLinearGradient?: boolean;
20      linearGradient?: string[];
21      ecl?: 'L' | 'M' | 'Q' | 'H';
22      getRef?: (ref: unknown) => void;
23      onError?: (error: Error) => void;
24    }
25  
26    export default class QRCode extends Component<QRCodeProps> {}
27  }
28  
29  declare module 'expo-camera' {
30    import { Component, ReactNode } from 'react';
31    import { ViewStyle } from 'react-native';
32  
33    export interface BarcodeScannerResult {
34      type: string;
35      data: string;
36      cornerPoints?: { x: number; y: number }[];
37    }
38  
39    export interface CameraPermissionResponse {
40      granted: boolean;
41      canAskAgain: boolean;
42      expires: 'never' | number;
43      status: 'granted' | 'denied' | 'undetermined';
44    }
45  
46    export function useCameraPermissions(): [
47      CameraPermissionResponse | null,
48      () => Promise<CameraPermissionResponse>,
49    ];
50  
51    export interface CameraViewProps {
52      style?: ViewStyle;
53      facing?: 'front' | 'back';
54      flash?: 'off' | 'on' | 'auto';
55      barcodeScannerSettings?: {
56        barcodeTypes: string[];
57      };
58      onBarcodeScanned?: (result: BarcodeScannerResult) => void;
59      children?: ReactNode;
60    }
61  
62    export class CameraView extends Component<CameraViewProps> {}
63  }
64  
65  declare module 'uuid' {
66    export function v4(): string;
67  }