Skip to content

Instantly share code, notes, and snippets.

@Dominent
Created January 13, 2020 07:39
Show Gist options
  • Save Dominent/554c2b744ea5f3385df926988b91827b to your computer and use it in GitHub Desktop.
Save Dominent/554c2b744ea5f3385df926988b91827b to your computer and use it in GitHub Desktop.
/* tslint:disable */
export interface IOptions {
text: string;
width: number;
height: number;
colorDark: string;
colorLight: string;
correctLevel: CorrectLevel;
}
export const enum CorrectLevel {
M = 0,
L = 1,
H = 2,
Q = 3
}
export interface QRCodeConstructor {
/**
* @class QRCode
* @constructor
* @example
* new QRCode(document.getElementById("test"), "http://jindo.dev.naver.com/collie");
*
* @example
* var oQRCode = new QRCode("test", {
* text : "http://naver.com",
* width : 128,
* height : 128
* });
*
* oQRCode.clear(); // Clear the QRCode.
* oQRCode.makeCode("http://map.naver.com"); // Re-create the QRCode.
*
* @param {HTMLElement|String} el target element or 'id' attribute of element.
* @param {Object|String} vOption
* @param {String} vOption.text QRCode link data
* @param {Number} vOption.width 256
* @param {Number} vOption.height 256
* @param {String} vOption.colorDark "#000000"
* @param {String} vOption.colorLight "#ffffff"
* @param {QRCode.CorrectLevel} vOption.correctLevel QRCode.CorrectLevel.H [L|M|Q|H]
*/
new (el: HTMLElement, vOption: string | IOptions): IQrCode;
}
export interface IQrCode {
/**
* Make the QRCode
*
* @param {String} sText link data
*/
makeCode(sText: string): void;
/**
* Clear the QRCode
*/
clear(): void;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment