signature_pad

  • Version 3.0.0-beta.4
  • Published
  • 213 kB
  • No dependencies
  • MIT license

Install

npm i signature_pad
yarn add signature_pad
pnpm add signature_pad

Overview

Library for drawing smooth signatures.

Index

Classes

class SignaturePad

class SignaturePad {}

    constructor

    constructor(canvas: HTMLCanvasElement, options?: Options);

      property backgroundColor

      backgroundColor: string;

        property dotSize

        dotSize: number | (() => number);

          property maxWidth

          maxWidth: number;

            property minDistance

            minDistance: number;

              property minWidth

              minWidth: number;

                property onBegin

                onBegin?: (event: MouseEvent | Touch) => void;

                  property onEnd

                  onEnd?: (event: MouseEvent | Touch) => void;

                    property penColor

                    penColor: string;

                      property throttle

                      throttle: number;

                        property velocityFilterWeight

                        velocityFilterWeight: number;

                          method clear

                          clear: () => void;

                            method fromData

                            fromData: (pointGroups: PointGroup[]) => void;

                              method fromDataURL

                              fromDataURL: (
                              dataUrl: string,
                              options?: { ratio?: number; width?: number; height?: number },
                              callback?: (error?: string | Event) => void
                              ) => void;

                                method isEmpty

                                isEmpty: () => boolean;

                                  method off

                                  off: () => void;

                                    method on

                                    on: () => void;

                                      method toData

                                      toData: () => PointGroup[];

                                        method toDataURL

                                        toDataURL: (type?: string, encoderOptions?: number) => string;

                                          Interfaces

                                          interface Options

                                          interface Options {}

                                            property backgroundColor

                                            backgroundColor?: string;

                                              property dotSize

                                              dotSize?: number | (() => number);

                                                property maxWidth

                                                maxWidth?: number;

                                                  property minDistance

                                                  minDistance?: number;

                                                    property minWidth

                                                    minWidth?: number;

                                                      property onBegin

                                                      onBegin?: (event: MouseEvent | Touch) => void;

                                                        property onEnd

                                                        onEnd?: (event: MouseEvent | Touch) => void;

                                                          property penColor

                                                          penColor?: string;

                                                            property throttle

                                                            throttle?: number;

                                                              property velocityFilterWeight

                                                              velocityFilterWeight?: number;

                                                                interface PointGroup

                                                                interface PointGroup {}

                                                                  property color

                                                                  color: string;

                                                                    property points

                                                                    points: BasicPoint[];

                                                                      Namespaces

                                                                      namespace global

                                                                      namespace global {}

                                                                        interface CSSStyleDeclaration

                                                                        interface CSSStyleDeclaration {}

                                                                          property msTouchAction

                                                                          msTouchAction: string;

                                                                            Package Files (1)

                                                                            Dependencies (0)

                                                                            No dependencies.

                                                                            Dev Dependencies (20)

                                                                            Peer Dependencies (0)

                                                                            No peer dependencies.

                                                                            Badge

                                                                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/signature_pad.

                                                                            • Markdown
                                                                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/signature_pad)
                                                                            • HTML
                                                                              <a href="https://www.jsdocs.io/package/signature_pad"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>