[
  {
    "path": ".editorconfig",
    "content": "# Editor configuration, see https://editorconfig.org\nroot = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n[*.ts]\nquote_type = single\n\n[*.md]\nmax_line_length = off\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": ".gitignore",
    "content": "# See http://help.github.com/ignore-files/ for more about ignoring files.\n\n# compiled output\n/dist\n/tmp\n/out-tsc\n# Only exists if Bazel was run\n/bazel-out\n\n# dependencies\n/node_modules\n\n# profiling files\nchrome-profiler-events*.json\nspeed-measure-plugin*.json\n\n# IDEs and editors\n/.idea\n.project\n.classpath\n.c9/\n*.launch\n.settings/\n*.sublime-workspace\n\n# IDE - VSCode\n.vscode/*\n!.vscode/settings.json\n!.vscode/tasks.json\n!.vscode/launch.json\n!.vscode/extensions.json\n.history/*\n\n# misc\n/.angular/cache\n/.sass-cache\n/connect.lock\n/coverage\n/libpeerconnection.log\nnpm-debug.log\nyarn-error.log\ntestem.log\n/typings\n\n# System Files\n.DS_Store\nThumbs.db\n"
  },
  {
    "path": ".npmignore",
    "content": "# Node generated files\nnode_modules\nnpm-debug.log\n\n# OS generated files\nThumbs.db\n.DS_Store\n\n# Ignored files\n*.ts\n!*.d.ts\n\n# ngc generated files\nngfactory\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2016 Wulf Sölter\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# angular2-signaturepad\nAngular 2 component for [szimek/signature_pad](https://www.npmjs.com/package/signature_pad).\n\n# No Longer Maintained\n<< THIS IS NO LONGER IN USE BY OWNER. PROBLEMS CAN AND DO EXIST. PRs ARE SUPER WELCOME, BUT I CAN NOT IDENTIFY WHAT YOUR ISSUES ARE, NOR WILL I CHANGE THINGS BECAUSE ANGULAR HAS CHANGED IN THE YEARS SINCE I WROTE THIS. I DO NOT USE THIS, I CAN'T HELP YOU WITH YOUR PROBLEMS. >>\n\n## Install\n`npm install angular2-signaturepad --save`\n\n## Reference Implementation\n\n* [Live Demo](http://lathonez.com/angular2-signaturepad-demo/)\n* [Source](https://github.com/lathonez/angular2-signaturepad-demo)\n\n## Usage example\n\nAPI is identical to [szimek/signature_pad](https://www.npmjs.com/package/signature_pad).\n\nOptions are as per [szimek/signature_pad](https://www.npmjs.com/package/signature_pad) with the following additions:\n* canvasWidth: width of the canvas (px)\n* canvasHeight: height of the canvas (px)\nThe above options are provided to avoid accessing the DOM directly from your component to adjust the canvas size.\n\n```typescript\n\n// import into app module\n\nimport { SignaturePadModule } from 'angular2-signaturepad';\n\n...\n\n@NgModule({\n  declarations: [ ],\n  imports: [ SignaturePadModule ],\n  providers: [ ],\n  bootstrap: [ AppComponent ]\n})\n\n// then import for use in a component\n\nimport { Component, ViewChild } from 'angular2/core';\nimport { SignaturePad } from 'angular2-signaturepad/signature-pad';\n\n@Component({\n  template: '<signature-pad [options]=\"signaturePadOptions\" (onBeginEvent)=\"drawStart()\" (onEndEvent)=\"drawComplete()\"></signature-pad>'\n})\n\nexport class SignaturePadPage{\n\n  @ViewChild(SignaturePad) signaturePad: SignaturePad;\n\n  signaturePadOptions: Object = { // passed through to szimek/signature_pad constructor\n    'minWidth': 5,\n    'canvasWidth': 500,\n    'canvasHeight': 300\n  };\n\n  constructor() {\n    // no-op\n  }\n\n  ngAfterViewInit() {\n    // this.signaturePad is now available\n    this.signaturePad.set('minWidth', 5); // set szimek/signature_pad options at runtime\n    this.signaturePad.clear(); // invoke functions from szimek/signature_pad API\n  }\n\n  drawComplete() {\n    // will be notified of szimek/signature_pad's onEnd event\n    console.log(this.signaturePad.toDataURL());\n  }\n\n  drawStart() {\n    // will be notified of szimek/signature_pad's onBegin event\n    console.log('begin drawing');\n  }\n}\n```\n"
  },
  {
    "path": "angular.json",
    "content": "{\n  \"$schema\": \"./node_modules/@angular/cli/lib/config/schema.json\",\n  \"version\": 1,\n  \"newProjectRoot\": \"projects\",\n  \"projects\": {\n    \"angular2-signaturepad\": {\n      \"projectType\": \"library\",\n      \"root\": \"projects/angular2-signaturepad\",\n      \"sourceRoot\": \"projects/angular2-signaturepad/src\",\n      \"prefix\": \"lib\",\n      \"architect\": {\n        \"build\": {\n          \"builder\": \"@angular-devkit/build-angular:ng-packagr\",\n          \"options\": {\n            \"tsConfig\": \"projects/angular2-signaturepad/tsconfig.lib.json\",\n            \"project\": \"projects/angular2-signaturepad/ng-package.json\"\n          },\n          \"configurations\": {\n            \"production\": {\n              \"tsConfig\": \"projects/angular2-signaturepad/tsconfig.lib.prod.json\"\n            }\n          }\n        },\n        \"test\": {\n          \"builder\": \"@angular-devkit/build-angular:karma\",\n          \"options\": {\n            \"main\": \"projects/angular2-signaturepad/src/test.ts\",\n            \"tsConfig\": \"projects/angular2-signaturepad/tsconfig.spec.json\",\n            \"karmaConfig\": \"projects/angular2-signaturepad/karma.conf.js\"\n          }\n        }\n      }\n    }\n  },\n  \"defaultProject\": \"angular2-signaturepad\"\n}\n"
  },
  {
    "path": "index.ts",
    "content": "import { NgModule } from '@angular/core';\nimport { SignaturePad } from './signature-pad';\n\n@NgModule({\n  imports: [ ],\n  declarations: [ SignaturePad ],\n  exports: [ SignaturePad ],\n})\n\nexport class SignaturePadModule { }\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"angular2-signaturepad\",\n  \"version\": \"4.0.0\",\n  \"scripts\": {\n    \"ng\": \"ng\",\n    \"start\": \"ng serve\",\n    \"build\": \"ng build\",\n    \"test\": \"ng test\",\n    \"lint\": \"ng lint\",\n    \"e2e\": \"ng e2e\"\n  },\n  \"dependencies\": {\n    \"@angular/animations\": \"~13.0.2\",\n    \"@angular/common\": \"~13.0.2\",\n    \"@angular/compiler\": \"~13.0.2\",\n    \"@angular/core\": \"~13.0.2\",\n    \"@angular/forms\": \"~13.0.2\",\n    \"@angular/platform-browser\": \"~13.0.2\",\n    \"@angular/platform-browser-dynamic\": \"~13.0.2\",\n    \"@angular/router\": \"~13.0.2\",\n    \"rxjs\": \"~6.6.0\",\n    \"signature_pad\": \"^2.3.2\",\n    \"tslib\": \"^2.3.0\",\n    \"zone.js\": \"~0.11.4\"\n  },\n  \"devDependencies\": {\n    \"@angular-devkit/build-angular\": \"~13.0.3\",\n    \"@angular/cli\": \"~13.0.3\",\n    \"@angular/compiler-cli\": \"~13.0.2\",\n    \"@types/jasmine\": \"~3.6.0\",\n    \"@types/node\": \"^12.11.1\",\n    \"codelyzer\": \"^6.0.0\",\n    \"jasmine-core\": \"~3.6.0\",\n    \"jasmine-spec-reporter\": \"~5.0.0\",\n    \"karma\": \"~6.3.14\",\n    \"karma-chrome-launcher\": \"~3.1.0\",\n    \"karma-coverage\": \"~2.0.3\",\n    \"karma-jasmine\": \"~4.0.0\",\n    \"karma-jasmine-html-reporter\": \"^1.5.0\",\n    \"ng-packagr\": \"^13.0.6\",\n    \"protractor\": \"~7.0.0\",\n    \"ts-node\": \"~8.3.0\",\n    \"tslint\": \"~6.1.0\",\n    \"typescript\": \"~4.4.4\"\n  },\n  \"whitelistedNonPeerDependencies\": [\"signature_pad\"]\n}\n"
  },
  {
    "path": "projects/angular2-signaturepad/README.md",
    "content": "# angular2-signaturepad\nAngular 2 component for [szimek/signature_pad](https://www.npmjs.com/package/signature_pad).\n\n<< THIS IS NO LONGER IN USE BY OWNER. PROBLEMS CAN AND DO EXIST. PRs ARE SUPER WELCOME, BUT I CAN NOT IDENTIFY WHAT YOUR ISSUES ARE, NOR WILL I CHANGE THINGS BECAUSE ANGULAR HAS CHANGED IN THE YEARS SINCE I WROTE THIS >>\n\n## Install\n`npm install angular2-signaturepad --save`\n\n## Reference Implementation\n\n* [Live Demo](http://lathonez.com/angular2-signaturepad-demo/)\n* [Source](https://github.com/lathonez/angular2-signaturepad-demo)\n\n## Usage example\n\nAPI is identical to [szimek/signature_pad](https://www.npmjs.com/package/signature_pad).\n\nOptions are as per [szimek/signature_pad](https://www.npmjs.com/package/signature_pad) with the following additions:\n* canvasWidth: width of the canvas (px)\n* canvasHeight: height of the canvas (px)\nThe above options are provided to avoid accessing the DOM directly from your component to adjust the canvas size.\n\n```typescript\n\n// import into app module\n\nimport { SignaturePadModule } from 'angular2-signaturepad';\n\n...\n\n@NgModule({\n  declarations: [ ],\n  imports: [ SignaturePadModule ],\n  providers: [ ],\n  bootstrap: [ AppComponent ]\n})\n\n// then import for use in a component\n\nimport { Component, ViewChild } from 'angular2/core';\nimport { SignaturePad } from 'angular2-signaturepad/signature-pad';\n\n@Component({\n  template: '<signature-pad [options]=\"signaturePadOptions\" (onBeginEvent)=\"drawStart()\" (onEndEvent)=\"drawComplete()\"></signature-pad>'\n})\n\nexport class SignaturePadPage{\n\n  @ViewChild(SignaturePad) signaturePad: SignaturePad;\n\n  private signaturePadOptions: Object = { // passed through to szimek/signature_pad constructor\n    'minWidth': 5,\n    'canvasWidth': 500,\n    'canvasHeight': 300\n  };\n\n  constructor() {\n    // no-op\n  }\n\n  ngAfterViewInit() {\n    // this.signaturePad is now available\n    this.signaturePad.set('minWidth', 5); // set szimek/signature_pad options at runtime\n    this.signaturePad.clear(); // invoke functions from szimek/signature_pad API\n  }\n\n  drawComplete() {\n    // will be notified of szimek/signature_pad's onEnd event\n    console.log(this.signaturePad.toDataURL());\n  }\n\n  drawStart() {\n    // will be notified of szimek/signature_pad's onBegin event\n    console.log('begin drawing');\n  }\n}\n```"
  },
  {
    "path": "projects/angular2-signaturepad/karma.conf.js",
    "content": "// Karma configuration file, see link for more information\n// https://karma-runner.github.io/1.0/config/configuration-file.html\n\nmodule.exports = function (config) {\n  config.set({\n    basePath: '',\n    frameworks: ['jasmine', '@angular-devkit/build-angular'],\n    plugins: [\n      require('karma-jasmine'),\n      require('karma-chrome-launcher'),\n      require('karma-jasmine-html-reporter'),\n      require('karma-coverage'),\n      require('@angular-devkit/build-angular/plugins/karma')\n    ],\n    client: {\n      clearContext: false // leave Jasmine Spec Runner output visible in browser\n    },\n    jasmineHtmlReporter: {\n      suppressAll: true // removes the duplicated traces\n    },\n    coverageReporter: {\n      dir: require('path').join(__dirname, '../../coverage/angular2-signaturepad'),\n      subdir: '.',\n      reporters: [\n        { type: 'html' },\n        { type: 'text-summary' }\n      ]\n    },\n    reporters: ['progress', 'kjhtml'],\n    port: 9876,\n    colors: true,\n    logLevel: config.LOG_INFO,\n    autoWatch: true,\n    browsers: ['Chrome'],\n    singleRun: false,\n    restartOnFileChange: true\n  });\n};\n"
  },
  {
    "path": "projects/angular2-signaturepad/ng-package.json",
    "content": "{\n  \"$schema\": \"../../node_modules/ng-packagr/ng-package.schema.json\",\n  \"dest\": \"../../dist/angular2-signaturepad\",\n  \"lib\": {\n    \"entryFile\": \"src/public-api.ts\"\n  }\n}\n"
  },
  {
    "path": "projects/angular2-signaturepad/package.json",
    "content": "{\n  \"name\": \"angular2-signaturepad\",\n  \"version\": \"3.0.4\",\n  \"description\": \"Angular2 Component wrapper for szimek / signature_pad\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/wulfsolter/angular2-signaturepad.git\"\n  },\n  \"keywords\": [\n    \"signature\",\n    \"sign\",\n    \"finger\",\n    \"canvas\"\n  ],\n  \"author\": \"Wulf Solter <wulf@wulf.co.nz> (http://wulf.co.nz)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/wulfsolter/angular2-signaturepad/issues\"\n  },\n  \"homepage\": \"https://github.com/wulfsolter/angular2-signaturepad#readme\",\n  \"peerDependencies\": {\n    \"@angular/common\": \"^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0\",\n    \"@angular/core\": \"^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0\",\n    \"signature_pad\": \"2.3.2\"\n  },\n  \"dependencies\": {\n    \"tslib\": \"^2.0.0\"\n  }\n}\n"
  },
  {
    "path": "projects/angular2-signaturepad/src/lib/angular2-signaturepad.component.spec.ts",
    "content": "import { ComponentFixture, TestBed } from '@angular/core/testing';\n\nimport { SignaturePad } from './angular2-signaturepad.component';\n\ndescribe('Angular2SignaturepadComponent', () => {\n  let component: SignaturePad;\n  let fixture: ComponentFixture<SignaturePad>;\n\n  beforeEach(async () => {\n    await TestBed.configureTestingModule({\n      declarations: [SignaturePad],\n    }).compileComponents();\n  });\n\n  beforeEach(() => {\n    fixture = TestBed.createComponent(SignaturePad);\n    component = fixture.componentInstance;\n    fixture.detectChanges();\n  });\n\n  it('should create', () => {\n    expect(component).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "projects/angular2-signaturepad/src/lib/angular2-signaturepad.component.ts",
    "content": "import {\n  AfterContentInit,\n  Component,\n  ElementRef,\n  EventEmitter,\n  Input,\n  Output,\n  OnDestroy,\n} from '@angular/core';\n\nimport * as SignaturePadNative from 'signature_pad';\n\nexport interface Point {\n  x: number;\n  y: number;\n  time: number;\n}\n\nexport type PointGroup = Array<Point>;\n\n@Component({\n  template: '<canvas></canvas>',\n  selector: 'signature-pad',\n})\nexport class SignaturePad implements AfterContentInit, OnDestroy {\n  @Input() public options: any;\n  @Output() public onBeginEvent: EventEmitter<boolean>;\n  @Output() public onEndEvent: EventEmitter<boolean>;\n\n  private signaturePad: any;\n  private elementRef: ElementRef;\n\n  constructor(elementRef: ElementRef) {\n    // no op\n    this.elementRef = elementRef;\n    this.options = this.options || {};\n    this.onBeginEvent = new EventEmitter();\n    this.onEndEvent = new EventEmitter();\n  }\n\n  public ngAfterContentInit(): void {\n    const canvas: any = this.elementRef.nativeElement.querySelector('canvas');\n\n    if ((this.options as any).canvasHeight) {\n      canvas.height = (this.options as any).canvasHeight;\n    }\n\n    if ((this.options as any).canvasWidth) {\n      canvas.width = (this.options as any).canvasWidth;\n    }\n\n    this.signaturePad = new SignaturePadNative.default(canvas, this.options);\n    this.signaturePad.onBegin = this.onBegin.bind(this);\n    this.signaturePad.onEnd = this.onEnd.bind(this);\n  }\n\n  public ngOnDestroy(): void {\n    const canvas: any = this.elementRef.nativeElement.querySelector('canvas');\n    canvas.width = 0;\n    canvas.height = 0;\n  }\n\n  public resizeCanvas(): void {\n    // When zoomed out to less than 100%, for some very strange reason,\n    // some browsers report devicePixelRatio as less than 1\n    // and only part of the canvas is cleared then.\n    const ratio: number = Math.max(window.devicePixelRatio || 1, 1);\n    const canvas: any = this.signaturePad.canvas;\n    canvas.width = canvas.offsetWidth * ratio;\n    canvas.height = canvas.offsetHeight * ratio;\n    canvas.getContext('2d').scale(ratio, ratio);\n    this.signaturePad.clear(); // otherwise isEmpty() might return incorrect value\n  }\n\n  // Returns signature image as an array of point groups\n  public toData(): Array<PointGroup> {\n    if (this.signaturePad) {\n      return this.signaturePad.toData();\n    } else {\n      return [];\n    }\n  }\n\n  // Draws signature image from an array of point groups\n  public fromData(points: Array<PointGroup>): void {\n    this.signaturePad.fromData(points as any);\n  }\n\n  // Returns signature image as data URL (see https://mdn.io/todataurl for the list of possible paramters)\n  public toDataURL(imageType?: string, quality?: number): string {\n    return this.signaturePad.toDataURL(imageType, quality); // save image as data URL\n  }\n\n  // Draws signature image from data URL\n  public fromDataURL(dataURL: string, options: any = {}): void {\n    // set default height and width on read data from URL\n    if (\n      !options.hasOwnProperty('height') &&\n      (this.options as any).canvasHeight\n    ) {\n      options.height = (this.options as any).canvasHeight;\n    }\n    if (!options.hasOwnProperty('width') && (this.options as any).canvasWidth) {\n      options.width = (this.options as any).canvasWidth;\n    }\n    this.signaturePad.fromDataURL(dataURL, options);\n  }\n\n  // Clears the canvas\n  public clear(): void {\n    this.signaturePad.clear();\n  }\n\n  // Returns true if canvas is empty, otherwise returns false\n  public isEmpty(): boolean {\n    return this.signaturePad.isEmpty();\n  }\n\n  // Unbinds all event handlers\n  public off(): void {\n    this.signaturePad.off();\n  }\n\n  // Rebinds all event handlers\n  public on(): void {\n    this.signaturePad.on();\n  }\n\n  // set an option on the signaturePad - e.g. set('minWidth', 50);\n  public set(option: string, value: any): void {\n    switch (option) {\n      case 'canvasHeight':\n        this.signaturePad.canvas.height = value;\n        break;\n      case 'canvasWidth':\n        this.signaturePad.canvas.width = value;\n        break;\n      default:\n        this.signaturePad[option] = value;\n    }\n  }\n\n  // notify subscribers on signature begin\n  public onBegin(): void {\n    this.onBeginEvent.emit(true);\n  }\n\n  // notify subscribers on signature end\n  public onEnd(): void {\n    this.onEndEvent.emit(true);\n  }\n\n  public queryPad(): any {\n    return this.signaturePad;\n  }\n}\n"
  },
  {
    "path": "projects/angular2-signaturepad/src/lib/angular2-signaturepad.module.ts",
    "content": "import { NgModule } from '@angular/core';\nimport { SignaturePad } from './angular2-signaturepad.component';\n\n@NgModule({\n  declarations: [SignaturePad],\n  imports: [],\n  exports: [SignaturePad],\n})\nexport class SignaturePadModule {}\n"
  },
  {
    "path": "projects/angular2-signaturepad/src/public-api.ts",
    "content": "/*\n * Public API Surface of angular2-signaturepad\n */\n\nexport * from './lib/angular2-signaturepad.component';\nexport * from './lib/angular2-signaturepad.module';\n"
  },
  {
    "path": "projects/angular2-signaturepad/src/test.ts",
    "content": "// This file is required by karma.conf.js and loads recursively all the .spec and framework files\n\nimport 'zone.js';\nimport 'zone.js/testing';\nimport { getTestBed } from '@angular/core/testing';\nimport {\n  BrowserDynamicTestingModule,\n  platformBrowserDynamicTesting\n} from '@angular/platform-browser-dynamic/testing';\n\ndeclare const require: {\n  context(path: string, deep?: boolean, filter?: RegExp): {\n    keys(): string[];\n    <T>(id: string): T;\n  };\n};\n\n// First, initialize the Angular testing environment.\ngetTestBed().initTestEnvironment(\n  BrowserDynamicTestingModule,\n  platformBrowserDynamicTesting(), {\n    teardown: { destroyAfterEach: false }\n}\n);\n// Then we find all the tests.\nconst context = require.context('./', true, /\\.spec\\.ts$/);\n// And load the modules.\ncontext.keys().map(context);\n"
  },
  {
    "path": "projects/angular2-signaturepad/tsconfig.lib.json",
    "content": "/* To learn more about this file see: https://angular.io/config/tsconfig. */\n{\n  \"extends\": \"../../tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"../../out-tsc/lib\",\n    \"target\": \"es2015\",\n    \"declaration\": true,\n    \"declarationMap\": true,\n    \"inlineSources\": true,\n    \"types\": [],\n    \"lib\": [\n      \"dom\",\n      \"es2018\"\n    ]\n  },\n  \"angularCompilerOptions\": {\n    \"skipTemplateCodegen\": true,\n    \"strictMetadataEmit\": true,\n    \"enableResourceInlining\": true\n  },\n  \"exclude\": [\n    \"src/test.ts\",\n    \"**/*.spec.ts\"\n  ]\n}\n"
  },
  {
    "path": "projects/angular2-signaturepad/tsconfig.lib.prod.json",
    "content": "/* To learn more about this file see: https://angular.io/config/tsconfig. */\n{\n  \"extends\": \"./tsconfig.lib.json\",\n  \"compilerOptions\": {\n    \"declarationMap\": false\n  },\n  \"angularCompilerOptions\": {\n    \"compilationMode\": \"partial\"\n  }\n}\n"
  },
  {
    "path": "projects/angular2-signaturepad/tsconfig.spec.json",
    "content": "/* To learn more about this file see: https://angular.io/config/tsconfig. */\n{\n  \"extends\": \"../../tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"../../out-tsc/spec\",\n    \"types\": [\n      \"jasmine\"\n    ]\n  },\n  \"files\": [\n    \"src/test.ts\"\n  ],\n  \"include\": [\n    \"**/*.spec.ts\",\n    \"**/*.d.ts\"\n  ]\n}\n"
  },
  {
    "path": "projects/angular2-signaturepad/tslint.json",
    "content": "{\n  \"extends\": \"../../tslint.json\",\n  \"rules\": {\n    \"directive-selector\": [\n      true,\n      \"attribute\",\n      \"lib\",\n      \"camelCase\"\n    ],\n    \"component-selector\": [\n      true,\n      \"element\",\n      \"lib\",\n      \"kebab-case\"\n    ]\n  }\n}\n"
  },
  {
    "path": "signature-pad.ts",
    "content": "'use strict';\n\nimport {AfterContentInit, Component, ElementRef, EventEmitter, Input, Output, OnDestroy} from '@angular/core';\n\ndeclare var require: any;\n\nexport interface Point {\n  x: number;\n  y: number;\n  time: number;\n}\n\nexport type PointGroup = Array<Point>;\n\n@Component({\n  template: '<canvas></canvas>',\n  selector: 'signature-pad',\n})\n\nexport class SignaturePad implements AfterContentInit, OnDestroy {\n\n  @Input() public options: Object;\n  @Output() public onBeginEvent: EventEmitter<boolean>;\n  @Output() public onEndEvent: EventEmitter<boolean>;\n\n  private signaturePad: any;\n  private elementRef: ElementRef;\n\n  constructor(elementRef: ElementRef) {\n    // no op\n    this.elementRef = elementRef;\n    this.options = this.options || {};\n    this.onBeginEvent = new EventEmitter();\n    this.onEndEvent = new EventEmitter();\n  }\n\n  public ngAfterContentInit(): void {\n    const sp: any = require('signature_pad').default;\n    const canvas: any = this.elementRef.nativeElement.querySelector('canvas');\n\n    if ((this.options as any).canvasHeight) {\n      canvas.height = (this.options as any).canvasHeight;\n    }\n\n    if ((this.options as any).canvasWidth) {\n      canvas.width = (this.options as any).canvasWidth;\n    }\n\n    this.signaturePad = new sp(canvas, this.options);\n    this.signaturePad.onBegin = this.onBegin.bind(this);\n    this.signaturePad.onEnd = this.onEnd.bind(this);\n  }\n\n  public ngOnDestroy(): void {\n    const canvas: any = this.elementRef.nativeElement.querySelector('canvas');\n    canvas.width = 0;\n    canvas.height = 0;\n  }\n\n  public resizeCanvas(): void {\n    // When zoomed out to less than 100%, for some very strange reason,\n    // some browsers report devicePixelRatio as less than 1\n    // and only part of the canvas is cleared then.\n    const ratio: number = Math.max(window.devicePixelRatio || 1, 1);\n    const canvas: any = this.signaturePad._canvas;\n    canvas.width = canvas.offsetWidth * ratio;\n    canvas.height = canvas.offsetHeight * ratio;\n    canvas.getContext('2d').scale(ratio, ratio);\n    this.signaturePad.clear(); // otherwise isEmpty() might return incorrect value\n  }\n\n  // Returns signature image as an array of point groups\n  public toData(): Array<PointGroup> {\n    if (this.signaturePad) {\n      return this.signaturePad.toData();\n    } else {\n      return [];\n    }\n  }\n\n  // Draws signature image from an array of point groups\n  public fromData(points: Array<PointGroup>): void {\n    this.signaturePad.fromData(points);\n  }\n\n  // Returns signature image as data URL (see https://mdn.io/todataurl for the list of possible paramters)\n  public toDataURL(imageType?: string, quality?: number): string {\n    return this.signaturePad.toDataURL(imageType, quality); // save image as data URL\n  }\n\n  // Draws signature image from data URL\n  public fromDataURL(dataURL: string, options: any = {}): void {\n    // set default height and width on read data from URL\n    if (!options.hasOwnProperty('height') && (this.options as any).canvasHeight) {\n      options.height = (this.options as any).canvasHeight;\n    }\n    if (!options.hasOwnProperty('width') && (this.options as any).canvasWidth) {\n      options.width = (this.options as any).canvasWidth;\n    }\n    this.signaturePad.fromDataURL(dataURL, options);\n  }\n\n  // Clears the canvas\n  public clear(): void {\n    this.signaturePad.clear();\n  }\n\n  // Returns true if canvas is empty, otherwise returns false\n  public isEmpty(): boolean {\n    return this.signaturePad.isEmpty();\n  }\n\n  // Unbinds all event handlers\n  public off(): void {\n    this.signaturePad.off();\n  }\n\n  // Rebinds all event handlers\n  public on(): void {\n    this.signaturePad.on();\n  }\n\n  // set an option on the signaturePad - e.g. set('minWidth', 50);\n  public set(option: string, value: any): void {\n\n    switch (option) {\n      case 'canvasHeight':\n        this.signaturePad._canvas.height = value;\n        break;\n      case 'canvasWidth':\n        this.signaturePad._canvas.width = value;\n        break;\n      default:\n        this.signaturePad[option] = value;\n    }\n  }\n\n  // notify subscribers on signature begin\n  public onBegin(): void {\n    this.onBeginEvent.emit(true);\n  }\n\n  // notify subscribers on signature end\n  public onEnd(): void {\n    this.onEndEvent.emit(true);\n  }\n\n  public queryPad(): any {\n    return this.signaturePad;\n  }\n}\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compileOnSave\": false,\n  \"compilerOptions\": {\n    \"baseUrl\": \"./\",\n    \"outDir\": \"./dist/out-tsc\",\n    \"sourceMap\": true,\n    \"declaration\": false,\n    \"downlevelIteration\": true,\n    \"experimentalDecorators\": true,\n    \"moduleResolution\": \"node\",\n    \"importHelpers\": true,\n    \"target\": \"es2015\",\n    \"module\": \"es2020\",\n    \"lib\": [\"es2018\", \"dom\"],\n    \"paths\": {\n      \"angular2-signaturepad\": [\n        \"dist/angular2-signaturepad/angular2-signaturepad\",\n        \"dist/angular2-signaturepad\"\n      ]\n    }\n  },\n  \"angularCompilerOptions\": {}\n}\n"
  },
  {
    "path": "tslint.json",
    "content": "{\n  \"extends\": \"tslint:recommended\",\n  \"rulesDirectory\": [\n    \"codelyzer\"\n  ],\n  \"rules\": {\n    \"align\": {\n      \"options\": [\n        \"parameters\",\n        \"statements\"\n      ]\n    },\n    \"array-type\": false,\n    \"arrow-return-shorthand\": true,\n    \"curly\": true,\n    \"deprecation\": {\n      \"severity\": \"warning\"\n    },\n    \"eofline\": true,\n    \"import-blacklist\": [\n      true,\n      \"rxjs/Rx\"\n    ],\n    \"import-spacing\": true,\n    \"indent\": {\n      \"options\": [\n        \"spaces\"\n      ]\n    },\n    \"max-classes-per-file\": false,\n    \"max-line-length\": [\n      true,\n      140\n    ],\n    \"member-ordering\": [\n      true,\n      {\n        \"order\": [\n          \"static-field\",\n          \"instance-field\",\n          \"static-method\",\n          \"instance-method\"\n        ]\n      }\n    ],\n    \"no-console\": [\n      true,\n      \"debug\",\n      \"info\",\n      \"time\",\n      \"timeEnd\",\n      \"trace\"\n    ],\n    \"no-empty\": false,\n    \"no-inferrable-types\": [\n      true,\n      \"ignore-params\"\n    ],\n    \"no-non-null-assertion\": true,\n    \"no-redundant-jsdoc\": true,\n    \"no-switch-case-fall-through\": true,\n    \"no-var-requires\": false,\n    \"object-literal-key-quotes\": [\n      true,\n      \"as-needed\"\n    ],\n    \"quotemark\": [\n      true,\n      \"single\"\n    ],\n    \"semicolon\": {\n      \"options\": [\n        \"always\"\n      ]\n    },\n    \"space-before-function-paren\": {\n      \"options\": {\n        \"anonymous\": \"never\",\n        \"asyncArrow\": \"always\",\n        \"constructor\": \"never\",\n        \"method\": \"never\",\n        \"named\": \"never\"\n      }\n    },\n    \"typedef\": [\n      true,\n      \"call-signature\"\n    ],\n    \"typedef-whitespace\": {\n      \"options\": [\n        {\n          \"call-signature\": \"nospace\",\n          \"index-signature\": \"nospace\",\n          \"parameter\": \"nospace\",\n          \"property-declaration\": \"nospace\",\n          \"variable-declaration\": \"nospace\"\n        },\n        {\n          \"call-signature\": \"onespace\",\n          \"index-signature\": \"onespace\",\n          \"parameter\": \"onespace\",\n          \"property-declaration\": \"onespace\",\n          \"variable-declaration\": \"onespace\"\n        }\n      ]\n    },\n    \"variable-name\": {\n      \"options\": [\n        \"ban-keywords\",\n        \"check-format\",\n        \"allow-pascal-case\"\n      ]\n    },\n    \"whitespace\": {\n      \"options\": [\n        \"check-branch\",\n        \"check-decl\",\n        \"check-operator\",\n        \"check-separator\",\n        \"check-type\",\n        \"check-typecast\"\n      ]\n    },\n    \"component-class-suffix\": true,\n    \"contextual-lifecycle\": true,\n    \"directive-class-suffix\": true,\n    \"no-conflicting-lifecycle\": true,\n    \"no-host-metadata-property\": true,\n    \"no-input-rename\": true,\n    \"no-inputs-metadata-property\": true,\n    \"no-output-native\": true,\n    \"no-output-on-prefix\": true,\n    \"no-output-rename\": true,\n    \"no-outputs-metadata-property\": true,\n    \"template-banana-in-box\": true,\n    \"template-no-negated-async\": true,\n    \"use-lifecycle-interface\": true,\n    \"use-pipe-transform-interface\": true\n  }\n}\n"
  }
]