@sec-ant/qr-code-generator
Version:
A QR Code generator in Typescript
52 lines (51 loc) • 1.96 kB
TypeScript
import { byte, int } from "./utils.js";
import { QrSegment } from "./qr-segment.js";
export declare class QrCode {
readonly version: int;
readonly errorCorrectionLevel: Ecc;
static encodeText(text: string, ecl: Ecc): QrCode;
static encodeBinary(data: Readonly<byte[]>, ecl: Ecc): QrCode;
static encodeSegments(segs: Readonly<QrSegment[]>, ecl: Ecc, minVersion?: int, maxVersion?: int, mask?: int, boostEcl?: boolean): QrCode;
readonly size: int;
readonly mask: int;
private readonly modules;
private readonly isFunction;
constructor(version: int, errorCorrectionLevel: Ecc, dataCodewords: Readonly<byte[]>, msk: int);
getModule(x: int, y: int): boolean;
private drawFunctionPatterns;
private drawFormatBits;
private drawVersion;
private drawFinderPattern;
private drawAlignmentPattern;
private setFunctionModule;
private addEccAndInterleave;
private drawCodewords;
private applyMask;
private getPenaltyScore;
private getAlignmentPatternPositions;
private static getNumRawDataModules;
private static getNumDataCodewords;
private static reedSolomonComputeDivisor;
private static reedSolomonComputeRemainder;
private static reedSolomonMultiply;
private finderPenaltyCountPatterns;
private finderPenaltyTerminateAndCount;
private finderPenaltyAddHistory;
static readonly MIN_VERSION: int;
static readonly MAX_VERSION: int;
private static readonly PENALTY_N1;
private static readonly PENALTY_N2;
private static readonly PENALTY_N3;
private static readonly PENALTY_N4;
private static readonly ECC_CODEWORDS_PER_BLOCK;
private static readonly NUM_ERROR_CORRECTION_BLOCKS;
}
export declare class Ecc {
readonly ordinal: int;
readonly formatBits: int;
static readonly LOW: Ecc;
static readonly MEDIUM: Ecc;
static readonly QUARTILE: Ecc;
static readonly HIGH: Ecc;
private constructor();
}