DefinitelyTyped/types/js-captcha/js-captcha-tests.ts
PikachuEXE e77f6edfe8
🤖 Merge PR #45052 * Update typing for js-captcha 1.3 by @PikachuEXE
* * Update typing for js-captcha 1.3

* Add back missing export

Mistake made during cut and paste

Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com>

Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com>
2020-06-01 08:36:19 -07:00

36 lines
610 B
TypeScript

import jCaptcha from "js-captcha";
const myCaptcha1 = new jCaptcha({
el: "jCaptcha1",
requiredValue: "*",
resetOnError: true,
focusOnError: true,
clearOnSubmit: true,
canvasClass: 'jCaptchaCanvas',
canvasStyle: {
width: 100,
height: 15,
textBaseline: 'top',
font: '15px Arial',
textAlign: 'left',
fillStyle: '#ddd'
},
callback: (response, captcha, numberOfTries) => {
if (response === "success") {
// Do something
}
if (response === "error") {
// Do something
}
},
});
const myCaptcha2 = new jCaptcha({
canvasStyle: {},
});