UNPKG

react-simple-signature

Version:

React signature pad component for touch/mouse with high-DPI rendering and export.

34 lines (29 loc) 896 B
import { ReactElement } from 'react'; import { Ref } from 'react'; export declare interface SignatureRef { clear: () => void; } /** Public entry: accepts a React ref prop and passes it to the inner component */ export declare function SimpleSignature({ ref, ...props }: Omit<SimpleSignatureProps, "ref"> & { ref?: Ref<SignatureRef>; }): ReactElement | null; export declare interface SimpleSignatureProps { /** * Called when the user modifies the drawing; returns a blob of the new drawing * @param blob * @returns */ onChange?: (blob: Blob) => void; /** * Called when the user starts drawing * @returns */ onStart?: () => void; height?: number; width?: number; className?: string; ref?: Ref<SignatureRef>; blobFormat?: "png" | "jpeg"; strokeColor?: `#${string}`; } export { }