nativescript-signaturepad
Version:
A NativeScript plugin to provide a way to capture signatures (and any other drawing) from the device screen.
46 lines (37 loc) • 1.36 kB
text/typescript
import definition = require("signaturepad");
import view = require("ui/core/view");
import {PropertyMetadata} from "ui/core/proxy";
import {Property, PropertyMetadataSettings} from "ui/core/dependency-observable";
var penColorProperty = new Property(
"penColor",
"SignaturePad",
new PropertyMetadata(undefined, PropertyMetadataSettings.None)
);
var penWidthProperty = new Property(
"penWidth",
"SignaturePad",
new PropertyMetadata(undefined, PropertyMetadataSettings.None)
);
export class SignaturePad extends view.View implements definition.SignaturePad {
public static penColorProperty = penColorProperty;
public static penWidthProperty = penWidthProperty;
public static drawingProperty: any;
constructor(options?: definition.Options) {
super(options);
}
get penColor(): number {
return this._getValue(SignaturePad.penColorProperty);
}
set penColor(value: number) {
this._setValue(SignaturePad.penColorProperty, value);
}
get penWidth(): number {
return this._getValue(SignaturePad.penWidthProperty);
}
set penWidth(value: number) {
this._setValue(SignaturePad.penWidthProperty, value);
}
get drawing(): any {
return this._getValue(SignaturePad.drawingProperty);
}
}