Open leoonhitgub opened 2 weeks ago
solved by using the basic library vue-signature-pad with example for vue3 as in https://codesandbox.io/p/sandbox/broken-flower-22ot7m?file=%2Fsrc%2FApp.vue
Hey @leoonhitgub, thanks for creating this issue. I will resolve it ASAP 😊.
Describe the bug Can not use your library in typescript, as long as all the method return -types are void..
for example: export interface CanvasSignatureRef { isCanvasEmpty?: () => void saveSignature?: (format?: string) => void clearCanvas?: () => void undo?: () => void addWaterMark?: (obj: WaterMarkObj) => void fromDataURL?: (url: string) => void }
Your following example-code on https://vue3-signature-pad.vercel.app/ does only work, because alert is very tolerant and can deal with the signature void. In true, the method is returning a string.
function handleSaveSignature() { return signature.value?.saveSignature && alert(signature.value?.saveSignature()) }
To Reproduce Steps to reproduce the behavior: use your package in typescript, write:
let imgBase64: string = signaturePad.value?.saveSignature();
You will get the following compile-error -->Vue: Type void is not assignable to type string
Expected behavior The methods of your interfaces should return the same types as your wrapped library vue-signature-pad