Skip to main content


Typescript type definitions for vue-signature-pad, probably not entirely correct.

gist link

declare module 'vue-signature-pad' {
  import signature_pad, * as SignaturePad from 'signature_pad';
  import Vue from 'vue';

  export interface IOptions extends SignaturePad.IOptions {}
  export interface IPointGroup extends SignaturePad.IPointGroup {}

  export interface Status {
    isEmpty: boolean;
    data?: any;

  export default class VueSignaturePad extends Vue {
    // props
    width: string;
    height: string;
    customStyle: any;
    saveType: string;
    options: IOptions;
    images: any[];

    // computer
    propsImagesAndCustomImages: any[];

    // methods
    resizeCanvas(): void;
    saveSignature(): Status;
    undoSignature(): void;
    mergeImageAndSignature(customSignature: any): Promise<any>; // TODO: constrain to correct return type.
    addImages(images: any[]): Promise<any>; // TODO: constrain to correct param type and return type.
    fromDataURL(data: string): void;
    lockSignaturePad(): void;
    openSignaturePad(): void;
    isEmpty(): boolean;
    getPropImagesAndCacheImages(): any[];
    clearCacheImages(): 'this.cacheImages';
    clearSignature(): void;