UNPKG

@gdn/react-native-simple-canvas

Version:

A simple canvas component for React Native that allows drawing and signature capture.

28 lines 1 kB
import React, { RefObject } from 'react'; import { ViewStyle } from 'react-native'; import { Svg } from 'react-native-svg'; import { Point } from './interfaces/Point'; interface SimpleCanvasProps { ref?: RefObject<SimpleCanvasRef | null>; onDragEvent?: () => void; onCanvasChange?: (isEmpty: boolean) => void; strokeColor?: string; strokeWidth?: number; backgroundColor?: string; style?: ViewStyle; minPoints?: number; } export interface SimpleCanvasRef { resetImage: () => void; getSVG: () => RefObject<Svg | null>; isEmpty: () => boolean; getPoints: () => Point[]; setPoints: (points: Point[]) => void; } export declare const clearCanvas: (ref: RefObject<SimpleCanvasRef | null>) => void; export declare const SimpleCanvas: { ({ onDragEvent, onCanvasChange, strokeColor, strokeWidth, backgroundColor, style, minPoints, ref, }: SimpleCanvasProps): React.JSX.Element; displayName: string; }; export {}; //# sourceMappingURL=SimpleCanvas.d.ts.map