-
Notifications
You must be signed in to change notification settings - Fork 153
/
index.d.ts
73 lines (67 loc) · 2.07 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
declare module "react-native-signature-canvas" {
import React from "react";
import { StyleProp, ViewStyle } from "react-native";
type ImageType = "image/png" | "image/jpeg" | "image/svg+xml";
type DataURL = "Base64" | string;
type ForwardRef<T, P> = React.ForwardRefExoticComponent<
React.PropsWithoutRef<P> & React.RefAttributes<T>
>;
type SignatureViewProps = {
androidHardwareAccelerationDisabled?: boolean;
autoClear?: boolean;
backgroundColor?: string;
bgHeight?: number;
bgWidth?: number;
bgSrc?: string;
clearText?: string;
confirmText?: string;
customHtml?: (injectedJavaScript: string) => string;
dataURL?: DataURL;
descriptionText?: string;
dotSize?: number;
imageType?: ImageType;
minWidth?: number;
maxWidth?: number;
minDistance?: number;
nestedScrollEnabled?: boolean;
showsVerticalScrollIndicator?: boolean;
onOK?: (signature: string) => void;
onEmpty?: () => void;
onClear?: () => void;
onUndo?: () => void;
onRedo?: () => void;
onDraw?: () => void;
onErase?: () => void;
onGetData?: (data: any) => void;
onChangePenColor?: () => void;
onChangePenSize?: () => void;
onBegin?: () => void;
onEnd?: () => void;
onLoadEnd?: () => void;
overlayHeight?: number;
overlayWidth?: number;
overlaySrc?: string;
penColor?: string;
rotated?: boolean;
style?: StyleProp<ViewStyle>;
scrollable?: boolean;
trimWhitespace?: boolean;
webStyle?: string;
webviewContainerStyle?: StyleProp<ViewStyle>;
androidLayerType?: "none" | "software" | "hardware";
};
export type SignatureViewRef = {
changePenColor: (color: string) => void;
changePenSize: (minW: number, maxW: number) => void;
clearSignature: () => void;
cropWhitespace: (url: string) => void;
draw: () => void;
erase: () => void;
getData: () => void;
readSignature: () => void;
undo: () => void;
redo: () => void;
};
const SignatureView: ForwardRef<SignatureViewRef, SignatureViewProps>;
export default SignatureView;
}