@uiw/react-signature
Version:
A signature board component for react.
23 lines (22 loc) • 860 B
TypeScript
import React from 'react';
import { type StrokeOptions } from 'perfect-freehand';
import { type Dispatch } from './store';
export * from 'perfect-freehand';
export * from './utils';
export * from './options';
export * from './store';
export type SignatureRef = {
svg: SVGSVGElement | null;
dispatch: Dispatch;
clear: () => void;
};
export interface SignatureProps extends React.SVGProps<SVGSVGElement> {
prefixCls?: string;
options?: StrokeOptions;
readonly?: boolean;
defaultPoints?: Record<string, number[][]>;
renderPath?: (d: string, keyName: string, point: number[][], index: number, container: SVGSVGElement) => JSX.Element;
onPointer?: (points: number[][]) => void;
}
declare const Signature: React.ForwardRefExoticComponent<Omit<SignatureProps, "ref"> & React.RefAttributes<SignatureRef>>;
export default Signature;