mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-04 12:31:50 +08:00
15 lines
398 B
TypeScript
15 lines
398 B
TypeScript
import * as QRCode from 'qrcode';
|
|
|
|
QRCode.toDataURL('i am a pony!', function (err, url) {
|
|
console.log(url);
|
|
});
|
|
|
|
var qrcodedraw = new QRCodeLib.QRCodeDraw();
|
|
|
|
qrcodedraw.draw(document.getElementById('test') as HTMLCanvasElement, "this text will be in the code!", function (error, canvas) {
|
|
if (error) {
|
|
return console.log('Error =( ', error);
|
|
}
|
|
console.log('success!');
|
|
});
|