@@ -33,29 +33,29 @@ export default class ReactSignatureCanvas extends Component<ReactSignatureCanvas
3333 _sigPad : SignaturePad = { } as SignaturePad
3434 _canvas : HTMLCanvasElement = { } as HTMLCanvasElement
3535
36- private readonly setRef = ( ref : HTMLCanvasElement | null ) => {
36+ private readonly setRef = ( ref : HTMLCanvasElement | null ) : void => {
3737 if ( ref ) {
3838 this . _canvas = ref
3939 }
4040 }
4141
42- _excludeOurProps = ( ) => {
42+ _excludeOurProps = ( ) : SignaturePad . SignaturePadOptions => {
4343 const { canvasProps, clearOnResize, ...sigPadProps } = this . props
4444 return sigPadProps
4545 }
4646
47- componentDidMount ( ) {
47+ componentDidMount : Component [ 'componentDidMount' ] = ( ) => {
4848 this . _sigPad = new SignaturePad ( this . _canvas , this . _excludeOurProps ( ) )
4949 this . _resizeCanvas ( )
5050 this . on ( )
5151 }
5252
53- componentWillUnmount ( ) {
53+ componentWillUnmount : Component [ 'componentWillUnmount' ] = ( ) => {
5454 this . off ( )
5555 }
5656
5757 // propagate prop updates to SignaturePad
58- componentDidUpdate ( ) {
58+ componentDidUpdate : Component [ 'componentDidUpdate' ] = ( ) => {
5959 Object . assign ( this . _sigPad , this . _excludeOurProps ( ) )
6060 }
6161
@@ -80,14 +80,14 @@ export default class ReactSignatureCanvas extends Component<ReactSignatureCanvas
8080 return this . _sigPad
8181 }
8282
83- _checkClearOnResize = ( ) => {
83+ _checkClearOnResize = ( ) : void => {
8484 if ( ! this . props . clearOnResize ) {
8585 return
8686 }
8787 this . _resizeCanvas ( )
8888 }
8989
90- _resizeCanvas = ( ) => {
90+ _resizeCanvas = ( ) : void => {
9191 const canvasProps = this . props . canvasProps || { }
9292 const { width, height } = canvasProps
9393 // don't resize if the canvas has fixed width and height
@@ -111,7 +111,7 @@ export default class ReactSignatureCanvas extends Component<ReactSignatureCanvas
111111 this . clear ( )
112112 }
113113
114- render ( ) {
114+ render : Component [ 'render' ] = ( ) => {
115115 const { canvasProps } = this . props
116116 return < canvas ref = { this . setRef } { ...canvasProps } />
117117 }
0 commit comments